skip to Main Content

laravel eloquent chunk ->with method

It seems that eloquent uses a single query for "with" regardless of how many ids there are Book::with('author')->get(); This would trigger those two queries: SELECT * FROM books; SELECT * FROM authors WHERE id IN (...); The second query may…

VIEW QUESTION

Laravel Policies – $this->authorize not working

Task policy: class TaskPolicy { use HandlesAuthorization; public function canSeeTeam() { return true; } } AuthServiceProvider: class AuthServiceProvider extends ServiceProvider { protected $policies = [ 'AppModelsTask' => 'AppPoliciesTaskPolicy', ]; Task controller: public function update(Request $request, Task $task) { $this->authorize('canSeeTeam'); dd('Authorized!');…

VIEW QUESTION
Back To Top
Search