PATH:
home
/
lab2454c
/
credityorkgroup.com
/
app
/
Http
/
Controllers
/
Admin
<?php namespace App\Http\Controllers\Admin; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use App\Models\HomeTitle; use Illuminate\Support\Facades\Storage; use Illuminate\Http\File; class HomeTitleController extends Controller { public function __construct() { $this->middleware('auth:admin'); } /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $data['homeTitles'] = HomeTitle::get(); return view('admin.homepageManager.title.list', $data); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(HomeTitle $homeTitle) { $data['homeTitle'] = $homeTitle; return view('admin.homepageManager.title.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, HomeTitle $homeTitle) { $changed = false; $values = $request->validate([ "explore_title" => 'required|string|max:200', "explore_content" => 'required|string|max:400', "explore_link_text" => 'required|string|max:100', "explore_link" => 'required|string|max:100', "service_image"=>'nullable|image|max:3000', "product_title" => 'required|string|max:200', "product_content" => 'required|string|max:200', "testimonial_title" => 'required|string|max:200', "testimonial_content" => 'required|string|max:200', "subscription_title" => 'required|string|max:200', "subscription_content" => 'required|string|max:200', "contact_title" => 'required|string|max:200', "contact_content" => 'required|string|max:200', ]); if ($request->service_image) { Storage::delete($homeTitle->service_image); $values['service_image'] = Storage::putFile('public/homePageImages', new File($request->service_image)); } $homeTitle->fill($request->except('service_image')); if (isset($values['service_image'])) { $homeTitle->service_image = $values['service_image']; } if ($homeTitle->isDirty()) { $homeTitle->save(); $changed = true; } if (! $changed) { toast('No changes done to save','warning'); return redirect()->route('homeTitle.index')->withErrors('No changes done to save'); } toast('Titles is updated successsfully!','success'); return redirect()->route('homeTitle.index'); } }
[-] HomeBannerController.php
[edit]
[-] EventController.php
[edit]
[-] CategoryController.php
[edit]
[-] PasswordController.php
[edit]
[-] CareerController.php
[edit]
[-] CareerContentController.php
[edit]
[+]
..
[-] EventContentController.php
[edit]
[-] SiteSettingController.php
[edit]
[-] ServiceController.php
[edit]
[-] PageController.php
[edit]
[-] TestimonialController.php
[edit]
[-] HomeTitleController.php
[edit]
[-] SocialLinkController.php
[edit]
[-] FeaturedProductController.php
[edit]
[-] ExploreController.php
[edit]
[-] MinerPageController.php
[edit]
[-] AdminUserController.php
[edit]
[-] LeadershipController.php
[edit]
[-] FaqController.php
[edit]
[-] CommodityTraderPageController.php
[edit]
[-] GalleryController.php
[edit]
[-] LoginController.php
[edit]
[-] MinerContentController.php
[edit]
[-] TraderBannerLinkController.php
[edit]
[-] DashboardController.php
[edit]
[-] MinerBannerLinkController.php
[edit]
[-] CommodityTraderContentController.php
[edit]