rappasoft / laravel-boilerplate

The Laravel Boilerplate Project - https://laravel-boilerplate.com
https://rappasoft.com
5.59k stars 1.58k forks source link

error when accessing access/roles page #274

Closed mikimaine closed 8 years ago

mikimaine commented 8 years ago

the style will break and have error message oops something went wrong.

when i see the log file it says in model.php :1011 is not a valid class name.

i haven't add any custom model it is the fresh install

blomdahldaniel commented 8 years ago

Have you generated a new .env file? Because if you have, and it is set accordingly to the code below, you should get the error message directly in the browser.

    APP_ENV=local
    APP_DEBUG=true

I guess you installed all the composer dependencies and followed the installation instructions successfully?

mikimaine commented 8 years ago

ok here is the error message when i set APP_DEBUG=true

FatalErrorException in Model.php line 1011: Class name must be a valid object or a string

the page i access are : http://localhost:8888/admin/access/roles and http://localhost:8888/admin/access/roles/permissions . is this related with entrust??

mikimaine commented 8 years ago

when i see the server log this is the error :

127.0.0.1:42597 [500]: /admin/access/roles/permissions - Class name must be a valid object or a string in /var/www/html/ecommerce/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php on line 1011 [Sun Feb 7 16:20:03 2016] 127.0.0.1:42598 Invalid request (Unexpected EOF) [Sun Feb 7 16:20:43 2016] 127.0.0.1:42605 Invalid request (Unexpected EOF)

rappasoft commented 8 years ago

Entrust is not included in this project, it has a custom access system. That is a laravel error, which may stem from a PHP error. What version are you running?

Make sure your server meets all the laravel requirements for this version and composer and all the packaged are updated.

mikimaine commented 8 years ago

im running version 5.6 on Ubuntu and other models perfectly work except for the the role and permission models ?? and it perfectly work on version 5.1 but this happens in v5.2

mikimaine commented 8 years ago

I think the error is raised in the rolerelationship trait. permissions() method when returning belongstomany(). The first parameter is config(access.permission) and laravel is saying it is not a valid object or string

I have heck the config file but it looks correct to me .

I don't know why but only that method return this error

mikimaine commented 8 years ago

Ohh finally I found the problem and now it is solved The error was the users relation in both rolerelationship and permissionrelationship trait the config(auth.model) should be config(auth.providers.users.model) when using laravel 5.2

Thanks all!

rappasoft commented 8 years ago

Was it a problem in the project or just your local version?

mikimaine commented 8 years ago

It was downloaded 2 weeks ago . I will try with the current commit

mikimaine commented 8 years ago

It was downloaded 2 weeks ago . I will try with the current commit

blomdahldaniel commented 8 years ago

Did you find any success/solution @mikimaine ?

mikimaine commented 8 years ago

yes changing config(auth.model) to config(auth.providers.users.model) in both rolerelationship and permissionrelationship trait solved my problem! thanks

blomdahldaniel commented 8 years ago

Glad to hear!