Skip to content

Commit

Permalink
Adding more features: seo pages & footers
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Mar 7, 2017
1 parent 02e9e67 commit 9b3fc36
Show file tree
Hide file tree
Showing 43 changed files with 2,121 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=5.6.4",
"arcanedev/laravel-api-helper": "~1.0",
"arcanedev/laravel-seo": "~0.4",
"arcanedev/laravel-seo": "~0.5",
"arcanedev/spam-blocker": "~1.3",
"arcanesoft/auth": "~2.0",
"arcanesoft/core": "~2.0"
Expand Down
32 changes: 32 additions & 0 deletions config/seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,36 @@
'route' => [
'prefix' => 'seo',
],

/* -----------------------------------------------------------------
| Database
| -----------------------------------------------------------------
*/
'database' => [
'connection' => null,

'prefix' => 'seo_',
],

/* -----------------------------------------------------------------
| Locales
| -----------------------------------------------------------------
*/
'locales' => ['en', 'fr'],

/* -----------------------------------------------------------------
| Pages
| -----------------------------------------------------------------
*/
'pages' => [
'replacer' => [
'footer_name',
'footer_localization',
'app_url',
'app_name',
'mobile',
'phone',
'email',
],
],
];
20 changes: 20 additions & 0 deletions config/sidebar/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@
// Policies\DashboardPolicy::PERMISSION_STATS
],
],
[
'title' => 'Pages',
'name' => 'seo-pages',
'route' => 'admin::seo.pages.index',
'icon' => 'fa fa-fw fa-files-o',
'roles' => [Role::ADMINISTRATOR],
'permissions' => [
//
],
],
[
'title' => 'Footers',
'name' => 'seo-footers',
'route' => 'admin::seo.footers.index',
'icon' => 'fa fa-fw fa-th',
'roles' => [Role::ADMINISTRATOR],
'permissions' => [
//
],
],
[
'title' => 'Metas',
'name' => 'seo-metas',
Expand Down
Empty file removed database/migrations/.gitkeep
Empty file.
44 changes: 44 additions & 0 deletions database/migrations/2017_00_01_000001_create_seo_pages_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

use Arcanesoft\Seo\Bases\Migration;
use Illuminate\Database\Schema\Blueprint;

/**
* Class CreateSeoPagesTable
*
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class CreateSeoPagesTable extends Migration
{
/* ------------------------------------------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
*/
/**
* CreateSeoPagesTable constructor.
*/
public function __construct()
{
parent::__construct();

$this->setTable('pages');
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
*/
/**
* {@inheritdoc}
*/
public function up()
{
$this->createSchema(function(Blueprint $table) {
$table->increments('id');
$table->string('name', 255);
$table->text('content');
$table->string('locale')->default(config('app.locale'));
$table->timestamps();
});
}
}
48 changes: 48 additions & 0 deletions database/migrations/2017_00_01_000002_create_seo_footers_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

use Arcanesoft\Seo\Bases\Migration;
use Illuminate\Database\Schema\Blueprint;

/**
* Class CreateSeoFootersTable
*
* @author ARCANEDEV <arcanedev.maroc@gmail.com>
*/
class CreateSeoFootersTable extends Migration
{
/* ------------------------------------------------------------------------------------------------
| Constructor
| ------------------------------------------------------------------------------------------------
*/
/**
* CreateSeoFootersTable constructor.
*/
public function __construct()
{
parent::__construct();

$this->setTable('footers');
}

/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
*/
/**
* {@inheritdoc}
*/
public function up()
{
$this->createSchema(function(Blueprint $table) {
$table->increments('id');
$table->integer('page_id')->default(0);
$table->string('name');
$table->string('localization');
$table->string('uri');
$table->string('locale')->default(config('app.locale'));
$table->timestamps();

$table->unique(['uri', 'locale']);
});
}
}
Empty file removed resources/lang/en/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions resources/lang/en/locales.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'en' => 'English',
'fr' => 'French',
];
Empty file removed resources/lang/fr/.gitkeep
Empty file.
6 changes: 6 additions & 0 deletions resources/lang/fr/locales.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'en' => 'Anglais',
'fr' => 'Français',
];
122 changes: 122 additions & 0 deletions resources/views/admin/footers/create.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
@section('header')
<h1>SEO <small>New Footer</small></h1>
@endsection

@section('content')
{{ Form::open(['route' => 'admin::seo.footers.store', 'method' => 'POST', 'class' => 'form form-loading']) }}
<div class="box">
<div class="box-header with-border">
<h2 class="box-title">New Footer</h2>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-6">
<div class="form-group {{ $errors->first('name', 'has-error') }}">
{{ Form::label('name', 'Name :') }}
{{ Form::text('name', old('name'), ['class' => 'form-control']) }}
@if ($errors->has('name'))
<span class="text-red">{!! $errors->first('name') !!}</span>
@endif
</div>
</div>
<div class="col-md-6">
<div class="form-group {{ $errors->first('localization', 'has-error') }}">
{{ Form::label('localization', 'Localization :') }}
{{ Form::text('localization', old('localization'), ['class' => 'form-control']) }}
@if ($errors->has('localization'))
<span class="text-red">{!! $errors->first('localization') !!}</span>
@endif
</div>
</div>

<div class="clearfix visible-md visible-lg"></div>

<div class="col-md-6">
<div class="form-group {{ $errors->first('uri', 'has-error') }}">
{{ Form::label('uri', 'URI :') }}
{{ Form::text('uri', old('uri'), ['class' => 'form-control']) }}
@if ($errors->has('uri'))
<span class="text-red">{!! $errors->first('uri') !!}</span>
@endif
</div>
</div>

<div class="cleafix visible-sm"></div>

<div class="col-sm-6 col-md-3">
<div class="form-group {{ $errors->first('locale', 'has-error') }}">
{{ Form::label('locale', 'Locale :') }}
{{ Form::select('locale', $locales, old('locale', config('app.locale')), ['class' => 'select-2-fw']) }}
@if ($errors->has('locale'))
<span class="text-red">{!! $errors->first('locale') !!}</span>
@endif
</div>
</div>

<div class="col-sm-6 col-md-3">
<div class="form-group {{ $errors->first('page', 'has-error') }}">
{{ Form::label('page', 'Page :') }}
{{ Form::select('page', $pages, old('page', 0), ['class' => 'select-2-fw']) }}
@if ($errors->has('page'))
<span class="text-red">{!! $errors->first('page') !!}</span>
@endif
</div>
</div>

<div class="clearfix visible-sm visible-md visible-lg"></div>

<div class="col-md-12">
<div class="form-group {{ $errors->first('seo_title', 'has-error') }}">
{{ Form::label('seo_title', 'SEO Title :') }}
{{ Form::text('seo_title', old('seo_title'), ['class' => 'form-control']) }}
@if ($errors->has('seo_title'))
<span class="text-red">{!! $errors->first('seo_title') !!}</span>
@endif
</div>
</div>

<div class="col-md-12">
<div class="form-group {{ $errors->first('seo_description', 'has-error') }}">
{{ Form::label('seo_description', 'SEO Description :') }}
{{ Form::text('seo_description', old('seo_description'), ['class' => 'form-control']) }}
@if ($errors->has('seo_description'))
<span class="text-red">{!! $errors->first('seo_description') !!}</span>
@endif
</div>
</div>

<div class="col-md-12">
<div class="form-group {{ $errors->first('seo_keywords', 'has-error') }}">
{{ Form::label('seo_keywords[]', 'SEO Keywords :') }}
{{ Form::select('seo_keywords[]', [], old('seo_keywords[]'), ['class' => 'form-control', 'multiple']) }}
@if ($errors->has('seo_keywords'))
<span class="text-red">{!! $errors->first('seo_keywords') !!}</span>
@endif
</div>
</div>
</div>
</div>
<div class="box-footer">
<a href="{{ route('admin::seo.footers.index') }}" class="btn btn-sm btn-default">
Cancel
</a>
<button type="submit" class="btn btn-sm btn-primary pull-right">
<i class="fa fa-fw fa-plus"></i> Add
</button>
</div>
</div>
{{ Form::close() }}
@endsection

@section('modals')
@endsection

@section('scripts')
<script>
$(function () {
$('select[name="seo_keywords[]"]').select2({
tags: true
});
});
</script>
@endsection
Loading

0 comments on commit 9b3fc36

Please sign in to comment.