1$myRequest = new \Illuminate\Http\Request();
2$myRequest->setMethod('POST'); //default METHOD
3$myRequest->request->add(['foo' => 'bar']);
4dd($request->foo);
1/**
2 * Store a new blog post.
3 *
4 * @param Request $request
5 * @return Response
6 */
7public function store(Request $request)
8{
9 $validatedData = $request->validate([
10 'title' => 'required|unique:posts|max:255',
11 'body' => 'required',
12 ]);
13
14 // The blog post is valid...
15}
1# <values> = foo,bar,...
2# <field> = array field
3# <characters> = amount of characters
4
5# accepted # active_url
6# after:<tomorrow> # after_or_equal:<tomorrow>
7# alpha # alpha_dash
8# alpha_num # array
9# bail # before:<today>
10# before_or_equal:<today> # between:min,max
11# boolean # confirmed
12# date # date_equals:<today>
13# date_format:<format> # different:<name>
14# digits:<value> # digits_between:min,max
15# dimensions:<min/max_with> # distinct
16# email # ends_with:<values>
17# exclude_if:<field>,<value> # exclude_unless:<field>,<value>
18# exists:<table>,<column> # file
19# filled # gt:<field>
20# gte:<field> # image
21# in:<values> # in_array:<field>
22# integer # ip
23# ipv4 # ipv6
24# json # lt:<field>
25# lte:<field> # max:<value>
26# mimetypes:video/avi,... # mimes:jpeg,bmp,png
27# min:<value> # not_in:<values>
28# not_regex:<pattern> # nullable
29# numeric # password:<auth guard>
30# present # regex:<pattern>
31# required # required_if:<field>,<value>
32# required_unless:<field>,<value> # required_with:<fields>
33# required_with_all:<fields> # required_without:<fields>
34# required_without_all:<fields> # same:<field>
35# size:<characters> # starts_with:<values>
36# string # timezone
37# unique:<table>,<column> # url
38# uuid