📜  laravel 资源设置状态码 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:41.332000             🧑  作者: Mango

代码示例1
use App\User;
use App\Http\Resources\User as UserResource;

Route::get('/user', function () {
    return (new UserResource(User::find(1)))
               ->response()
               ->setStatusCode(200);
});