Skip to content

Commit c172dd9

Browse files
init:commit laravel ui
1 parent 5305f22 commit c172dd9

25 files changed

+1771
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Foundation\Auth\ConfirmsPasswords;
8+
9+
class ConfirmPasswordController extends Controller
10+
{
11+
/*
12+
|--------------------------------------------------------------------------
13+
| Confirm Password Controller
14+
|--------------------------------------------------------------------------
15+
|
16+
| This controller is responsible for handling password confirmations and
17+
| uses a simple trait to include the behavior. You're free to explore
18+
| this trait and override any functions that require customization.
19+
|
20+
*/
21+
22+
use ConfirmsPasswords;
23+
24+
/**
25+
* Where to redirect users when the intended url fails.
26+
*
27+
* @var string
28+
*/
29+
protected $redirectTo = RouteServiceProvider::HOME;
30+
31+
/**
32+
* Create a new controller instance.
33+
*
34+
* @return void
35+
*/
36+
public function __construct()
37+
{
38+
$this->middleware('auth');
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7+
8+
class ForgotPasswordController extends Controller
9+
{
10+
/*
11+
|--------------------------------------------------------------------------
12+
| Password Reset Controller
13+
|--------------------------------------------------------------------------
14+
|
15+
| This controller is responsible for handling password reset emails and
16+
| includes a trait which assists in sending these notifications from
17+
| your application to your users. Feel free to explore this trait.
18+
|
19+
*/
20+
21+
use SendsPasswordResetEmails;
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Foundation\Auth\AuthenticatesUsers;
8+
9+
class LoginController extends Controller
10+
{
11+
/*
12+
|--------------------------------------------------------------------------
13+
| Login Controller
14+
|--------------------------------------------------------------------------
15+
|
16+
| This controller handles authenticating users for the application and
17+
| redirecting them to your home screen. The controller uses a trait
18+
| to conveniently provide its functionality to your applications.
19+
|
20+
*/
21+
22+
use AuthenticatesUsers;
23+
24+
/**
25+
* Where to redirect users after login.
26+
*
27+
* @var string
28+
*/
29+
protected $redirectTo = RouteServiceProvider::HOME;
30+
31+
/**
32+
* Create a new controller instance.
33+
*
34+
* @return void
35+
*/
36+
public function __construct()
37+
{
38+
$this->middleware('guest')->except('logout');
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use App\Models\User;
8+
use Illuminate\Foundation\Auth\RegistersUsers;
9+
use Illuminate\Support\Facades\Hash;
10+
use Illuminate\Support\Facades\Validator;
11+
12+
class RegisterController extends Controller
13+
{
14+
/*
15+
|--------------------------------------------------------------------------
16+
| Register Controller
17+
|--------------------------------------------------------------------------
18+
|
19+
| This controller handles the registration of new users as well as their
20+
| validation and creation. By default this controller uses a trait to
21+
| provide this functionality without requiring any additional code.
22+
|
23+
*/
24+
25+
use RegistersUsers;
26+
27+
/**
28+
* Where to redirect users after registration.
29+
*
30+
* @var string
31+
*/
32+
protected $redirectTo = RouteServiceProvider::HOME;
33+
34+
/**
35+
* Create a new controller instance.
36+
*
37+
* @return void
38+
*/
39+
public function __construct()
40+
{
41+
$this->middleware('guest');
42+
}
43+
44+
/**
45+
* Get a validator for an incoming registration request.
46+
*
47+
* @param array $data
48+
* @return \Illuminate\Contracts\Validation\Validator
49+
*/
50+
protected function validator(array $data)
51+
{
52+
return Validator::make($data, [
53+
'name' => ['required', 'string', 'max:255'],
54+
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
55+
'password' => ['required', 'string', 'min:8', 'confirmed'],
56+
]);
57+
}
58+
59+
/**
60+
* Create a new user instance after a valid registration.
61+
*
62+
* @param array $data
63+
* @return \App\Models\User
64+
*/
65+
protected function create(array $data)
66+
{
67+
return User::create([
68+
'name' => $data['name'],
69+
'email' => $data['email'],
70+
'password' => Hash::make($data['password']),
71+
]);
72+
}
73+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Foundation\Auth\ResetsPasswords;
8+
9+
class ResetPasswordController extends Controller
10+
{
11+
/*
12+
|--------------------------------------------------------------------------
13+
| Password Reset Controller
14+
|--------------------------------------------------------------------------
15+
|
16+
| This controller is responsible for handling password reset requests
17+
| and uses a simple trait to include this behavior. You're free to
18+
| explore this trait and override any methods you wish to tweak.
19+
|
20+
*/
21+
22+
use ResetsPasswords;
23+
24+
/**
25+
* Where to redirect users after resetting their password.
26+
*
27+
* @var string
28+
*/
29+
protected $redirectTo = RouteServiceProvider::HOME;
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
namespace App\Http\Controllers\Auth;
4+
5+
use App\Http\Controllers\Controller;
6+
use App\Providers\RouteServiceProvider;
7+
use Illuminate\Foundation\Auth\VerifiesEmails;
8+
9+
class VerificationController extends Controller
10+
{
11+
/*
12+
|--------------------------------------------------------------------------
13+
| Email Verification Controller
14+
|--------------------------------------------------------------------------
15+
|
16+
| This controller is responsible for handling email verification for any
17+
| user that recently registered with the application. Emails may also
18+
| be re-sent if the user didn't receive the original email message.
19+
|
20+
*/
21+
22+
use VerifiesEmails;
23+
24+
/**
25+
* Where to redirect users after verification.
26+
*
27+
* @var string
28+
*/
29+
protected $redirectTo = RouteServiceProvider::HOME;
30+
31+
/**
32+
* Create a new controller instance.
33+
*
34+
* @return void
35+
*/
36+
public function __construct()
37+
{
38+
$this->middleware('auth');
39+
$this->middleware('signed')->only('verify');
40+
$this->middleware('throttle:6,1')->only('verify', 'resend');
41+
}
42+
}
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace App\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
7+
class HomeController extends Controller
8+
{
9+
/**
10+
* Create a new controller instance.
11+
*
12+
* @return void
13+
*/
14+
public function __construct()
15+
{
16+
$this->middleware('auth');
17+
}
18+
19+
/**
20+
* Show the application dashboard.
21+
*
22+
* @return \Illuminate\Contracts\Support\Renderable
23+
*/
24+
public function index()
25+
{
26+
return view('home');
27+
}
28+
}

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"laravel/framework": "^9.19",
1111
"laravel/sanctum": "^3.0",
1212
"laravel/tinker": "^2.7",
13+
"laravel/ui": "^4.2",
1314
"mcamara/laravel-localization": "^1.7"
1415
},
1516
"require-dev": {

composer.lock

+62-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

database/migrations/2014_10_12_100000_create_password_resets_table.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public function up()
1515
{
1616
Schema::create('password_resets', function (Blueprint $table) {
17-
$table->string('email')->primary();
17+
$table->string('email')->index();
1818
$table->string('token');
1919
$table->timestamp('created_at')->nullable();
2020
});

0 commit comments

Comments
 (0)