32 lines
733 B
PHP
32 lines
733 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Bo\Approaches;
|
|
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class UpdateApproachRequest extends StoreApproachRequest
|
|
{
|
|
/**
|
|
* Prepare the data for validation.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function prepareForValidation(): void
|
|
{
|
|
$this->merge([
|
|
'type' => intval($this->route()->parameter('approach')->type),
|
|
'published' => $this->boolean('published')
|
|
]);
|
|
$this->mergePicture('picture');
|
|
}
|
|
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return boolean
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return Gate::check('update', $this->route('approach'));
|
|
}
|
|
}
|