Chron
201
7
Laravel

Call to undefined method error

Posted 1 month ago by Chron

I have a Registrar model.


namespace App;

use App\Account;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class Registrar extends Authenticatable
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $guarded = [];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];

    public function account() {
        return $this->belongsTo(Account::class);
    }
}

Whenever I call Registrar::all() or anything related to the model in the tinker, I get the error. I have other similar models but I don't have any problems with them.

Please sign in or create an account to participate in this conversation.