[WIP] Refactor architecture, models
This commit is contained in:
@@ -41,6 +41,7 @@ class migrate extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
/*
|
||||
$varieties = Variety::all();
|
||||
foreach ($varieties as $variety) {
|
||||
$specie_name = $variety->specie;
|
||||
@@ -59,7 +60,7 @@ class migrate extends Command
|
||||
dump("Aucune espèce");
|
||||
}
|
||||
}
|
||||
/*
|
||||
*/
|
||||
$species = Specie::all();
|
||||
foreach ($species as $specie) {
|
||||
$genre_name = $specie->genre;
|
||||
@@ -78,8 +79,8 @@ class migrate extends Command
|
||||
dump("Aucun genre");
|
||||
}
|
||||
}
|
||||
*/
|
||||
/*
|
||||
|
||||
/*
|
||||
$genres = Genre::all();
|
||||
foreach ($genres as $genre) {
|
||||
$family_name = $genre->family;
|
||||
|
||||
@@ -23,7 +23,7 @@ class GenresDataTable extends DataTable
|
||||
Column::make('alias'),
|
||||
Column::make('latin'),
|
||||
Column::make('family.name'),
|
||||
Column::make('species_count')->title('Nb Espèces'),
|
||||
Column::make('species_count')->title('Nb Espèces')->searchable(false),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
|
||||
@@ -21,9 +21,9 @@ class SpeciesDataTable extends DataTable
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('alias'),
|
||||
Column::make('genre_name'),
|
||||
Column::make('genre.name'),
|
||||
Column::make('latin'),
|
||||
Column::make('varieties_count')->title('Nb variétés'),
|
||||
Column::make('varieties_count')->title('Nb variétés')->searchable(false),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
|
||||
@@ -19,8 +19,8 @@ class VarietiesDataTable extends DataTable
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('specie_name'),
|
||||
Column::make('name'),
|
||||
Column::make('specie_name')->title('Espèce'),
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
namespace App\DataTables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\DataTables\ParentDataTable as DataTable;
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
namespace App\DataTables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\DataTables\ParentDataTable as DataTable;
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
namespace App\DataTables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\DataTables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Product;
|
||||
use App\Models\Shop\Customer;
|
||||
|
||||
class ProductsDataTable extends DataTable
|
||||
class CustomersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'Products';
|
||||
public $model_name = 'Customers';
|
||||
|
||||
public function query(Product $model)
|
||||
{
|
||||
@@ -19,8 +19,6 @@ class ProductsDataTable extends DataTable
|
||||
{
|
||||
return [
|
||||
Column::make('name'),
|
||||
Column::make('alias'),
|
||||
Column::make('latin'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
namespace App\DataTables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\DataTables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Product;
|
||||
use App\Models\Shop\Invoice;
|
||||
|
||||
class ProductsDataTable extends DataTable
|
||||
class InvoicesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'Products';
|
||||
public $model_name = 'Invoices';
|
||||
|
||||
public function query(Product $model)
|
||||
{
|
||||
@@ -19,8 +19,6 @@ class ProductsDataTable extends DataTable
|
||||
{
|
||||
return [
|
||||
Column::make('name'),
|
||||
Column::make('alias'),
|
||||
Column::make('latin'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
namespace App\DataTables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\DataTables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Product;
|
||||
use App\Models\Shop\Order;
|
||||
|
||||
class ProductsDataTable extends DataTable
|
||||
class OrdersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'Products';
|
||||
public $model_name = 'Orders';
|
||||
|
||||
public function query(Product $model)
|
||||
{
|
||||
@@ -19,8 +19,6 @@ class ProductsDataTable extends DataTable
|
||||
{
|
||||
return [
|
||||
Column::make('name'),
|
||||
Column::make('alias'),
|
||||
Column::make('latin'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
@@ -6,7 +6,7 @@ use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Categories;
|
||||
use App\DataTables\CategoriesDataTable;
|
||||
use App\DataTables\Shop\CategoriesDataTable;
|
||||
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
@@ -40,7 +40,7 @@ class CategoryController extends Controller
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Categories::store($request);
|
||||
$ret = Categories::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Categories.index');
|
||||
}
|
||||
|
||||
|
||||
@@ -5,23 +5,15 @@ namespace App\Http\Controllers\Shop;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Categorys;
|
||||
use App\Repositories\Shop\Categories;
|
||||
use App\DataTables\Shop\CategoriesDataTable;
|
||||
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
|
||||
public function index(CategoriesDataTable $dataTable)
|
||||
{
|
||||
if ($request->ajax()) {
|
||||
return self::getDatatable($request);
|
||||
} else {
|
||||
$data = [];
|
||||
return view('Shop.Categories.list', $data);
|
||||
}
|
||||
return $dataTable->render('Shop.Categories.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
@@ -29,16 +21,10 @@ class CategoryController extends Controller
|
||||
return Categories::getDatatable($request->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data = Categories::get($id);
|
||||
return view('Shop.Admin.Categories.view', $data);
|
||||
return view('Shop.Categories.view', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class Specie extends Model
|
||||
|
||||
public function Genre()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Botanic\Family');
|
||||
return $this->belongsTo('App\Models\Botanic\Genre');
|
||||
}
|
||||
|
||||
public function Varieties()
|
||||
|
||||
@@ -5,12 +5,20 @@ namespace App\Models\Shop;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use Rinvex\Categories\Traits\Categorizable;
|
||||
use Conner\Tagging\Taggable;
|
||||
|
||||
class Product extends Model
|
||||
class Article extends Model
|
||||
{
|
||||
use Categorizable;
|
||||
use Taggable;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_products';
|
||||
protected $table = 'shop_articles';
|
||||
|
||||
public function Family()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Family');
|
||||
}
|
||||
|
||||
public function Inventories()
|
||||
{
|
||||
@@ -19,17 +27,17 @@ class Product extends Model
|
||||
|
||||
public function Prices()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\ProductPrice');
|
||||
return $this->hasMany('App\Models\Shop\ArticlePrice');
|
||||
}
|
||||
|
||||
public function ProductAttributes()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\ProductAttribute');
|
||||
return $this->hasMany('App\Models\Shop\ArticleAttribute');
|
||||
}
|
||||
|
||||
public function Categories()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\CategoryProduct');
|
||||
return $this->hasMany('App\Models\Shop\ArticleCategory');
|
||||
}
|
||||
|
||||
public function InvoiceItems()
|
||||
@@ -4,15 +4,15 @@ namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProductAttribute extends Model
|
||||
class ArticleAttribute extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function Product()
|
||||
public function Article()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Product');
|
||||
return $this->belongsTo('App\Models\Shop\Article');
|
||||
}
|
||||
}
|
||||
31
app/Models/Shop/ArticleCategory.php
Normal file
31
app/Models/Shop/ArticleCategory.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArticleCategory extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_article_categories';
|
||||
|
||||
public function Article()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Article');
|
||||
}
|
||||
|
||||
public function Category()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Category');
|
||||
}
|
||||
|
||||
public function scopeByArticle($query, $id)
|
||||
{
|
||||
return $query->where('article_id', $id);
|
||||
}
|
||||
|
||||
public function scopeByCategory($query, $id)
|
||||
{
|
||||
return $query->where('category_id', $id);
|
||||
}
|
||||
}
|
||||
19
app/Models/Shop/ArticleFamily.php
Normal file
19
app/Models/Shop/ArticleFamily.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArticleFamily extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_article_families';
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function Articles()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\Article');
|
||||
}
|
||||
}
|
||||
26
app/Models/Shop/ArticlePrice.php
Normal file
26
app/Models/Shop/ArticlePrice.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ArticlePrice extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function Article()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Article');
|
||||
}
|
||||
|
||||
public function ArticleAttribute()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\ArticleAttribute');
|
||||
}
|
||||
|
||||
public function scopeByArticle($query, $id)
|
||||
{
|
||||
return $query->where('article_id', $id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,11 +5,12 @@ namespace App\Models\Shop;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
use Rinvex\Categories\Traits\Categorizable;
|
||||
use Conner\Tagging\Taggable;
|
||||
|
||||
class Section extends Model
|
||||
class Category extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_sections';
|
||||
protected $table = 'shop_categories';
|
||||
|
||||
public function Category()
|
||||
{
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProductPrice extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
public function Product()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Product');
|
||||
}
|
||||
|
||||
public function ProductAttribute()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\ProductAttribute');
|
||||
}
|
||||
|
||||
public function scopeByProduct($query, $id)
|
||||
{
|
||||
return $query->where('product_id', $id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProductSection extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_product_sections';
|
||||
|
||||
public function Product()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Product');
|
||||
}
|
||||
|
||||
public function Section()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Product');
|
||||
}
|
||||
|
||||
public function scopeByProduct($query, $id)
|
||||
{
|
||||
return $query->where('product_id', $id);
|
||||
}
|
||||
|
||||
public function scopeBySection($query, $id)
|
||||
{
|
||||
return $query->where('section_id', $id);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ class Genres
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return Family::get()->SortBy('name')->pluck('name','id')->toArray();
|
||||
return Genre::get()->SortBy('name')->pluck('name','id')->toArray();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
|
||||
@@ -19,6 +19,11 @@ class Species
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public static function getOptions()
|
||||
{
|
||||
return Specie::get()->SortBy('name')->pluck('name','id')->toArray();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Specie::orderBy('name','asc')->get();
|
||||
|
||||
54
app/Repositories/Botanic/Varieties.php
Normal file
54
app/Repositories/Botanic/Varieties.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Botanic;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use Yajra\DataTables\DataTables;
|
||||
|
||||
use App\Models\Botanic\Variety;
|
||||
|
||||
class Varieties
|
||||
{
|
||||
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = Variety::orderBy('name');
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Variety::orderBy('name','asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Variety::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 Variety::create($data);
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
{
|
||||
return Variety::find($id)->update($data);
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Variety::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,55 +2,63 @@
|
||||
|
||||
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\Categorie;
|
||||
use App\Models\Shop\Category;
|
||||
|
||||
class Categories
|
||||
{
|
||||
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = Categorie::orderBy('name');
|
||||
$model = Category::orderBy('name');
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Categorie::orderBy('name','asc')->get();
|
||||
return Category::orderBy('name','asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Categorie::find($id);
|
||||
return Category::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;
|
||||
return $id ? self::update($data, $id) : self::create($data);
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
app('rinvex.categories.category')->create(['name' => $data['name']]);
|
||||
return Categorie::create($data);
|
||||
$node = CategoryTrees::create($data);
|
||||
$data['category_id'] = $node->id;
|
||||
dump($data);
|
||||
$category = Category::create($data);
|
||||
exit;
|
||||
return $category;
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
app('rinvex.categories.category')->update(['name' => $data['name']]);
|
||||
return Categorie::find($id)->update($data);
|
||||
$id = $id ? $id : $data['id'];
|
||||
$category = Category::find($id)->update($data);
|
||||
CategoryTrees::update($data, $category->category_id);
|
||||
return $category;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Categorie::destroy($id);
|
||||
// $category = self::get($id);
|
||||
// self::deleteNode($category->category_id);
|
||||
return Category::destroy($id);
|
||||
}
|
||||
|
||||
public static function getRoot()
|
||||
{
|
||||
return app('rinvex.categorys.category')->find(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
39
app/Repositories/Shop/CategoryTrees.php
Normal file
39
app/Repositories/Shop/CategoryTrees.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Category;
|
||||
|
||||
class CategoryTrees
|
||||
{
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
$parent = (isset($data['category_id']) && $data['category_id']) ? self::getNode($data['category_id']) : self::getRoot();
|
||||
$category = app('rinvex.categories.category')->create(['name' => $data['name']]);
|
||||
$category->appendToNode($parent)->save();
|
||||
return $category;
|
||||
}
|
||||
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['category_id'];
|
||||
return self::getNode($id)->update(['name' => $data['name']]);
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
// return Category::destroy($id);
|
||||
}
|
||||
|
||||
public static function getRoot()
|
||||
{
|
||||
return self::getNode(1);
|
||||
}
|
||||
|
||||
public static function getNode($id)
|
||||
{
|
||||
return app('rinvex.categories.category')->find($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -136,5 +136,13 @@
|
||||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi"
|
||||
]
|
||||
}
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ludovic CANDELLIER",
|
||||
"email": "ludo@huma.net",
|
||||
"homepage": "https://huma.net",
|
||||
"role": "Developper"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
|
||||
class CreateShopCategoryTagsTable extends Migration {
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('shop_category_tags', function(Blueprint $table)
|
||||
{
|
||||
$table->increments('id');
|
||||
$table->integer('category_id')->unsigned()->nullable();
|
||||
$table->string('name', 50)->nullable();
|
||||
$table->text('description', 65535)->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('shop_category_tags');
|
||||
}
|
||||
|
||||
}
|
||||
58
resources/lang/fr/botanic.php
Normal file
58
resources/lang/fr/botanic.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => 'Résidences',
|
||||
'name' => 'Référence',
|
||||
'parameters' => 'Paramètres',
|
||||
'label' => 'Libellé',
|
||||
'description' => 'Description',
|
||||
'savebutton' => 'Enregistrer',
|
||||
'families' => [
|
||||
'title' => 'Familles',
|
||||
'description' => 'Gérer les familles',
|
||||
'list' => 'Liste des familles',
|
||||
'add' => 'Ajouter une famille',
|
||||
'edit' => 'Editer une famille',
|
||||
'del' => 'Effacer une famille',
|
||||
'successadd' => 'La famille a été correctement ajoutée',
|
||||
'successmod' => 'La famille a été correctement modifiée',
|
||||
'successdel' => 'La famille a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression de la famille ?',
|
||||
],
|
||||
'species' => [
|
||||
'title' => 'Espèces',
|
||||
'description' => 'Gérer les espèce',
|
||||
'list' => 'Liste des espèces',
|
||||
'add' => 'Ajouter une espèce',
|
||||
'edit' => 'Editer une espèce',
|
||||
'del' => 'Effacer une espèce',
|
||||
'successadd' => 'L\'espèce a été correctement ajoutée',
|
||||
'successmod' => 'L\'espèce a été correctement modifiée',
|
||||
'successdel' => 'L\'espèce a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression de l\'espèce ?',
|
||||
],
|
||||
'genres' => [
|
||||
'title' => 'Genres',
|
||||
'description' => 'Gérer les genres',
|
||||
'list' => 'Liste des genres',
|
||||
'add' => 'Ajouter un genre',
|
||||
'edit' => 'Editer un genre',
|
||||
'del' => 'Effacer un genre',
|
||||
'successadd' => 'Le genre a été correctement ajoutée',
|
||||
'successmod' => 'Le genre a été correctement modifiée',
|
||||
'successdel' => 'Le genre a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression du genre ?',
|
||||
],
|
||||
'varieties' => [
|
||||
'title' => 'Variétés',
|
||||
'description' => 'Gérer les Variétés',
|
||||
'list' => 'Liste des Variétés',
|
||||
'add' => 'Ajouter une Variété',
|
||||
'edit' => 'Editer une Variété',
|
||||
'del' => 'Effacer une Variété',
|
||||
'successadd' => 'La Variété a été correctement ajoutée',
|
||||
'successmod' => 'La Variété a été correctement modifiée',
|
||||
'successdel' => 'La Variété a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression de la Variété ?',
|
||||
],
|
||||
];
|
||||
@@ -7,8 +7,8 @@ return [
|
||||
'label' => 'Libellé',
|
||||
'description' => 'Description',
|
||||
'savebutton' => 'Enregistrer',
|
||||
'sections' => [
|
||||
'title' => 'Gestion des catégories',
|
||||
'categories' => [
|
||||
'title' => 'Catégories',
|
||||
'description' => 'Gérer les catégories',
|
||||
'add' => 'Ajouter une catégorie',
|
||||
'edit' => 'Editer une catégorie',
|
||||
@@ -19,48 +19,14 @@ return [
|
||||
'successdel' => 'La catégorie a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression de la catégorie ?',
|
||||
],
|
||||
'families' => [
|
||||
'title' => 'Familles',
|
||||
'description' => 'Gérer les familles',
|
||||
'list' => 'Liste des familles',
|
||||
'add' => 'Ajouter une famille',
|
||||
'edit' => 'Editer une famille',
|
||||
'del' => 'Effacer une famille',
|
||||
'successadd' => 'La famille a été correctement ajoutée',
|
||||
'successmod' => 'La famille a été correctement modifiée',
|
||||
'successdel' => 'La famille a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression de la famille ?',
|
||||
],
|
||||
'species' => [
|
||||
'title' => 'Espèces',
|
||||
'description' => 'Gérer les espèce',
|
||||
'list' => 'Liste des espèces',
|
||||
'add' => 'Ajouter une espèce',
|
||||
'edit' => 'Editer une espèce',
|
||||
'del' => 'Effacer une espèce',
|
||||
'successadd' => 'L\'espèce a été correctement ajoutée',
|
||||
'successmod' => 'L\'espèce a été correctement modifiée',
|
||||
'successdel' => 'L\'espèce a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression de l\'espèce ?',
|
||||
],
|
||||
'genres' => [
|
||||
'title' => 'Genres',
|
||||
'description' => 'Gérer les genres',
|
||||
'list' => 'Liste des genres',
|
||||
'add' => 'Ajouter un genre',
|
||||
'edit' => 'Editer un genre',
|
||||
'del' => 'Effacer un genre',
|
||||
'successadd' => 'Le genre a été correctement ajoutée',
|
||||
'successmod' => 'Le genre a été correctement modifiée',
|
||||
'successdel' => 'Le genre a été correctement effacée',
|
||||
'confirmdelete' => 'Confirmez-vous la suppression du genre ?',
|
||||
],
|
||||
'products' => [
|
||||
'title' => 'Gestion des produits',
|
||||
'description' => 'Gérer les produits',
|
||||
'articles' => [
|
||||
'title' => 'Articles',
|
||||
'list' => 'Liste des articles',
|
||||
'description' => 'Gérer les articles',
|
||||
],
|
||||
'customers' => [
|
||||
'title' => "Gestion des clients",
|
||||
'title' => "Clients",
|
||||
'list' => 'Liste des clients',
|
||||
'description' => 'Gérer les clients',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -4,12 +4,9 @@
|
||||
'breadcrumb' => [__('Botanic.species.title'), __('Botanic.species.add')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Botanic.Admin.Species.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
@include('Botanic.Admin.Species.form')
|
||||
</form>
|
||||
|
||||
|
||||
@@ -1,16 +1,27 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('Botanic.species.title'),
|
||||
'subtitle' => __('Botanic.species.edit'),
|
||||
'breadcrumb' => ['Botanic.species.title']
|
||||
'breadcrumb' => [__('Botanic.species.title'), __('Botanic.species.list')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
@include('boilerplate::load.select2')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Botanic.Admin.Species.store', 'id' => 'form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $specie['id'] }}">
|
||||
{{ Form::open(['route' => 'Botanic.Admin.Species.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
|
||||
@include('Botanic.Admin.Species.form')
|
||||
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
$(".select2").select2();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -1,20 +1,40 @@
|
||||
@include('boilerplate::load.fileinput')
|
||||
@include('boilerplate::load.select2')
|
||||
@include('boilerplate::load.tinymce')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ Form::label('latin', 'Nom latin') }}
|
||||
@include('components.input', ['name' => 'latin', 'value' => isset($latin) ? $latin : null, 'required' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::label('alias', 'Alias') }}
|
||||
@include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null, 'required' => true])
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{ Form::label('genre', 'Genre') }}
|
||||
@include('components.select', ['name' => 'genre_id', 'list' => $genres, 'value' => isset($genre_id) ? $genre_id : null, 'class' => 'select2 form-control', 'required' => false])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ Form::label('alias', 'Alias') }}
|
||||
@include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null, 'required' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::label('latin', 'Nom latin') }}
|
||||
@include('components.input', ['name' => 'latin', 'value' => isset($latin) ? $latin : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false])
|
||||
|
||||
{{ Form::label('genre', 'Genre') }}
|
||||
@include('components.select', ['name' => 'genre_id', 'list' => $genres, 'value' => isset($genre_id) ? $genre_id : null, 'required' => false])
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ Form::label('photo', 'Photos') }}
|
||||
@include('components.file', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,3 +46,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
$(".select2").select2();
|
||||
$('.editor').tinymce({});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -7,7 +7,7 @@
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Botanic.Admin.Varieties.store', 'id' => 'form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $specie['id'] }}">
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
|
||||
@include('Botanic.Admin.Varieties.form')
|
||||
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
|
||||
{{ Form::label('alias', 'Alias') }}
|
||||
@include('components.input', ['name' => 'alias', 'value' => isset($alias) ? $alias : null, 'required' => true])
|
||||
|
||||
{{ Form::label('latin', 'Nom latin') }}
|
||||
@include('components.input', ['name' => 'latin', 'value' => isset($latin) ? $latin : null, 'required' => true])
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ Form::label('genre', 'Espèce') }}
|
||||
@include('components.select', ['name' => 'specie_id', 'list' => $species, 'value' => isset($specie_id) ? $specie_id : null, 'required' => false])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => false])
|
||||
|
||||
{{ Form::label('genre', 'Genre') }}
|
||||
@include('components.select', ['name' => 'genre_id', 'list' => $genres, 'value' => isset($genre_id) ? $genre_id : null, 'required' => false])
|
||||
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'rows' => 5, 'required' => false])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('Shop.sections.title'),
|
||||
'subtitle' => __('Shop.sections.add'),
|
||||
'breadcrumb' => [__('Shop.sections.title'), __('Shop.sections.add')]
|
||||
'title' => __('Shop.categories.title'),
|
||||
'subtitle' => __('Shop.categories.add'),
|
||||
'breadcrumb' => [__('Shop.categories.title'), __('Shop.categories.list')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Sections.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
@include('Shop.Admin.Sections.form')
|
||||
{{ Form::open(['route' => 'Shop.Admin.Categories.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
@include('Shop.Admin.Categories.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('Shop.species.title'),
|
||||
'subtitle' => __('Shop.species.edit'),
|
||||
'breadcrumb' => ['Familles']
|
||||
'title' => __('Shop.categories.title'),
|
||||
'subtitle' => __('Shop.categories.edit'),
|
||||
'breadcrumb' => [__('Shop.categories.title'), __('Shop.categories.list')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Species.store', 'id' => 'form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $specie['id'] }}">
|
||||
|
||||
@include('Shop.Admin.Species.form')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Categories.store', 'id' => 'form', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
@include('Shop.Admin.Categories.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -1,8 +1,35 @@
|
||||
@include('boilerplate::load.fileinput')
|
||||
@include('boilerplate::load.select2')
|
||||
@include('boilerplate::load.tinymce')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => isset($name) ? $name : null, 'required' => true])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ Form::label('category_id', 'Catégorie parente') }}
|
||||
@include('components.select', ['name' => 'category_id', 'value' => isset($category_id) ? $category_id : null, 'class' => 'select2 form-control', 'required' => true])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
{{ Form::label('tags', 'Tags') }}
|
||||
@include('components.select', ['name' => 'tags', 'value' => isset($tags) ? $tags : null, 'class' => 'select2 form-control', 'multiple' => true])
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.textarea', ['name' => 'description', 'value' => isset($description) ? $description : null, 'class' => 'editor', 'required' => true])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{{ Form::label('photo', 'Photos') }}
|
||||
@include('components.file', ['name' => 'photo', 'value' => isset($photo) ? $photo : null, 'required' => true])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,3 +41,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
$(".select2").select2();
|
||||
$('.editor').tinymce({});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -1,14 +1,14 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('Shop.Categories.title'),
|
||||
'subtitle' => __('Shop.Categories.list'),
|
||||
'breadcrumb' => [__('Shop.Categories.title')]
|
||||
'title' => __('Shop.categories.title'),
|
||||
'subtitle' => __('Shop.categories.list'),
|
||||
'breadcrumb' => [__('Shop.categories.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row pb-3">
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('Shop.Admin.Categories.create') }}" class="btn btn-sm btn-success">{{ __('Shop.Categories.add') }} <i class="fa fa-plus"></i></a>
|
||||
<a href="{{ route('Shop.Admin.Categories.create') }}" class="btn btn-sm btn-success">{{ __('Shop.categories.add') }} <i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/Categories', 'model' => 'Categories'])
|
||||
@include('components.js.datatable', ['route' => '/Shop/Admin/Categories', 'model' => 'categories'])
|
||||
@endpush
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
@if (isset($id_name))id="{{ $id_name }}"@endif
|
||||
class="@if (isset($class)){{ $class }} @else form-control @endif"
|
||||
@if (isset($style))style="{{ $style }}" @endif
|
||||
@if (isset($required))required="required"@endif
|
||||
@if (isset($multiple))multiple="multiple"@endif
|
||||
>
|
||||
<option></option>
|
||||
@if (isset($complex) && $complex)
|
||||
|
||||
Reference in New Issue
Block a user