PATH:
home
/
lab2454c
/
sportsnovate.com
/
backups
/
core
/
app
/
Http
/
Controllers
/
Admin
<?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use App\Models\Category; use App\Models\Specification; use Illuminate\Http\Request; use Illuminate\Support\Str; class SpecificationController extends Controller { public function index() { $pageTitle = "Manage Specification"; $emptyMessage = "No data found"; $categorys = Category::where('status', 1)->select('id', 'name')->get(); $specifications = Specification::latest()->with('category')->paginate(getPaginate()); return view('admin.specification.index', compact('pageTitle', 'emptyMessage', 'categorys', 'specifications')); } public function store(Request $request) { $request->validate([ 'name' => 'required|max:120', 'category_id' => 'required|exists:categories,id' ]); $specification = new Specification(); $specification->name = $request->name; $specification->slug = Str::slug($request->name); $specification->category_id = $request->category_id; $specification->save(); $notify[] = ['success', 'Specification has been created']; return back()->withNotify($notify); } public function update(Request $request) { $request->validate([ 'id'=>'required|exists:specifications,id', 'category_id'=>'required|exists:categories,id', 'name'=>'required|max:120', ]); $specification = Specification::findOrFail($request->id); $specification->name = $request->name; $specification->slug = Str::slug($request->name); $specification->category_id = $request->category_id; $specification->save(); $notify[] = ['success', 'Specification has been updated']; return back()->withNotify($notify); } }
[-] SubcategoryController.php
[edit]
[-] CategoryController.php
[edit]
[-] FrontendController.php
[edit]
[-] PageBuilderController.php
[edit]
[-] WithdrawalController.php
[edit]
[-] SupportTicketController.php
[edit]
[-] SpecificationController.php
[edit]
[-] AdvertisementController.php
[edit]
[+]
..
[-] HomeImageController.php
[edit]
[-] DepositController.php
[edit]
[-] ProductContentController.php
[edit]
[-] ExtensionController.php
[edit]
[-] MomentContentController.php
[edit]
[-] DynamicPageController.php
[edit]
[-] ManageUsersController.php
[edit]
[-] ReportController.php
[edit]
[-] GatewayController.php
[edit]
[-] EmailTemplateController.php
[edit]
[-] FaqContentController.php
[edit]
[-] OrderController.php
[edit]
[-] BrandController.php
[edit]
[-] ManualGatewayController.php
[edit]
[-] AdminController.php
[edit]
[+]
Auth
[-] LanguageController.php
[edit]
[-] WithdrawMethodController.php
[edit]
[-] FashionNftController.php
[edit]
[-] GeneralSettingController.php
[edit]
[-] ProductController.php
[edit]
[-] SmsTemplateController.php
[edit]