[請益] laravel request->all()

作者: robinnpca (rob)   2018-03-17 12:05:26
解決了但想請問為何?
用 $search_all['name'] 就可在view中讀到
不過想請問的是
為何範例都是 request->all() 然後$search_all->name
為何網上的介紹是這樣寫的?
Retrieving Input Via Dynamic Properties
You may also access user input using dynamic properties on the
Illuminate\Http\Request instance. For example, if one of your application's
forms contains a name field, you may access the value of the field like so:
$name = $request->name;
When using dynamic properties, Laravel will first look for the parameter's
value in the request payload. If it is not present, Laravel will search for
the field in the route parameters.
作者: y2468101216 (芸)   2018-03-17 13:54:00
你去看request all回傳的就知道了他回傳的是array而非obj

Links booklink

Contact Us: admin [ a t ] ucptt.com