Skip to content

Commit

Permalink
refactor(home): clean up unused methods and improve code formatting
Browse files Browse the repository at this point in the history
Removed commented-out methods in `HomeController` and improved readability of queries by adjusting formatting.
  • Loading branch information
frederic moras committed Dec 28, 2024
1 parent ee41486 commit bfea351
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 86 deletions.
92 changes: 9 additions & 83 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,90 +13,16 @@ public function __invoke()
$customerData = CustomerData::first();
$themeColor = 'manu-potvin-color';

$favoritesRealisations = Realisation::with(['media'])->favorites()->get();
$serviceRealisations = Realisation::with(['media'])->favorites($favoritesRealisations->pluck('id'))->get();
ray()->clearScreen();
ray($serviceRealisations);
//ray($serviceRealisations)->die();
$favoritesRealisations = Realisation::with(['media'])
->favorites()
->get();

$serviceRealisations = Realisation::with(['media'])
->favorites($favoritesRealisations->pluck('id'))
->get();


return view('home', compact('themeColor','customerData', 'favoritesRealisations', 'serviceRealisations'));
}
//
// public function main()
// {
// $themeColor = '';
// return view('Frontend.Homes.home1', compact('themeColor'));
// }
//
// public function consulting()
// {
// $themeColor = 'home-blue';
// return view('Frontend.Homes.home2', compact('themeColor'));
// }
//
// public function home()
// {
// $themeColor = 'manu-potvin-color';
// return view('Frontend.Homes.home3', compact('themeColor'));
// }
//
// public function insurance()
// {
// $themeColor = 'home-violet';
// return view('Frontend.Homes.home4', compact('themeColor'));
// }
//
// public function marketing()
// {
// $themeColor = 'home-blue2';
// return view('Frontend.Homes.home5', compact('themeColor'));
// }
//
// public function finance()
// {
// $themeColor = 'index-sixindex-six';
// return view('Frontend.Homes.home6', compact('themeColor'));
// }
//
// public function humanResource()
// {
// $themeColor = 'index-seven hr';
// return view('Frontend.Homes.home7', compact('themeColor'));
// }
//
// public function itsolution()
// {
// $themeColor = 'home-blue medium-blue';
// return view('Frontend.Homes.home8', compact('themeColor'));
// }
//
// public function modernAgency()
// {
// $themeColor = 'home-nine';
// return view('Frontend.Homes.home9', compact('themeColor'));
// }
//
// public function stratupAgency()
// {
// $themeColor = 'home-blue home-ten';
// return view('Frontend.Homes.home10', compact('themeColor'));
// }
//
// public function brandingAgency()
// {
// $themeColor = 'home-blue home-ten home-eleven';
// return view('Frontend.Homes.home11', compact('themeColor'));
// }
//
// public function businessAgency()
// {
// $themeColor = 'twelve-body loaded';
// return view('Frontend.Homes.home12', compact('themeColor'));
// }
//
// public function businessManagement()
// {
// $themeColor = 'thirteen-body loaded';
// return view('Frontend.Homes.home13', compact('themeColor'));
// }

}
6 changes: 3 additions & 3 deletions app/Models/Realisation.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Spatie\MediaLibrary\ResponsiveImages\ResponsiveImageGenerator;

/**
*
*
*
* @property-read mixed $gallery_images
* @property-read mixed $image
Expand Down Expand Up @@ -203,8 +203,8 @@ public function scopeFavorites($query,$blackListIds = null )
$query->where('favorite', true)
->orWhereNotNull('media.id');
})
->groupBy('category')
->orderByRaw('CASE WHEN favorite = 1 THEN 1 ELSE 2 END, media.created_at DESC');
/* ->groupBy('category')
->orderByRaw('CASE WHEN favorite = 1 THEN 1 ELSE 2 END, media.created_at DESC')*/;
}

}

0 comments on commit bfea351

Please sign in to comment.