php artisan make:rule Uppercase
public function store(Request $request) {
$this->validate($request, [
'name' => 'required|string',
'body' => 'required|string',
'publish_at' => 'required|date_format:Y-m-d H:i:s'
], [
'name.required' => 'A article name is required',
'body.required' => 'A article body is required',
'publish_at.date_format' => 'The publish at date is not in the correct format.'
]);
// The request validated and this code will get run
...
}
public function store(Request $request) {
$this->validate($request, [
'name' => 'required|string',
'body' => 'required|string',
'publish_at' => 'required|date_format:Y-m-d H:i:s'
], [
'name.required' => 'A article name is required',
'body.required' => 'A article body is required',
'publish_at.date_format' => 'The publish at date is not in the correct format.'
]);
// The request validated and this code will get run
...
}