mardi 29 décembre 2015

Call to a member function isClient() on a non-object

I am getting below error

Call to a member function isClient() on a non-object

When is it occurring ?

I have a Post route http://localhost/auth/logout When I press the logout button then this action method gets called.

Below is my User model

class User_Model extends Model implements AuthenticatableContract,
                                    AuthorizableContract,
                                    CanResetPasswordContract
{
    use Authenticatable, Authorizable, CanResetPassword;

    protected $table = 'tblusers';

    protected $fillable = ['UserName', 'EmailAddress', 'Password', 'RoleID', 'IsActive'];

    protected $hidden = ['Password', 'remember_token'];

    protected $primaryKey = "UserID";

    public function isClient() 
    {
        return $this->RoleID == \App\Enumeration\Role\RoleType::Client ? 1 : 0;
    }
}

Below is my route.php file

<?php
Route::group(['middleware' => 'web'], function() {

    Route::get('/View-Profile', 'User\Account_Controller@ViewProfile');
    Route::get('/auth/logout', 'Auth\AuthController@getLogout');
});

Question

Am I missing something ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire