24 lines
456 B
PHP
24 lines
456 B
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\Question;
|
|
use App\Models\Service;
|
|
|
|
/**
|
|
* @codeCoverageIgnore
|
|
*/
|
|
class QuestionPolicy
|
|
{
|
|
/**
|
|
* Check if the question belongs to the service
|
|
*
|
|
* @param Service $service
|
|
* @param Question $question
|
|
* @return boolean
|
|
*/
|
|
public function questionBelongsToService(Service $service, Question $question)
|
|
{
|
|
return $service->brand->id === $question->brand_id;
|
|
}
|
|
}
|