[WIP] Add modules to shop
This commit is contained in:
@@ -21,11 +21,15 @@ class Shop
|
|||||||
->activeIfRoute(['Shop.Admin.Articles.*'])->order(2);
|
->activeIfRoute(['Shop.Admin.Articles.*'])->order(2);
|
||||||
$menu->addTo('shop', 'Familles d\'articles', [ 'route' => 'Shop.Admin.ArticleFamilies.index', 'permission' => 'backend_access' ])
|
$menu->addTo('shop', 'Familles d\'articles', [ 'route' => 'Shop.Admin.ArticleFamilies.index', 'permission' => 'backend_access' ])
|
||||||
->activeIfRoute(['Shop.Admin.ArticleFamilies.*'])->order(3);
|
->activeIfRoute(['Shop.Admin.ArticleFamilies.*'])->order(3);
|
||||||
|
$menu->addTo('shop', 'Familles d\'attributs d\'articles', [ 'route' => 'Shop.Admin.ArticleAttributeFamilies.index', 'permission' => 'backend_access' ])
|
||||||
|
->activeIfRoute(['Shop.Admin.ArticleAttributeFamilies.*'])->order(4);
|
||||||
|
$menu->addTo('shop', 'Attributs d\'articles', [ 'route' => 'Shop.Admin.ArticleAttributes.index', 'permission' => 'backend_access' ])
|
||||||
|
->activeIfRoute(['Shop.Admin.ArticleAttributes.*'])->order(5);
|
||||||
|
|
||||||
$menu->addTo('shop', 'Commandes', [ 'route' => 'Shop.Admin.Orders.index', 'permission' => 'backend_access' ])
|
$menu->addTo('shop', 'Commandes', [ 'route' => 'Shop.Admin.Orders.index', 'permission' => 'backend_access' ])
|
||||||
->activeIfRoute(['Shop.Admin.Orders.*'])->order(4);
|
->activeIfRoute(['Shop.Admin.Orders.*'])->order(6);
|
||||||
$menu->addTo('shop', 'Factures', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ])
|
$menu->addTo('shop', 'Factures', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend_access' ])
|
||||||
->activeIfRoute(['Shop.Admin.Invoices.*'])->order(5);
|
->activeIfRoute(['Shop.Admin.Invoices.*'])->order(7);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
app/Models/Shop/TagGroup.php
Normal file
11
app/Models/Shop/TagGroup.php
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class TagGroup extends Model
|
||||||
|
{
|
||||||
|
protected $guarded = ['id'];
|
||||||
|
|
||||||
|
}
|
||||||
54
app/Repositories/Shop/TagGroups.php
Normal file
54
app/Repositories/Shop/TagGroups.php
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repositories\Shop;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
use Yajra\DataTables\DataTables;
|
||||||
|
|
||||||
|
use App\Models\Shop\TagGroup;
|
||||||
|
|
||||||
|
class TagGroups
|
||||||
|
{
|
||||||
|
|
||||||
|
public static function getDatatable()
|
||||||
|
{
|
||||||
|
$model = TagGroup::orderBy('name');
|
||||||
|
return Datatables::of($model)->make(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getAll()
|
||||||
|
{
|
||||||
|
return TagGroup::orderBy('name','asc')->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function get($id)
|
||||||
|
{
|
||||||
|
return TagGroup::find($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function store($data)
|
||||||
|
{
|
||||||
|
$id = isset($data['id']) ? $data['id'] : false;
|
||||||
|
$item = $id ? self::update($data) : self::create($data);
|
||||||
|
return $item->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function create($data)
|
||||||
|
{
|
||||||
|
return TagGroup::create($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function update($data)
|
||||||
|
{
|
||||||
|
return TagGroup::find($id)->update($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function destroy($id)
|
||||||
|
{
|
||||||
|
return TagGroup::destroy($id);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('article_families.title'),
|
'title' => __('article_attributes.title'),
|
||||||
'subtitle' => __('article_families.create.title'),
|
'subtitle' => __('article_attributes.create.title'),
|
||||||
'breadcrumb' => [__('article_families.title'), __('article_families.create.title')]
|
'breadcrumb' => [__('article_attributes.title'), __('article_attributes.create.title')]
|
||||||
])
|
])
|
||||||
|
|
||||||
@include('boilerplate::load.fileinput')
|
@include('boilerplate::load.fileinput')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
{{ Form::open(['route' => 'Shop.Admin.ArticleFamilies.store', 'id' => 'article-family-form', 'autocomplete' => 'off', 'files' => true]) }}
|
{{ Form::open(['route' => 'Shop.Admin.ArticleAttributes.store', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 mbl">
|
<div class="col-sm-12 mbl">
|
||||||
<a href="{{ route("Shop.Admin.Articles.index") }}" class="btn btn-default">
|
<a href="{{ route("Shop.Admin.ArticleAttributes.index") }}" class="btn btn-default">
|
||||||
{{ __('article_families.list.title') }}
|
{{ __('article_attributes.list.title') }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<span class="btn-group pull-right">
|
<span class="btn-group pull-right">
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@include('Shop.Admin.ArticleFamilies.form')
|
@include('Shop.Admin.ArticleAttributes.form')
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => 'Famille d\'articles',
|
'title' => 'Attributs d\'articles',
|
||||||
'subtitle' => 'Edition d\'une famille d\'article',
|
'subtitle' => 'Edition d\'un attribut d\'article',
|
||||||
'breadcrumb' => ['Articles']
|
'breadcrumb' => ['Articles']
|
||||||
])
|
])
|
||||||
|
|
||||||
@@ -8,12 +8,12 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
{{ Form::open(['route' => 'Shop.Admin.ArticleFamilies.update', 'id' => 'article-family-form', 'autocomplete' => 'off', 'files' => true]) }}
|
{{ Form::open(['route' => 'Shop.Admin.ArticleAttributes.update', 'id' => 'article-attribute-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 mbl">
|
<div class="col-sm-12 mbl">
|
||||||
<a href="{{ route("Shop.Admin.ArticleFamilies.index") }}" class="btn btn-default">
|
<a href="{{ route("Shop.Admin.ArticleAttributes.index") }}" class="btn btn-default">
|
||||||
{{ __('article_families.list.title') }}
|
{{ __('article_attributes.list.title') }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<span class="btn-group pull-right">
|
<span class="btn-group pull-right">
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" name="id" value="{{ $id }}">
|
<input type="hidden" name="id" value="{{ $id }}">
|
||||||
@include('Shop.Admin.ArticleFamilies.form')
|
@include('Shop.Admin.ArticleAttributes.form')
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
4
routes/Shop/Admin/ArticleAttributeFamilies.php
Normal file
4
routes/Shop/Admin/ArticleAttributeFamilies.php
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
Route::resource('ArticleAttributeFamilies', 'ArticleAttributeFamilyController');
|
||||||
|
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
Route::middleware('auth')->prefix('Admin')->namespace('Admin')->name('Admin.')->group(function () {
|
Route::middleware('auth')->prefix('Admin')->namespace('Admin')->name('Admin.')->group(function () {
|
||||||
Route::get('dashboard', 'DashboardController@index')->name('dashboard');
|
Route::get('dashboard', 'DashboardController@index')->name('dashboard');
|
||||||
|
include( __DIR__ . '/ArticleAttributeFamilies.php');
|
||||||
include( __DIR__ . '/ArticleAttributes.php');
|
include( __DIR__ . '/ArticleAttributes.php');
|
||||||
include( __DIR__ . '/ArticleFamilies.php');
|
include( __DIR__ . '/ArticleFamilies.php');
|
||||||
include( __DIR__ . '/ArticlePrices.php');
|
include( __DIR__ . '/ArticlePrices.php');
|
||||||
|
|||||||
Reference in New Issue
Block a user