mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 08:44:46 +02:00
21 lines
431 B
PHP
21 lines
431 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use App\Models\Location;
|
|
|
|
class LocationFormRequest extends AdminFormRequest
|
|
{
|
|
/**
|
|
* Set up the validation rules to use for these requests.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
if ($this->method() === 'PATCH') {
|
|
return Location::getRulesForUpdate($this->route()->parameter('location')->id);
|
|
}
|
|
|
|
return Location::getRules();
|
|
}
|
|
}
|