Only thing that catches my eye is in the composer.json I don't see.
"app/models",
Witch would make sense because no matter how many times you composer dump-autoload you don't have it were composer can even see the models directory.
Example: https://github.com/efficiently/laravel_authority-controller_app/blob/master/composer.json
@dragonfire1119 thanks for your reply. I actually removed app/models
directory. I put my controllers
, models
(which I now called entities
) in apps/src/IAPON/
directory where I also namespaced them. I did put back app/models
as you suggested but I'm still getting the same Exception error.
Found the solution. It has something to do with efficiently/authority
package.
UsersController.php
Before:
class UsersController extends BaseController {
public function __construct()
{
$this->loadAndAuthorizeResource();
}
// rest of the code...
Solution:
class UsersController extends BaseController {
public function __construct()
{
$this->loadAndAuthorizeResource(['class' => "IAPON\\Entities\\User"]);
}
// rest of the code...
Reference: https://github.com/efficiently/authority-controller/wiki/Authorizing-controller-actions
If the model class is namespaced differently than the controller you will need to specify the class
option.
epcliff said:
Found the solution. It has something to do with
efficiently/authority
package.UsersController.php
Before:
class UsersController extends BaseController { public function __construct() { $this->loadAndAuthorizeResource(); } // rest of the code...
Solution:
class UsersController extends BaseController { public function __construct() { $this->loadAndAuthorizeResource(['class' => "IAPON\\Entities\\User"]); } // rest of the code...
Reference: https://github.com/efficiently/authority-controller/wiki/Authorizing-controller-actions
If the model class is namespaced differently than the controller you will need to specify the
class
option.
Glad that you found the problem I had a feeling that it was something with the package because I've never used it. I didn't realize that you moved the controllers ETC.. else where.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community