Trait 'Illuminate\Foundation\Auth\Access\Autho

2019-06-16 00:04发布

enter image description here

Anyone familiar with this error i'm getting?

Please help thanks.

标签: laravel-5
3条回答
可以哭但决不认输i
2楼-- · 2019-06-16 00:22

Does Laravel connect to database? I had this error and it was caused by a wrong database configuration in .env file.

Try these settings in .env file:

1. Open .env file in your project's folder.
Don't touch the .env.example file found in the same location as it's an example of .env default configuration. If something goes wrong with your .env file, you can copy and paste the configuration from the .env.example file to .env.

2. Change the following 4 lines to your own configuration:

DB_HOST=localhost
DB_DATABASE=forge
DB_USERNAME=forge
DB_PASSWORD=

DB_DATABASE It's the name of your database. Should be 'forge' by default or check your phpMyAdmin to determine which database you need to use. You can create a new database if you're an administrator of phpMyAdmin ('root' user).
DB_USERNAME This is your username when you log in to phpMyAdmin. Should be 'forge' by default.
DB_PASSWORD Your phpMyAdmin should not be protected with password by default. The password is set later manually. In case you'll set the password, add it to DB_PASSWORD line after you do so.

3. Save the modified .env file and restart the Apache server.

Try to access your webpage again.

This worked for me. I hope it's gonna work for you, too.

P.S. If it doesn't work, check if the .env configuration is right for you. Or use php artisan config:clear to clear cache.

查看更多
仙女界的扛把子
3楼-- · 2019-06-16 00:25

If you are using Laravel 5.3 do the following:

From the upgrade guides: The AuthorizesResources Trait

The AuthorizesResources trait has been merged with the AuthorizesRequests trait. You should remove the AuthorizesResources trait from your app/Http/Controllers/Controller.php file.

查看更多
狗以群分
4楼-- · 2019-06-16 00:28

Seems like the problem is with your version of laravel/framework.. Running composer update should pull in the latest version (which is 5.2.39). If that doesn't work for you, then I'm not sure what else you can do. Perhaps try composer self-update before you do it.

If you run composer info laravel/framework the 4th line should show you the latest version from packagist, which is: 5.2.39.

Edit: You could try and clear your package cache: composer clearcache

查看更多
登录 后发表回答