add validator, optimizations
This commit is contained in:
@@ -12,7 +12,7 @@ class ArticlesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'articles';
|
||||
|
||||
public $sortedColumn = 2;
|
||||
public $sortedColumn = 3;
|
||||
|
||||
public function query(Article $model)
|
||||
{
|
||||
@@ -99,15 +99,16 @@ class ArticlesDataTable extends DataTable
|
||||
return [
|
||||
Column::make('visible')->title('Visible')->searchable(false)->width(50),
|
||||
Column::make('homepage')->title('Accueil')->searchable(false)->width(50),
|
||||
Column::make('ref')->title('Ref'),
|
||||
Column::make('article_nature.name')->title('Nature'),
|
||||
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||
Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false)->width(40),
|
||||
// Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||
// Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false)->width(40),
|
||||
Column::make('categories_count')->title('#Ray')->class('text-right')->searchable(false)->width(40),
|
||||
Column::make('offers_count')->title('#Ofr')->class('text-right')->searchable(false)->width(40),
|
||||
Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false)->width(40),
|
||||
Column::make('images_count2')->title('#PhoH')->class('text-right')->searchable(false)->orderable(false)->width(40),
|
||||
// Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false)->width(40),
|
||||
// Column::make('images_count2')->title('#PhoH')->class('text-right')->searchable(false)->orderable(false)->width(40),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\ArticlesDataTable;
|
||||
use App\Http\Requests\Admin\Shop\StoreArticlePost;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Categories;
|
||||
@@ -20,9 +21,11 @@ class ArticleController extends Controller
|
||||
|
||||
public function index(ArticlesDataTable $dataTable)
|
||||
{
|
||||
$data['article_natures'] = ArticleNatures::getOptions();
|
||||
$data['categories'] = Categories::getOptions();
|
||||
$data['tags'] = Tags::getOptionsFullName();
|
||||
$data = [
|
||||
'article_natures' => ArticleNatures::getOptions(),
|
||||
'categories' => Categories::getOptions(),
|
||||
'tags' => Tags::getOptionsFullName(),
|
||||
];
|
||||
|
||||
return $dataTable->render('Admin.Shop.Articles.list', $data);
|
||||
}
|
||||
@@ -34,9 +37,12 @@ class ArticleController extends Controller
|
||||
return view('Admin.Shop.Articles.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
public function store(StoreArticlePost $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$data['visible'] = $data['visible'] ?? false;
|
||||
$data['homepage'] = $data['homepage'] ?? false;
|
||||
|
||||
Articles::storeFull($data);
|
||||
|
||||
return redirect()->route('Admin.Shop.Articles.index');
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Admin\Shop\OffersDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Admin\Shop\StoreOfferPost;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Offers;
|
||||
@@ -16,32 +17,30 @@ class OfferController extends Controller
|
||||
{
|
||||
public function index(OffersDataTable $dataTable)
|
||||
{
|
||||
$data['article_natures'] = ArticleNatures::getOptions();
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data = [
|
||||
'article_natures' => ArticleNatures::getOptions(),
|
||||
'packages' => Packages::getOptions(),
|
||||
];
|
||||
|
||||
return $dataTable->render('Admin.Shop.Offers.list', $data ?? []);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['articles'] = Articles::getOptionsWithNature();
|
||||
$data['tariffs'] = Tariffs::getOptions();
|
||||
$data['variations'] = Variations::getOptions();
|
||||
$data = Offers::init();
|
||||
|
||||
return view('Admin.Shop.Offers.create', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['offer'] = Offers::get($id)->toArray();
|
||||
$data['articles'] = Articles::getOptionsWithNature();
|
||||
$data['tariffs'] = Tariffs::getOptions();
|
||||
$data['variations'] = Variations::getOptions();
|
||||
$data = Offers::init();
|
||||
$data['offer'] = Offers::getArray($id);
|
||||
|
||||
return view('Admin.Shop.Offers.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
public function store(StoreOfferPost $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Offers::store($data);
|
||||
@@ -51,7 +50,7 @@ class OfferController extends Controller
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['offer'] = Offers::get($id)->toArray();
|
||||
$data['offer'] = Offers::getArray($id);
|
||||
|
||||
return view('Admin.Shop.Offers.view', $data);
|
||||
}
|
||||
|
||||
@@ -14,10 +14,11 @@ class StoreArticlePost extends FormRequest
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'ref' => 'required|unique:articles,ref,'.$this->ref,
|
||||
'ref' => 'required|unique:shop_articles,ref,'.$this->id,
|
||||
'product_type' => 'required',
|
||||
'product_id' => 'required',
|
||||
'article_nature_id' => 'required',
|
||||
'name' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
23
app/Http/Requests/Admin/Shop/StoreOfferPost.php
Normal file
23
app/Http/Requests/Admin/Shop/StoreOfferPost.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin\Shop;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class StoreOfferPost extends FormRequest
|
||||
{
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'article_id' => 'required',
|
||||
'variation_id' => 'required',
|
||||
'tariff_id' => 'required',
|
||||
'weight' => 'required',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Core\Comments;
|
||||
@@ -13,7 +14,7 @@ use Illuminate\Support\Str;
|
||||
|
||||
class Articles
|
||||
{
|
||||
use Imageable;
|
||||
use Basic, Imageable;
|
||||
|
||||
public static function autocomplete($str)
|
||||
{
|
||||
@@ -73,11 +74,6 @@ class Articles
|
||||
return Offers::getOffersByArticle($id);
|
||||
}
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return Article::orderBy('name', 'asc')->pluck('name', 'id')->toArray();
|
||||
}
|
||||
|
||||
public static function getOptionsWithNature()
|
||||
{
|
||||
$articles = Article::with(['article_nature'])->get();
|
||||
@@ -391,17 +387,17 @@ class Articles
|
||||
{
|
||||
switch ($product_type) {
|
||||
case 'App\Models\Botanic\Variety':
|
||||
$data['images'] = Varieties::getImages($product_id);
|
||||
$images = Varieties::getImages($product_id);
|
||||
break;
|
||||
case 'App\Models\Botanic\Specie':
|
||||
$data['images'] = Species::getImages($product_id);
|
||||
$images = Species::getImages($product_id);
|
||||
break;
|
||||
case 'App\Models\Shop\Merchandise':
|
||||
$data['images'] = Merchandises::getImages($product_id);
|
||||
$images = Merchandises::getImages($product_id);
|
||||
break;
|
||||
}
|
||||
|
||||
return $data ?? false;
|
||||
return $images ?? false ? ['images' => $images] : false;
|
||||
}
|
||||
|
||||
public static function getMeta(&$data = [])
|
||||
@@ -516,11 +512,6 @@ class Articles
|
||||
return Prices::getByArticle($article->id);
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Article::findOrFail($id);
|
||||
}
|
||||
|
||||
public static function getFullImagesByArticleId($id)
|
||||
{
|
||||
$article = self::get($id);
|
||||
@@ -611,32 +602,6 @@ class Articles
|
||||
return $article->id;
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
$data['visible'] = $data['visible'] ?? false;
|
||||
|
||||
return ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Article::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$article = self::get($id);
|
||||
$ret = $article->update($data);
|
||||
|
||||
return $article;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Article::destroy($id);
|
||||
}
|
||||
|
||||
public static function storeCategories($article, $categories)
|
||||
{
|
||||
if (! $categories) {
|
||||
@@ -677,4 +642,9 @@ class Articles
|
||||
|
||||
return $name ? hash('crc32c', Str::slug($name)) : false;
|
||||
}
|
||||
|
||||
public static function getModel()
|
||||
{
|
||||
return Article::query();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,19 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Offer;
|
||||
use App\Traits\Model\Basic;
|
||||
|
||||
class Offers
|
||||
{
|
||||
public static function count()
|
||||
use Basic;
|
||||
|
||||
public static function init()
|
||||
{
|
||||
return Offer::count();
|
||||
return [
|
||||
'articles' => Articles::getOptionsWithNature(),
|
||||
'tariffs' => Tariffs::getOptions(),
|
||||
'variations' => Variations::getOptions(),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getWeight($id, $quantity = 1)
|
||||
@@ -116,42 +123,13 @@ class Offers
|
||||
return Offer::with(['article.tags'])->byTags($tags)->get();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Offer::get();
|
||||
}
|
||||
|
||||
public static function get($id, $relations = false)
|
||||
{
|
||||
return $relations ? Offer::with($relations)->findOrFail($id) : Offer::findOrFail($id);
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
return ($data['id'] ?? false) ? self::update($data) : self::create($data);
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Offer::create($data);
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
$item = self::get($id);
|
||||
$item->update($data);
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Offer::destroy($id);
|
||||
}
|
||||
|
||||
public static function toggle_active($id, $status_id)
|
||||
{
|
||||
return self::update(['status_id' => $status_id], $id);
|
||||
}
|
||||
|
||||
public static function getModel()
|
||||
{
|
||||
return Offer::query();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.articles.title'),
|
||||
'subtitle' => __('shop.articles.add'),
|
||||
'breadcrumb' => [__('shop.articles.title'), __('shop.articles.add')]
|
||||
'breadcrumb' => [__('shop.articles.title'), __('shop.articles.add')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Admin.Shop.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
@include('Admin.Shop.Articles.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.articles.title'),
|
||||
'subtitle' => __('shop.articles.edit'),
|
||||
'breadcrumb' => [__('shop.articles.title'), __('shop.articles.edit')]
|
||||
'breadcrumb' => [__('shop.articles.title'), __('shop.articles.edit')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Admin.Shop.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
<input type="hidden" name="id" id="id" value="{{ $article['id'] ?? null }}">
|
||||
|
||||
@include('Admin.Shop.Articles.form')
|
||||
{{ Form::close() }}
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<div class="row mt-3">
|
||||
<div class="col-12">
|
||||
@include('Admin.Shop.Articles.partials.characteristics')
|
||||
</div>
|
||||
</div>
|
||||
{{ Form::open(['route' => 'Admin.Shop.Articles.store', 'id' => 'article-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
<input type="hidden" name="id" id="id" value="{{ $article['id'] ?? null }}">
|
||||
@include('Admin.Shop.Articles.partials.characteristics')
|
||||
{{ Form::close() }}
|
||||
|
||||
@include('components.save')
|
||||
<x-save />
|
||||
|
||||
@include('load.form.appender')
|
||||
@include('load.form.editor')
|
||||
@@ -17,6 +16,8 @@
|
||||
@include('load.layout.modal')
|
||||
|
||||
@push('js')
|
||||
{!! JsValidator::formRequest('App\Http\Requests\Admin\Shop\StoreArticlePost', '#article-form') !!}
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
|
||||
@@ -166,18 +166,17 @@
|
||||
var product_type = $(this).val();
|
||||
switch (product_type) {
|
||||
case 'App\\Models\\Botanic\\Specie':
|
||||
var url = '{{ route('Admin.Botanic.Species.getSelect') }}';
|
||||
var url = "{{ route('Admin.Botanic.Species.getSelect') }}";
|
||||
break;
|
||||
case 'App\\Models\\Botanic\\Variety':
|
||||
var url = '{{ route('Admin.Botanic.Varieties.getSelect') }}';
|
||||
var url = "{{ route('Admin.Botanic.Varieties.getSelect') }}";
|
||||
break;
|
||||
case 'App\\Models\\Shop\\Merchandise':
|
||||
var url = '{{ route('Admin.Shop.Merchandises.getSelect') }}';
|
||||
var url = "{{ route('Admin.Shop.Merchandises.getSelect') }}";
|
||||
break;
|
||||
}
|
||||
loadProducts(url);
|
||||
var url = '{{ route('Admin.Shop.ArticleNatures.getOptions') }}';
|
||||
loadArticleNatures(url);
|
||||
loadArticleNatures("{{ route('Admin.Shop.ArticleNatures.getOptions') }}");
|
||||
});
|
||||
|
||||
function loadArticleNatures(url) {
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.offers.title'),
|
||||
'subtitle' => __('shop.offers.add'),
|
||||
'breadcrumb' => [__('shop.offers.title'), __('shop.offers.add')]
|
||||
'breadcrumb' => [__('shop.offers.title'), __('shop.offers.add')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Admin.Shop.Offers.store', 'id' => 'offer-form', 'autocomplete' => 'off']) }}
|
||||
@include('Admin.Shop.Offers.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.offers.title'),
|
||||
'subtitle' => __('shop.offers.edit'),
|
||||
'breadcrumb' => [__('shop.offers.title'), __('shop.offers.edit')]
|
||||
'breadcrumb' => [__('shop.offers.title'), __('shop.offers.edit')],
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Admin.Shop.Offers.store', 'id' => 'offer-form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $offer['id'] }}">
|
||||
@include('Admin.Shop.Offers.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
{{ Form::open(['route' => 'Admin.Shop.Offers.store', 'id' => 'offer-form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $offer['id'] }}">
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-8">
|
||||
<div class="row mb-3">
|
||||
@@ -103,13 +106,16 @@
|
||||
|
||||
</div>
|
||||
|
||||
@include('components.save')
|
||||
{{ form::close() }}
|
||||
<x-save />
|
||||
|
||||
@include('load.layout.chevron')
|
||||
@include('load.form.save')
|
||||
@include('load.form.select2')
|
||||
|
||||
@push('js')
|
||||
{!! JsValidator::formRequest('App\Http\Requests\Admin\Shop\StoreOfferPost', '#offer-form') !!}
|
||||
|
||||
<script>
|
||||
function handleArticle() {
|
||||
$('.select_article').change(function() {
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
@foreach ($delivery_types as $delivery_type)
|
||||
|
||||
@endforeach
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ App::getLocale() }}" dir="@lang('boilerplate::layout.direction')">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
@@ -7,17 +8,21 @@
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<title>{{ $title ?? '' }} | {{ config('app.name') }}</title>
|
||||
<link rel="shortcut icon" href="{{ config('boilerplate.theme.favicon') ?? mix('favicon.svg', '/assets/vendor/boilerplate') }}">
|
||||
<link rel="shortcut icon"
|
||||
href="{{ config('boilerplate.theme.favicon') ?? mix('favicon.svg', '/assets/vendor/boilerplate') }}">
|
||||
@stack('plugin-css')
|
||||
<link rel="stylesheet" href="{{ mix('/plugins/fontawesome/fontawesome.min.css', '/assets/vendor/boilerplate') }}">
|
||||
<link rel="stylesheet" href="{{ mix('/adminlte.min.css', '/assets/vendor/boilerplate') }}">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,700;1,400&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,300;0,400;0,700;1,400&display=swap"
|
||||
rel="stylesheet">
|
||||
<link rel="stylesheet" href="/assets/fonts/glyphicons/glyphicons.min.css">
|
||||
@stack('css')
|
||||
<link rel="stylesheet" href="/assets/css/main.min.css?{{ time() }}">
|
||||
</head>
|
||||
<body class="layout-fixed layout-navbar-fixed sidebar-mini{{ setting('darkmode', false) && config('boilerplate.theme.darkmode') ? ' dark-mode accent-light' : '' }}{{ setting('sidebar-collapsed', false) ? ' sidebar-collapse' : '' }}">
|
||||
|
||||
<body
|
||||
class="layout-fixed layout-navbar-fixed sidebar-mini{{ setting('darkmode', false) && config('boilerplate.theme.darkmode') ? ' dark-mode accent-light' : '' }}{{ setting('sidebar-collapsed', false) ? ' sidebar-collapse' : '' }}">
|
||||
<div class="wrapper">
|
||||
@include('layout.header')
|
||||
@include('boilerplate::layout.mainsidebar')
|
||||
@@ -32,7 +37,8 @@
|
||||
|
||||
@includeWhen(config('boilerplate.theme.footer.visible', true), 'layout.footer')
|
||||
|
||||
<aside class="control-sidebar control-sidebar-{{ config('boilerplate.theme.sidebar.type') }} elevation-{{ config('boilerplate.theme.sidebar.shadow') }}">
|
||||
<aside
|
||||
class="control-sidebar control-sidebar-{{ config('boilerplate.theme.sidebar.type') }} elevation-{{ config('boilerplate.theme.sidebar.shadow') }}">
|
||||
<button class="btn btn-sm" data-widget="control-sidebar"><span class="fa fa-times"></span></button>
|
||||
<div class="control-sidebar-content">
|
||||
<div class="p-3">
|
||||
@@ -47,14 +53,18 @@
|
||||
<script src="{{ mix('/bootstrap.min.js', '/assets/vendor/boilerplate') }}"></script>
|
||||
<script src="{{ mix('/admin-lte.min.js', '/assets/vendor/boilerplate') }}"></script>
|
||||
<script src="{{ mix('/boilerplate.min.js', '/assets/vendor/boilerplate') }}"></script>
|
||||
|
||||
<script type="text/javascript" src="{{ asset('vendor/jsvalidation/js/jsvalidation.js') }}"></script>
|
||||
<script src="/assets/js/main.min.js?{{ time() }}"></script>
|
||||
|
||||
<script>
|
||||
// initScroll('.sidebar');
|
||||
$('.sidebar').addClass('overflow-y');
|
||||
|
||||
$.ajaxSetup({headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'}});
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': '{{ csrf_token() }}'
|
||||
}
|
||||
});
|
||||
|
||||
bootbox.setLocale('{{ App::getLocale() }}');
|
||||
|
||||
@@ -68,16 +78,15 @@
|
||||
lifetime: {{ config('session.lifetime') * 60 }},
|
||||
id: "{{ session()->getId() }}"
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@if(Session::has('growl'))
|
||||
@if (Session::has('growl'))
|
||||
<script>
|
||||
$(function() {
|
||||
@if(is_array(Session::get('growl')))
|
||||
@if (is_array(Session::get('growl')))
|
||||
growl("{!! Session::get('growl')[0] !!}", "{{ Session::get('growl')[1] }}");
|
||||
@else
|
||||
growl("{{Session::get('growl')}}");
|
||||
growl("{{ Session::get('growl') }}");
|
||||
@endif
|
||||
});
|
||||
</script>
|
||||
@@ -87,4 +96,5 @@
|
||||
@stack('js')
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user