-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
criação de api restful para conceitos
- Loading branch information
1 parent
d0891f2
commit 0df463f
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Illuminate\Http\Request; | ||
use App\Models\Conceito; | ||
|
||
class ConceitoControllerApi extends Controller | ||
{ | ||
|
||
public function index() | ||
{ | ||
return Conceito::all(); | ||
} | ||
|
||
|
||
public function store(Request $request) | ||
{ | ||
Conceito::create($request->all()); | ||
} | ||
|
||
|
||
public function show($id) | ||
{ | ||
return Conceito::find($id); | ||
} | ||
|
||
public function update(Request $request, $id) | ||
{ | ||
$conceito = Conceito::find($id); | ||
$conceito->update($request->all()); | ||
} | ||
|
||
public function destroy($id) | ||
{ | ||
$conceito = Conceito::find($id); | ||
$conceito->delete(); | ||
} | ||
} |
This file contains 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
This file contains 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