src/Http/Requests/ProductRequest.php
<?php
namespace Grafite\Commerce\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
use Grafite\Commerce\Models\Product;
class ProductRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return Gate::allows('cms', auth()->user());
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return Product::$rules;
}
}