I hereby claim:
- I am rfmeier on github.
- I am rfmeier_wpe (https://keybase.io/rfmeier_wpe) on keybase.
- I have a public key ASCjN3SgSBVet3Pu16VseFbv2e8-rjZDA4NR-T-eG9iQvAo
To claim this, I am signing this object:
{ | |
"success": true, | |
"data": { | |
"show_in_rest": true, | |
"show_in_graphql": true, | |
"singular": "Person", | |
"plural": "Persons", | |
"slug": "person", | |
"api_visibility": "private", | |
"model_icon": "dashicons-admin-post", |
<?php | |
/** | |
* Create a WP_REST_Response that uses ACM response data formatting. | |
* | |
* @param bool $success Whether the response was successful or not. | |
* @param array $data The data for the response. | |
* @param int $status Optional http status code. Default 200. | |
* @param array $headers Optional http headers. Default empty array. | |
* |
{ | |
"success": true, | |
"data": { | |
"name": "John Doe", | |
"username": "johndoe123" | |
} | |
} |
{ | |
"success": false, | |
"data": { | |
"name": [ | |
"Name is required", | |
"A second Name error message", | |
"A third Name error message" | |
], | |
"email": [ | |
"Email is required" |
{ | |
"code": "name", | |
"message": "Name is required", | |
"data": { | |
"status": 400 | |
}, | |
"additional_data": [ | |
{ | |
"status": 400 | |
} |
I hereby claim:
To claim this, I am signing this object:
<?php | |
/** | |
* Throw a ValidationException from within a Controller. | |
*/ | |
use Illuminate\Validation\ValidationException; | |
throw ValidationException::withMessages([ | |
'form_item_name' => ['Form item error message.'], | |
]); |
<?php | |
$is_authenticated = Auth::check(); | |
$is_guest = Auth::guest(); | |
// Using Auth facade | |
$user = Auth::user(); | |
// Using auth() helper | |
$user = auth()->user(); |
$ php artisan make:request ProductUpdateRequest |
<?php | |
/** | |
* Update the specified resource in storage. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @param \App\Product $product | |
* | |
* @return \Illuminate\Http\Response | |
*/ | |
public function update(Request $request, Product $product) |