faithgen /
events
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Innoflash\Events\Policies; |
||
| 4 | |||
| 5 | use App\Models\Ministry; |
||
|
0 ignored issues
–
show
|
|||
| 6 | use Illuminate\Auth\Access\HandlesAuthorization; |
||
| 7 | use Innoflash\Events\Models\Event; |
||
| 8 | |||
| 9 | class EventPolicy |
||
| 10 | { |
||
| 11 | use HandlesAuthorization; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Determine whether the ministry can view the event. |
||
| 15 | * |
||
| 16 | * @param \ $ministry |
||
| 17 | * @param \Innoflash\Events\Models\Event $event |
||
| 18 | * @return mixed |
||
| 19 | */ |
||
| 20 | public function view(Ministry $ministry, Event $event) |
||
| 21 | { |
||
| 22 | return $ministry->id === $event->ministry_id; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Determine whether the ministry can create events. |
||
| 27 | * |
||
| 28 | * @param \ $ministry |
||
| 29 | * @return mixed |
||
| 30 | */ |
||
| 31 | public function create(Ministry $ministry) |
||
| 32 | { |
||
| 33 | if ($ministry->account->level === 'Free') { |
||
| 34 | return false; |
||
| 35 | } |
||
| 36 | if ($ministry->events()->where(request()->only(['name', 'start', 'end']))->count()) { |
||
| 37 | abort(403, 'You already registered this event'); |
||
| 38 | } else { |
||
| 39 | return true; |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Determine whether the ministry can update the event. |
||
| 45 | * |
||
| 46 | * @param \ $ministry |
||
| 47 | * @param \Innoflash\Events\Models\Event $event |
||
| 48 | * @return mixed |
||
| 49 | */ |
||
| 50 | public function update(Ministry $ministry, Event $event) |
||
| 51 | { |
||
| 52 | return $ministry->id === $event->ministry_id; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Determine whether the ministry can delete the event. |
||
| 57 | * |
||
| 58 | * @param \ $ministry |
||
| 59 | * @param \Innoflash\Events\Models\Event $event |
||
| 60 | * @return mixed |
||
| 61 | */ |
||
| 62 | public function delete(Ministry $ministry, Event $event) |
||
| 63 | { |
||
| 64 | return $ministry->id === $event->ministry_id; |
||
| 65 | } |
||
| 66 | } |
||
| 67 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths