-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49b31d4
commit 96b827d
Showing
14 changed files
with
240 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
resources/views/public/_composers/widgets/footer-widget.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@php($columns = config('arcanesoft.seo.widgets.footers.columns', 1)) | ||
|
||
@include("seo::public._composers.widgets.footers.{$columns}-col-links") |
1 change: 1 addition & 0 deletions
1
resources/views/public/_composers/widgets/footers/1-col-links.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@include('seo::public._composers.widgets.footers._links', ['items' => $seoFooters]) |
8 changes: 8 additions & 0 deletions
8
resources/views/public/_composers/widgets/footers/2-col-links.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="row"> | ||
@foreach($seoFooters->chunk(ceil($seoFooters->count() / 2)) as $items) | ||
<div class="col-sm-6"> | ||
@include('seo::public._composers.widgets.footers._links', ['items' => $items]) | ||
</div> | ||
@endforeach | ||
</div> | ||
|
8 changes: 8 additions & 0 deletions
8
resources/views/public/_composers/widgets/footers/4-col-links.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="row"> | ||
@foreach($seoFooters->chunk(ceil($seoFooters->count() / 4)) as $items) | ||
<div class="col-sm-6 col-md-3"> | ||
@include('seo::public._composers.widgets.footers._links', ['items' => $items]) | ||
</div> | ||
@endforeach | ||
</div> | ||
|
7 changes: 7 additions & 0 deletions
7
resources/views/public/_composers/widgets/footers/_links.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<ul class="footer-links-widget"> | ||
@foreach($items as $item) | ||
<li> | ||
{{ link_to_route('public::seo.footers.show', $item->name.' '.$item->localization, [$item->uri]) }} | ||
</li> | ||
@endforeach | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@extends('_templates.default.master') | ||
|
||
@section('page-title') | ||
{{ $footer->seo->title }} | ||
@endsection | ||
|
||
@section('content') | ||
<div class="container"> | ||
{!! $footer->content !!} | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php namespace Arcanesoft\Seo\Http\Controllers\Front; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Arcanesoft\Seo\Models\Footer; | ||
|
||
/** | ||
* Class FootersController | ||
* | ||
* @package Arcanesoft\Seo\Http\Controllers\Front | ||
* @author ARCANEDEV <arcanedev.maroc@gmail.com> | ||
*/ | ||
class FootersController extends Controller | ||
{ | ||
/* ----------------------------------------------------------------- | ||
| Main Methods | ||
| ----------------------------------------------------------------- | ||
*/ | ||
public function show(Footer $footer) | ||
{ | ||
$footer->load(['seo']); | ||
|
||
$this->setTitle($footer->seo->title); | ||
$this->addBreadcrumb($footer->seo->title); | ||
|
||
return $this->view('seo::public.footer-page', compact('footer')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php namespace Arcanesoft\Seo\Http\Routes\Front; | ||
|
||
use Arcanedev\Support\Routing\RouteRegistrar; | ||
use Arcanesoft\Seo\Models\Footer; | ||
|
||
/** | ||
* Class FootersRoutes | ||
* | ||
* @package Arcanesoft\Seo\Http\Routes\Front | ||
* @author ARCANEDEV <arcanedev.maroc@gmail.com> | ||
*/ | ||
class FootersRoutes extends RouteRegistrar | ||
{ | ||
/* ----------------------------------------------------------------- | ||
| Main Methods | ||
| ----------------------------------------------------------------- | ||
*/ | ||
/** | ||
* Define the routes for the application. | ||
*/ | ||
public function map() | ||
{ | ||
$this->bind('seo_footer_uri', function ($uri) { | ||
return Footer::where('uri', $uri) | ||
->where('locale', config('app.locale')) | ||
->firstOrFail(); | ||
}); | ||
|
||
$this->group(config('arcanesoft.seo.widgets.footers.route', []), function () { | ||
$this->get('{seo_footer_uri}.html', 'FootersController@show')->name('show'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php namespace Arcanesoft\Seo\Providers; | ||
|
||
use Arcanedev\Support\Providers\ViewComposerServiceProvider as ServiceProvider; | ||
|
||
use Arcanesoft\Seo\ViewComposers\Front\FooterWidgetComposer; | ||
|
||
/** | ||
* Class ViewComposerServiceProvider | ||
* | ||
* @package Arcanesoft\Seo\Providers | ||
* @author ARCANEDEV <arcanedev.maroc@gmail.com> | ||
*/ | ||
class ViewComposerServiceProvider extends ServiceProvider | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Properties | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Register the composer classes. | ||
* | ||
* @var array | ||
*/ | ||
protected $composerClasses = [ | ||
// Dashboard view composers | ||
|
||
|
||
// Public view composers (Widgets) | ||
FooterWidgetComposer::VIEW => FooterWidgetComposer::class, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php namespace Arcanesoft\Seo\ViewComposers\Front; | ||
|
||
use Arcanesoft\Seo\Models\Footer; | ||
use Arcanesoft\Seo\ViewComposers\ViewComposer; | ||
use Illuminate\Contracts\View\View; | ||
|
||
/** | ||
* Class FooterWidgetComposer | ||
* | ||
* @package Arcanesoft\Seo\ViewComposers\Front | ||
* @author ARCANEDEV <arcanedev.maroc@gmail.com> | ||
*/ | ||
class FooterWidgetComposer extends ViewComposer | ||
{ | ||
/* ----------------------------------------------------------------- | ||
| Constants | ||
| ----------------------------------------------------------------- | ||
*/ | ||
const VIEW = 'seo::public._composers.widgets.footer-widget'; | ||
|
||
/* ----------------------------------------------------------------- | ||
| Main Methods | ||
| ----------------------------------------------------------------- | ||
*/ | ||
/** | ||
* Compose the view. | ||
* | ||
* @param \Illuminate\Contracts\View\View $view | ||
*/ | ||
public function compose(View $view) | ||
{ | ||
$this->view = $view; | ||
|
||
$this->view->with('seoFooters', Footer::all()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php namespace Arcanesoft\Seo\ViewComposers; | ||
|
||
use Closure; | ||
use Illuminate\Support\Facades\Cache; | ||
|
||
/** | ||
* Class ViewComposer | ||
* | ||
* @package Arcanesoft\Seo\Bases | ||
* @author ARCANEDEV <arcanedev.maroc@gmail.com> | ||
*/ | ||
class ViewComposer | ||
{ | ||
/* ------------------------------------------------------------------------------------------------ | ||
| Properties | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* The View instance. | ||
* | ||
* @var \Illuminate\Contracts\View\View | ||
*/ | ||
protected $view; | ||
|
||
/** | ||
* Caching time. | ||
* | ||
* @var int | ||
*/ | ||
protected $minutes = 5; | ||
|
||
/* ------------------------------------------------------------------------------------------------ | ||
| Other Functions | ||
| ------------------------------------------------------------------------------------------------ | ||
*/ | ||
/** | ||
* Cache the results. | ||
* | ||
* @param string $name | ||
* @param \Closure $callback | ||
* | ||
* @return mixed | ||
*/ | ||
protected function cacheResults($name, Closure $callback) | ||
{ | ||
return Cache::remember('cache::' . $name, $this->minutes, $callback); | ||
} | ||
} |