mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-21 05:14:14 +00:00
Add controller and table for marking
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Marking;
|
||||
|
||||
class MarkingController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return Marking::all();
|
||||
}
|
||||
|
||||
public function show(Marking $marking)
|
||||
{
|
||||
return $marking;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$marking = Marking::create($request->all());
|
||||
|
||||
return response()->json($marking, 201);
|
||||
}
|
||||
|
||||
public function update(Request $request, Marking $marking)
|
||||
{
|
||||
$marking->update($request->all());
|
||||
|
||||
return response()->json($marking, 200);
|
||||
}
|
||||
|
||||
public function delete(Marking $marking)
|
||||
{
|
||||
$marking->delete();
|
||||
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user