mercredi 15 novembre 2017

laravel eloquent resources api send status code

In Laravel 5.5 We can set API through resources (http://ift.tt/2xNPH7m), but how can we send STATUS CODE?

Also how should I set status dynamically which is defined in with()

//namespace App\Http\Resources;

//use Illuminate\Http\Resources\Json\Resource;

//class User extends Resource 

public function with($request)
{
    return [
        'status' => 'success',
    ];
}



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2hvSvQL
via IFTTT

Aucun commentaire:

Enregistrer un commentaire