Maintenance Field Added

This commit is contained in:
devansh bawari 2020-11-20 12:17:21 +05:30
parent 0ce2e7a2aa
commit d68e765243
6 changed files with 72 additions and 1 deletions

View File

@ -805,7 +805,7 @@ return [
'seo-title' => 'Meta title',
'seo-description' => 'Meta description',
'seo-keywords' => 'Meta keywords',
'maintenance-mode' => 'Maintenance Mode'
],
'sliders' => [

View File

@ -30,6 +30,7 @@
{!! view_render_event('bagisto.admin.settings.channel.create.before') !!}
{{-- general --}}
<accordian :title="'{{ __('admin::app.settings.channels.general') }}'" :active="true">
<div slot="body">
@ -84,6 +85,7 @@
</div>
</accordian>
{{-- currencies and locales --}}
<accordian :title="'{{ __('admin::app.settings.channels.currencies-and-locales') }}'" :active="true">
<div slot="body">
@ -138,6 +140,7 @@
</div>
</accordian>
{{-- design --}}
<accordian :title="'{{ __('admin::app.settings.channels.design') }}'" :active="true">
<div slot="body">
<div class="control-group">
@ -176,6 +179,7 @@
</div>
</accordian>
{{-- home page seo --}}
<accordian :title="'{{ __('admin::app.settings.channels.seo') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('seo_title') ? 'has-error' : '']">
@ -202,6 +206,20 @@
</div>
</accordian>
{{-- maintenance mode --}}
<accordian title="{{ __('admin::app.settings.channels.maintenance-mode') }}" :active="true">
<div slot="body">
<div class="control-group">
<label for="maintenance-mode-status">{{ __('admin::app.status') }}</label>
<label class="switch">
<input type="hidden" name="is_maintenance_on" value="0" />
<input type="checkbox" id="maintenance-mode-status" name="is_maintenance_on" value="1">
<span class="slider round"></span>
</label>
</div>
</div>
</accordian>
{!! view_render_event('bagisto.admin.settings.channel.create.after') !!}
</div>
</div>

View File

@ -31,6 +31,7 @@
{!! view_render_event('bagisto.admin.settings.channel.edit.before') !!}
{{-- general --}}
<accordian :title="'{{ __('admin::app.settings.channels.general') }}'" :active="true">
<div slot="body">
@ -88,6 +89,7 @@
</div>
</accordian>
{{-- currencies and locales --}}
<accordian :title="'{{ __('admin::app.settings.channels.currencies-and-locales') }}'" :active="true">
<div slot="body">
@ -146,6 +148,7 @@
</div>
</accordian>
{{-- design --}}
<accordian :title="'{{ __('admin::app.settings.channels.design') }}'" :active="true">
<div slot="body">
<div class="control-group">
@ -191,6 +194,7 @@
$seo = json_decode($channel->home_seo);
@endphp
{{-- home page seo --}}
<accordian :title="'{{ __('admin::app.settings.channels.seo') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('seo_title') ? 'has-error' : '']">
@ -217,6 +221,20 @@
</div>
</accordian>
{{-- maintenance mode --}}
<accordian title="{{ __('admin::app.settings.channels.maintenance-mode') }}" :active="true">
<div slot="body">
<div class="control-group">
<label for="maintenance-mode-status">{{ __('admin::app.status') }}</label>
<label class="switch">
<input type="hidden" name="is_maintenance_on" value="0" />
<input type="checkbox" id="maintenance-mode-status" name="is_maintenance_on" value="1" {{ $channel->is_maintenance_on ? 'checked' : '' }}>
<span class="slider round"></span>
</label>
</div>
</div>
</accordian>
{!! view_render_event('bagisto.admin.settings.channel.edit.after') !!}
</div>
</div>

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddColumnsInChannelsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('channels', function (Blueprint $table) {
$table->boolean('is_maintenance_on')->after('footer_content')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('channels', function (Blueprint $table) {
//
});
}
}

View File

@ -75,6 +75,7 @@ class ChannelController extends Controller
'seo_description' => 'required|string',
'seo_keywords' => 'required|string',
'hostname' => 'unique:channels,hostname',
'is_maintenance_on' => 'boolean'
]);
$data = request()->all();
@ -135,6 +136,7 @@ class ChannelController extends Controller
'logo.*' => 'mimes:bmp,jpeg,jpg,png,webp',
'favicon.*' => 'mimes:bmp,jpeg,jpg,png,webp',
'hostname' => 'unique:channels,hostname,' . $id,
'is_maintenance_on' => 'boolean'
]);
$data = request()->all();

View File

@ -22,6 +22,7 @@ class Channel extends Model implements ChannelContract
'base_currency_id',
'root_category_id',
'home_seo',
'is_maintenance_on'
];
/**