Created
November 11, 2017 22:01
-
-
Save hanspagel/57c92eb87da896a5c55225405be95c9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Models\Project; | |
use Illuminate\Http\Request; | |
class ProjectController extends Controller | |
{ | |
public function update(Request $request, Project $project) | |
{ | |
$project->update([ | |
'title' => $request->title, | |
]); | |
// API Resource with `202 Accepted` Response | |
return (new ProjectResource($project)) | |
->response() | |
->setStatusCode(202); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
greate but how set fail status code and stop other codes?