mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-17 11:04:07 -08:00
41 lines
759 B
PHP
41 lines
759 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use App\Models\Asset;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
use Illuminate\Support\Facades\Gate;
|
|
|
|
class StoreAssetRequest extends ImageUploadRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return Gate::allows('create', new Asset);
|
|
}
|
|
|
|
public function prepareForValidation(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
$rules = array_merge(
|
|
(new Asset)->getRules(),
|
|
parent::rules(),
|
|
);
|
|
|
|
return $rules;
|
|
}
|
|
}
|