ClearBowl/api/app/Http/Requests/AddRecipeRequest.php

42 lines
849 B
PHP
Raw Normal View History

2019-12-15 15:45:22 +01:00
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class AddRecipeRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required',
'steps' => 'required',
'ingredients' => 'required',
];
}
public function messages()
{
return [
'name.required' => 'Product name is required',
'steps.required' => 'Recipe steps are required',
'ingredients.required' => 'Recipe ingredients are required',
];
}
}