laravel json read code example
Example 1: php laravel return json response
return response()->json([
'name' => 'Abigail',
'state' => 'CA'
]);
Example 2: laravel json response
return response()->json([
'name' => 'Abigail',
'state' => 'CA',
]);
Example 3: laravel json eloquent
protected $casts = [
'birthday' => 'date:Y-m-d',
'joined_at' => 'datetime:Y-m-d H:00',
];