remove local scope for another query eloquent - development

remove local scope for another query eloquent

I Have Two Model

User and Task which have many-to-many relationship.

In UserController:

public function show(User $user)
{
    return view('users.show', compact('user'));
}

in users/show.blade.php :

Posts: @include('users.show.tasks',['tasks'=>$user->tasks()]);

in users/show/tasks.blade.php :

Active Tasks Count :

Query:

select count(*) as aggregate from `tasks` inner join `user_task` on `tasks`.`id` = `user_task`.`task_id` where `user_task`.`user_id` = '1' and `status` = '4';

Pending Posts Count:

Query:

select count(*) as aggregate from `tasks` inner join `user_task` on `tasks`.`id` = `user_task`.`task_id` where `user_task`.`user_id` = '1' and `status` = '4' and `status` = '3';

When I Check The Query By laravel-debugbar , For the second count , I See I Have two status code in query



from Laravel Questions and Answers https://laravelquestions.com/php/remove-local-scope-for-another-query-eloquent/
via Lzo Media

Comments

Popular posts from this blog

How can I solve "laravel/horizon v1.1.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system"? - development

CORS issue between web/android/ios

Angular.js ng-click with mouse middle button