diff --git a/README.md b/README.md index b269a85..f9b89b5 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ import ExampleComponent from './components/ExampleComponent.vue'; Vue.component('example-component', ExampleComponent); ``` -To use the component in your application, you may drop it into one of your HTML templates. For example, after running the `php artisan ui vue --auth` Artisan command to scaffold your application's authentication and registration screens, you could drop the component into the `home.blade.php` Blade template: +To use the component in your application, you may drop it into one of your HTML templates. For example, after running the `php artisan ui vue --auth` Artisan command to scaffold your application's authentication and registration screens, you could drop the component into the `dashboard.blade.php` Blade template: ```blade @extends('layouts.app') diff --git a/auth-backend/AuthenticatesUsers.php b/auth-backend/AuthenticatesUsers.php index 147607a..c1f975f 100644 --- a/auth-backend/AuthenticatesUsers.php +++ b/auth-backend/AuthenticatesUsers.php @@ -29,6 +29,7 @@ public function showLoginForm() * * @throws \Illuminate\Validation\ValidationException */ + public function login(Request $request) { $this->validateLogin($request); diff --git a/auth-backend/RedirectsUsers.php b/auth-backend/RedirectsUsers.php index cc99229..5273b6a 100644 --- a/auth-backend/RedirectsUsers.php +++ b/auth-backend/RedirectsUsers.php @@ -15,6 +15,6 @@ public function redirectPath() return $this->redirectTo(); } - return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home'; + return property_exists($this, 'redirectTo') ? $this->redirectTo : '/dashboard'; } } diff --git a/auth-backend/ResetsPasswords.php b/auth-backend/ResetsPasswords.php index 9a87f78..6c97328 100644 --- a/auth-backend/ResetsPasswords.php +++ b/auth-backend/ResetsPasswords.php @@ -53,7 +53,7 @@ public function reset(Request $request) ); // If the password was successfully reset, we will redirect the user back to - // the application's home authenticated view. If there is an error we can + // the application's dashboard authenticated view. If there is an error we can // redirect them back to where they came from with their error message. return $response == Password::PASSWORD_RESET ? $this->sendResetResponse($request, $response) diff --git a/src/Auth/bootstrap-stubs/home.stub b/src/Auth/bootstrap-stubs/dashboard.stub similarity index 100% rename from src/Auth/bootstrap-stubs/home.stub rename to src/Auth/bootstrap-stubs/dashboard.stub diff --git a/src/Auth/stubs/controllers/HomeController.stub b/src/Auth/stubs/controllers/HomeController.stub deleted file mode 100644 index 63a1e36..0000000 --- a/src/Auth/stubs/controllers/HomeController.stub +++ /dev/null @@ -1,28 +0,0 @@ -middleware('auth'); - } - - /** - * Show the application dashboard. - * - * @return \Illuminate\Contracts\Support\Renderable - */ - public function index() - { - return view('home'); - } -} diff --git a/src/Auth/stubs/routes.stub b/src/Auth/stubs/routes.stub index cc02897..6d8fb14 100644 --- a/src/Auth/stubs/routes.stub +++ b/src/Auth/stubs/routes.stub @@ -1,4 +1,6 @@ Auth::routes(); -Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); +Route::get('/dashboard', function () { + return view('dashboard'); +})->middleware(['auth', 'verified'])->name('dashboard'); \ No newline at end of file diff --git a/src/AuthCommand.php b/src/AuthCommand.php index 564bf94..5adfdca 100644 --- a/src/AuthCommand.php +++ b/src/AuthCommand.php @@ -38,7 +38,7 @@ class AuthCommand extends Command 'auth/passwords/reset.stub' => 'auth/passwords/reset.blade.php', 'auth/register.stub' => 'auth/register.blade.php', 'auth/verify.stub' => 'auth/verify.blade.php', - 'home.stub' => 'home.blade.php', + 'dashboard.stub' => 'dashboard.blade.php', 'layouts/app.stub' => 'layouts/app.blade.php', ]; @@ -115,16 +115,6 @@ protected function exportBackend() { $this->callSilent('ui:controllers'); - $controller = app_path('Http/Controllers/HomeController.php'); - - if (file_exists($controller) && ! $this->option('force')) { - if ($this->components->confirm("The [HomeController.php] file already exists. Do you want to replace it?", true)) { - file_put_contents($controller, $this->compileStub('controllers/HomeController')); - } - } else { - file_put_contents($controller, $this->compileStub('controllers/HomeController')); - } - $baseController = app_path('Http/Controllers/Controller.php'); if (file_exists($baseController) && ! $this->option('force')) { diff --git a/stubs/Auth/ConfirmPasswordController.stub b/stubs/Auth/ConfirmPasswordController.stub index 3559954..358ebf3 100644 --- a/stubs/Auth/ConfirmPasswordController.stub +++ b/stubs/Auth/ConfirmPasswordController.stub @@ -25,7 +25,7 @@ class ConfirmPasswordController extends Controller * * @var string */ - protected $redirectTo = '/home'; + protected $redirectTo = '/dashboard'; /** * Create a new controller instance. diff --git a/stubs/Auth/LoginController.stub b/stubs/Auth/LoginController.stub index b2ea669..47b1902 100644 --- a/stubs/Auth/LoginController.stub +++ b/stubs/Auth/LoginController.stub @@ -13,7 +13,7 @@ class LoginController extends Controller |-------------------------------------------------------------------------- | | This controller handles authenticating users for the application and - | redirecting them to your home screen. The controller uses a trait + | redirecting them to your dashboard screen. The controller uses a trait | to conveniently provide its functionality to your applications. | */ @@ -25,7 +25,7 @@ class LoginController extends Controller * * @var string */ - protected $redirectTo = '/home'; + protected $redirectTo = '/dashboard'; /** * Create a new controller instance. diff --git a/stubs/Auth/RegisterController.stub b/stubs/Auth/RegisterController.stub index 961ea36..c1ddd11 100644 --- a/stubs/Auth/RegisterController.stub +++ b/stubs/Auth/RegisterController.stub @@ -28,7 +28,7 @@ class RegisterController extends Controller * * @var string */ - protected $redirectTo = '/home'; + protected $redirectTo = '/dashboard'; /** * Create a new controller instance. diff --git a/stubs/Auth/ResetPasswordController.stub b/stubs/Auth/ResetPasswordController.stub index fe965b2..f0f0360 100644 --- a/stubs/Auth/ResetPasswordController.stub +++ b/stubs/Auth/ResetPasswordController.stub @@ -25,5 +25,5 @@ class ResetPasswordController extends Controller * * @var string */ - protected $redirectTo = '/home'; + protected $redirectTo = '/dashboard'; } diff --git a/stubs/Auth/VerificationController.stub b/stubs/Auth/VerificationController.stub index 23a43a8..294a49e 100644 --- a/stubs/Auth/VerificationController.stub +++ b/stubs/Auth/VerificationController.stub @@ -25,7 +25,7 @@ class VerificationController extends Controller * * @var string */ - protected $redirectTo = '/home'; + protected $redirectTo = '/dashboard'; /** * Create a new controller instance.