|
@@ -0,0 +1,65 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace App\Http\Controllers\API;
|
|
|
+
|
|
|
+use App\Http\Controllers\Controller;
|
|
|
+use App\Http\Requests\API\Plan\CreateOrUpdateRequest;
|
|
|
+use App\Models\Plan;
|
|
|
+use Illuminate\Http\Request;
|
|
|
+use Illuminate\Support\Facades\Auth;
|
|
|
+
|
|
|
+class PlanController extends Controller
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * Display a listing of the resource.
|
|
|
+ */
|
|
|
+ public function index()
|
|
|
+ {
|
|
|
+ //
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Store a newly created resource in storage.
|
|
|
+ */
|
|
|
+ public function store(CreateOrUpdateRequest $request)
|
|
|
+ {
|
|
|
+ $plan = new Plan();
|
|
|
+
|
|
|
+ $plan->mergeFillable([
|
|
|
+ 'company_id'
|
|
|
+ ]);
|
|
|
+
|
|
|
+ $plan->fill([
|
|
|
+ ...$request->all(),
|
|
|
+ 'company_id' => Auth::user()->company_id,
|
|
|
+ ]);
|
|
|
+
|
|
|
+ $plan->save();
|
|
|
+
|
|
|
+ return $this->created();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Display the specified resource.
|
|
|
+ */
|
|
|
+ public function show(string $id)
|
|
|
+ {
|
|
|
+ //
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Update the specified resource in storage.
|
|
|
+ */
|
|
|
+ public function update(Request $request, string $id)
|
|
|
+ {
|
|
|
+ //
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Remove the specified resource from storage.
|
|
|
+ */
|
|
|
+ public function destroy(string $id)
|
|
|
+ {
|
|
|
+ //
|
|
|
+ }
|
|
|
+}
|