|string> */ public function rules(): array { // append rules to default validation rules return [ 'all' => 'bool', // all or not 'Ids.*' => Rule::exists('files', 'id') // check that file exists in database ->where(fn($query) => $query->where('created_by', Auth::id())) // check file was made by current user ]; } }