Skip to content

Instantly share code, notes, and snippets.

@codeperl
Last active October 15, 2021 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeperl/94ebdcb6b86d003e64da43fec31179a9 to your computer and use it in GitHub Desktop.
Save codeperl/94ebdcb6b86d003e64da43fec31179a9 to your computer and use it in GitHub Desktop.
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\AboutUsService;
use App\Services\Contracts\AboutUsContract;
use App\Services\Contracts\IndexPageContract;
use App\Services\IndexPageService;
use Illuminate\Http\Request;
class AboutUsController extends Controller
{
/** @var AboutUsContract|AboutUsService */
private $aboutUsService;
public function __construct(AboutUsContract $aboutUsService)
{
$this->aboutUsService = $aboutUsService;
}
public function __invoke()
{
return view('web.front.components.about-us', [
'aboutUs' => $this->aboutUsService->get()
]);
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\BannerService;
use App\Services\Contracts\BannerContract;
use App\Services\Contracts\IndexPageContract;
use App\Services\IndexPageService;
use Illuminate\Http\Request;
class BannerController extends Controller
{
/** @var BannerContract|BannerService */
private $bannerService;
public function __construct(BannerContract $bannerService)
{
$this->bannerService = $bannerService;
}
public function __invoke()
{
return view('web.front.components.banners', [
'banners' => $this->bannerService->getSortedBanners()
]);
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\ClientCategoryService;
use App\Services\ClientService;
use App\Services\Contracts\ClientCategoryContract;
use App\Services\Contracts\ClientContract;
use App\Services\Contracts\IndexPageContract;
use App\Services\IndexPageService;
use Illuminate\Http\Request;
class ClientController extends Controller
{
/** @var ClientCategoryContract|ClientCategoryService */
private $clientCategoryService;
/** @var ClientContract|ClientService */
private $clientService;
public function __construct(ClientCategoryContract $clientCategoryService, ClientContract $clientService)
{
$this->clientCategoryService = $clientCategoryService;
$this->clientService = $clientService;
}
public function __invoke()
{
return view('web.front.components.clients', [
'clientsCount' => $this->clientService->getCount(),
'clientCategoriesWithClients' => $this->clientCategoryService->getCategoriesWithOrderedClients()
]);
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\Contracts\EventContract;
use App\Services\Contracts\IndexPageContract;
use App\Services\EventService;
use App\Services\IndexPageService;
use Illuminate\Http\Request;
class EventController extends Controller
{
/** @var EventContract|EventService */
private $eventService;
public function __construct(EventContract $eventService)
{
$this->eventService = $eventService;
}
public function __invoke()
{
return view('web.front.components.events', [
'events' => $this->eventService->getLatestPublished(3),
]);
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front;
use App\Http\Controllers\Controller;
use App\Services\Contracts\IndexPageContract;
use App\Services\IndexPageService;
class IndexController extends Controller
{
/** @var IndexPageContract|IndexPageService */
private $indexPageService;
public function __construct(IndexPageContract $indexPageService)
{
$this->indexPageService = $indexPageService;
}
public function index()
{
return view('web.front.index.index', $this->indexPageService->all());
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\Contracts\IndexPageContract;
use App\Services\Contracts\ManagementContract;
use App\Services\IndexPageService;
use App\Services\ManagementService;
use Illuminate\Http\Request;
class ManagementController extends Controller
{
/** @var ManagementContract|ManagementService */
private $managementService;
public function __construct(ManagementContract $managementService)
{
$this->managementService = $managementService;
}
public function __invoke()
{
return view('web.front.components.managements', [
'managements' => $this->managementService->getSortedManagements()
]);
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\Contracts\IndexPageContract;
use App\Services\Contracts\MarketConcentrationContract;
use App\Services\IndexPageService;
use App\Services\MarketConcentrationService;
use Illuminate\Http\Request;
class MarketConcentrationController extends Controller
{
/** @var MarketConcentrationContract|MarketConcentrationService */
private $marketConcentrationService;
public function __construct(MarketConcentrationContract $marketConcentrationService)
{
$this->marketConcentrationService = $marketConcentrationService;
}
public function __invoke()
{
return view('web.front.components.market-concentration', [
'marketConcentrations' => $this->marketConcentrationService->getSortedMarketConcentrations()
]);
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\Contracts\IndexPageContract;
use App\Services\Contracts\PortfolioContract;
use App\Services\IndexPageService;
use App\Services\PortfolioCategoryService;
use App\Services\PortfolioService;
use Illuminate\Http\Request;
class PortfolioController extends Controller
{
/** @var PortfolioCategoryService */
private $portfolioCategoryService;
/** @var PortfolioContract|PortfolioService */
private $portfolioService;
public function __construct(PortfolioCategoryService $portfolioCategoryService, PortfolioContract $portfolioService)
{
$this->portfolioCategoryService = $portfolioCategoryService;
$this->portfolioService = $portfolioService;
}
public function __invoke()
{
return view('web.front.components.portfolios', [
'portfolios' => $this->portfolioService->getSortedPortfolios(),
'portfolioCategories' => $this->portfolioCategoryService->getSortedPortfolioCategories(),
]);
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\Contracts\IndexPageContract;
use App\Services\Contracts\ProductContract;
use App\Services\IndexPageService;
use App\Services\ProductService;
use Illuminate\Http\Request;
class ProductController extends Controller
{
/** @var ProductContract|ProductService */
private $productService;
public function __construct(ProductContract $productService)
{
$this->productService = $productService;
}
public function __invoke()
{
return view('web.front.components.products', [
'products' => $this->productService->getSortedProducts(),
]);
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\Contracts\IndexPageContract;
use App\Services\Contracts\ResourceInfoContract;
use App\Services\IndexPageService;
use App\Services\ResourceInfoService;
use Illuminate\Http\Request;
class ResourceController extends Controller
{
/** @var ResourceInfoContract|ResourceInfoService */
private $resourceInfoService;
public function __construct(ResourceInfoContract $resourceInfoService)
{
$this->resourceInfoService = $resourceInfoService;
}
public function __invoke()
{
return view('web.front.components.resource', [
'resourceInfo' => $this->resourceInfoService->get()
]);
}
}
```
```php
<?php
namespace App\Http\Controllers\Web\Front\Components;
use App\Http\Controllers\Controller;
use App\Services\Contracts\IndexPageContract;
use App\Services\Contracts\TestimonialContract;
use App\Services\IndexPageService;
use App\Services\TestimonialService;
use Illuminate\Http\Request;
class TestimonialController extends Controller
{
/** @var TestimonialContract|TestimonialService */
private $testimonialService;
public function __construct(TestimonialContract $testimonialService)
{
$this->testimonialService = $testimonialService;
}
public function __invoke()
{
return view('web.front.components.testimonials', [
'testimonials' => $this->testimonialService->getSortedTestimonials(),
]);
}
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment