mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-21 13:24:27 +00:00
add model,controller,migration,api
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\SettingBeneficiary;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SettingBeneficiaryController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return SettingBeneficiary::all();
|
||||
}
|
||||
|
||||
public function show(SettingBeneficiary $beneficiary)
|
||||
{
|
||||
return $beneficiary;
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$beneficiary = SettingBeneficiary::create($request->all());
|
||||
|
||||
return response()->json($beneficiary, 201);
|
||||
}
|
||||
|
||||
public function update(Request $request, SettingBeneficiary $beneficiary)
|
||||
{
|
||||
$beneficiary->update($request->all());
|
||||
|
||||
return response()->json($beneficiary, 200);
|
||||
}
|
||||
|
||||
public function delete(SettingBeneficiary $beneficiary)
|
||||
{
|
||||
$beneficiary->delete();
|
||||
|
||||
return response()->json(null, 204);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user