Skip to content

Instantly share code, notes, and snippets.

@maxca
Created May 31, 2018 01:40
Show Gist options
  • Select an option

  • Save maxca/805e75b561bfa0c26223f92a607e3015 to your computer and use it in GitHub Desktop.

Select an option

Save maxca/805e75b561bfa0c26223f92a607e3015 to your computer and use it in GitHub Desktop.
<?php
/**
* @author samark chaisanguan
* @email samarkchsngn@gmail.com
*/
namespace App\Http\Requests\Blog;
use Lumpineevill\Request\APIRequest;
class CreateBlogRequest extends APIRequest
{
/**
* 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.
* simple rule below this.
* required | exists | required_if | email | interger | date| date_format | between | array | json | boolean |
* max | min | confirmed | differece | alpha | alpha_numeric | acitve(url) | accepted |distinct | file | same
* size | string | timezone | unique | url | nullable | not_in| digits | digits_between | mime_type | mime_type_by_file_extension
* in_array | ip_address | image | regex:patten |
* @return array
*/
public function rules()
{
return [
'topic' => 'required',
'detail' => 'required',
];
}
/**
* If need to overiding message of node
* @return array
*/
public function messages()
{
return [];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment