I am trying to call Sentry::
from within an Eloquent model. However, I am getting the error
Non-static method Cartalyst\Sentry\Sentry::getUserProvider() should not be called statically, assuming $this from incompatible context
Current code is below. What am I doing wrong?
<?php
namespace App\Model;
use Cartalyst\Sentry\Users\Eloquent\User as CartalystUser;
use Cartalyst\Sentry\Sentry;
class User extends CartalystUser {
protected $table = 'users';
protected $hidden = array('password');
public function __construct() {
$users = Sentry::getUserProvider()->findAll();
print_r($users);
exit;
}
public function brands() {
return $this->hasMany('Brand');
}
}
?>