Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| QuestionPolicy | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | n/a |
0 / 0 |
|||
| questionBelongsToService | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | |||||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Policies; |
| 4 | |
| 5 | use App\Models\Question; |
| 6 | use App\Models\Service; |
| 7 | |
| 8 | /** |
| 9 | * @codeCoverageIgnore |
| 10 | */ |
| 11 | class QuestionPolicy |
| 12 | { |
| 13 | /** |
| 14 | * Check if the question belongs to the service |
| 15 | * |
| 16 | * @param Service $service |
| 17 | * @param Question $question |
| 18 | * @return boolean |
| 19 | */ |
| 20 | public function questionBelongsToService(Service $service, Question $question) |
| 21 | { |
| 22 | return $service->brand->id === $question->brand_id; |
| 23 | } |
| 24 | } |