FIXED AFTER I REPORTED THE BUG - laravel new project --auth doesn't create HomeController.php

前端 未结 2 399
北荒
北荒 2021-01-17 06:15

I have created a new laravel project with --auth, but HomeController hasn\'t been created. I have tried with composer require laravel/ui and php artisan ui vue --auth in an

相关标签:
2条回答
  • 2021-01-17 06:47

    It was a bug that was fixed by the Laravel staff in Laravel UI version 2.0.3.

    bug fixed by official staff

    0 讨论(0)
  • 2021-01-17 06:52

    The HomeController is not being created at the time of writing 29-Apr-2020 a quick workaround is to create it manually:

    php artisan make:controller HomeController
    

    and then fill it with the following code:

    <?php
    
    namespace App\Http\Controllers;
    
    use Illuminate\Http\Request;
    
    class HomeController extends Controller
    {
        /**
         * Create a new controller instance.
         *
         * @return void
         */
        public function __construct()
        {
            $this->middleware('auth');
        }
    
        /**
         * Show the application dashboard.
         *
         * @return \Illuminate\Contracts\Support\Renderable
         */
        public function index()
        {
            return view('home');
        }
    }
    
    0 讨论(0)
提交回复
热议问题