4 months ago

Share data between views and causes migration error

Posted 4 months ago by wizjo

In my AppServiceProvider.php I have line to share users data between views:

public function boot()
    View::share('all_users', User::mostActive()->where('active', '=', 1)->get()->pluck('full_name_company_email', 'id'));

The problem is that this line cause error while doing migrations by php artisan migrate command:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'wizjo_crm.users' doesn't exist

...beacuse AppServiceProvider searches for table "users" before it is created by migrations.

Any ideas how to solve that?

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