user(); } public function store(Request $request) { BasePolicy::allow(app('modelDocument')?->storePolicy); return ILaravel::create($request->all()); } public function show(ILaravel $ILaravel) { BasePolicy::allow(app('modelDocument')?->getPolicy, $ILaravel); return $ILaravel; } public function update(ILaravel $ILaravel, Request $request) { BasePolicy::allow(app('modelDocument')?->updatePolicy, $ILaravel); $ILaravel->update($request->all()); return $ILaravel; } public function destroy(ILaravel $ILaravel) { BasePolicy::allow(app('modelDocument')?->{$ILaravel->trashed() ? 'restorePolicy' : 'deletePolicy'}, $ILaravel); if ($ILaravel->trashed()) { return tap($ILaravel, fn() => $ILaravel->restore()); } $ILaravel->delete(); return Successful::make(); } }