Call to undefined method App\Models\User::follow()

Updated at 26-Aug-2021, By samar

Call to undefined method AppModelsUser::follow()

We’ll attempt to use programming in this lesson to solve the "Call to undefined method AppModelsUser::follow()" puzzle.

If you get an error call to undefined method App\Models\User::follow() in Overtrue\LaravelFollow\ laravel package then you must import the followable trait in your user model. Because you call the follow method without importing the followable trait in your laravel project.
  • Import Overtrue\LaravelFollow\Followable trait in user model in laravel

    --PATH app\Models\User.php
    use Overtrue\LaravelFollow\Followable;
    class User extends Authenticatable
        use Followable;

Back to code snippet queries related laravel