PATH:
home
/
lab2454c
/
.trash
/
core
/
app
/
Http
/
Controllers
/
Admin
<?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\HomeImage; class HomeImageController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $data['pageTitle'] = 'Home Images List'; $data['homeImages'] = HomeImage::all(); return view('admin.frontend.homeImage.index', $data); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(HomeImage $homeImage) { $data['pageTitle'] = 'Edit Home Images'; $data['homeImage'] = $homeImage; return view('admin.frontend.homeImage.edit', $data); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, HomeImage $homeImage) { $changed = false; $values = $request->validate([ 'second_section_image'=>'nullable|image|max:2000', 'small_banner_image'=>'nullable|image|max:2000', ]); if ($request->hasFile('second_section_image')) { $path = imagePath()['momentContent']['path']; try { $filename = uploadImage($values['second_section_image'], $path); $homeImage->second_section_image = $filename; $changed = true; $homeImage->save(); } catch (\Exception $exp) { $notify[] = ['errors', 'Image could not be uploaded.']; return back()->withNotify($notify); } } if ($request->hasFile('small_banner_image')) { $path = imagePath()['momentContent']['path']; try { $filename = uploadImage($values['small_banner_image'], $path); $homeImage->small_banner_image = $filename; $changed = true; $homeImage->save(); } catch (\Exception $exp) { $notify[] = ['errors', 'Image could not be uploaded.']; return back()->withNotify($notify); } } if (! $changed) { $notify[] = ['warning', 'No changes done to save']; return redirect()->route('admin.frontend.homeImage.index')->withNotify($notify); } $notify[] = ['success', 'Content has been Updated']; return redirect()->route('admin.frontend.homeImage.index')->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]