[WIP] config Datatables/Webpack/Yajra
This commit is contained in:
89
app/Datatables/FamiliesDataTable.php
Normal file
89
app/Datatables/FamiliesDataTable.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataTables;
|
||||
|
||||
use Yajra\DataTables\Html\Button;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Html\Editor\Editor;
|
||||
use Yajra\DataTables\Html\Editor\Fields;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
use App\Models\Shop\Family;
|
||||
|
||||
class FamiliesDataTable extends DataTable
|
||||
{
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
return datatables()
|
||||
->eloquent($query)
|
||||
->addColumn('action', '<a href="{{$id}}"><i class="fa fa-edit"></i></a>');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Family $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function query(Family $model)
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->builder()
|
||||
->setTableId('families-table')
|
||||
->columns($this->getColumns())
|
||||
->minifiedAjax()
|
||||
->dom('Bfrtip')
|
||||
->orderBy(1)
|
||||
->buttons(
|
||||
Button::make('create'),
|
||||
Button::make('export'),
|
||||
Button::make('print'),
|
||||
Button::make('reset'),
|
||||
Button::make('reload')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get columns.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name'),
|
||||
Column::make('alias'),
|
||||
Column::make('latin'),
|
||||
Column::computed('action')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->width(60)
|
||||
->addClass('text-center'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function filename()
|
||||
{
|
||||
return 'Families_' . date('YmdHis');
|
||||
}
|
||||
}
|
||||
29
app/Http/Controllers/Admin/HomeController.php
Normal file
29
app/Http/Controllers/Admin/HomeController.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Support\Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// return redirect('dashboard');
|
||||
}
|
||||
}
|
||||
52
app/Http/Controllers/Shop/Admin/FamilyController.php
Normal file
52
app/Http/Controllers/Shop/Admin/FamilyController.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Families;
|
||||
use App\DataTables\FamiliesDataTable;
|
||||
|
||||
class FamilyController extends Controller
|
||||
{
|
||||
|
||||
public function index(FamiliesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.Families.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Families::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = [];
|
||||
return view('Shop.Admin.Families.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Families::store($request);
|
||||
return redirect()->route('Shop.Admin.Families.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Families::get($id);
|
||||
return view('Shop.Admin.Families.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Families::get($id);
|
||||
return view('Shop.Admin.Families.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Families::destroy($id);
|
||||
}
|
||||
}
|
||||
55
app/Http/Controllers/Shop/Admin/GenreController.php
Normal file
55
app/Http/Controllers/Shop/Admin/GenreController.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Genres;
|
||||
|
||||
class GenreController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
if ($request->ajax()) {
|
||||
return self::getDatatable($request);
|
||||
} else {
|
||||
$data = [];
|
||||
return view('Admin.Shop.Genres.list', $data);
|
||||
}
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Genres::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = [];
|
||||
return view('Admin.Shop.Genres.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Genres::store($request);
|
||||
return redirect()->route('Admin.Shop.Genres.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Genres::get($id);
|
||||
return view('Admin.Shop.Genres.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Genres::get($id);
|
||||
return view('Admin.Shop.Genres.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Genres::destroy($id);
|
||||
}
|
||||
}
|
||||
101
app/Http/Controllers/Shop/Admin/SpecieController.php
Normal file
101
app/Http/Controllers/Shop/Admin/SpecieController.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Species;
|
||||
|
||||
class SpecieController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
if ($request->ajax()) {
|
||||
return self::getDatatable($request);
|
||||
} else {
|
||||
$data = [];
|
||||
return view('Shop.Admin.Species.list', $data);
|
||||
}
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Species::getDatatable($request->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data = [];
|
||||
return view('Shop.Admin.Species.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Species::store($request);
|
||||
return redirect()->route('Shop.Admin.Species.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
return view('Shop.Admin.Species.view', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
return view('Shop.Admin.Species.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
return Species::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -9,20 +9,26 @@ class Shop
|
||||
{
|
||||
public function make(Builder $menu)
|
||||
{
|
||||
$menu->add('Commerce', [ 'permission' => 'backend', 'icon' => 'cog' ])
|
||||
$menu->add('Commerce', [ 'permission' => 'backend', 'icon' => 'shopping-basket' ])
|
||||
->id('shop')
|
||||
->activeIfRoute('shop')
|
||||
|
||||
->order(1);
|
||||
|
||||
$menu->addTo('shop', 'Familles', [ 'route' => 'Shop.Admin.Families.index', 'permission' => 'backend' ])
|
||||
->activeIfRoute(['Shop.Admin.Families.index'])->order(1);
|
||||
$menu->addTo('shop', 'Genres', [ 'route' => 'Shop.Admin.Genres.index', 'permission' => 'backend' ])
|
||||
->activeIfRoute(['Shop.Admin.Genres.index'])->order(2);
|
||||
$menu->addTo('shop', 'Espèces', [ 'route' => 'Shop.Admin.Species.index', 'permission' => 'backend' ])
|
||||
->activeIfRoute(['Shop.Admin.Species.index'])->order(3);
|
||||
|
||||
$menu->addTo('shop', 'Categories', [ 'route' => 'Shop.Admin.Sections.index', 'permission' => 'backend' ])
|
||||
->activeIfRoute(['Shop.Admin.Sections.index'])->order(1);
|
||||
->activeIfRoute(['Shop.Admin.Sections.index'])->order(4);
|
||||
$menu->addTo('shop', 'Produits', [ 'route' => 'Shop.Admin.Products.index', 'permission' => 'backend' ])
|
||||
->activeIfRoute(['Shop.Admin.Products.index'])->order(2);
|
||||
->activeIfRoute(['Shop.Admin.Products.index'])->order(5);
|
||||
$menu->addTo('shop', 'Commandes', [ 'route' => 'Shop.Admin.Orders.index', 'permission' => 'backend' ])
|
||||
->activeIfRoute(['Shop.Admin.Orders.index'])->order(3);
|
||||
->activeIfRoute(['Shop.Admin.Orders.index'])->order(6);
|
||||
$menu->addTo('shop', 'Factures', [ 'route' => 'Shop.Admin.Invoices.index', 'permission' => 'backend' ])
|
||||
->activeIfRoute(['Shop.Admin.Invoices.index'])->order(4);
|
||||
->activeIfRoute(['Shop.Admin.Invoices.index'])->order(7);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Modules;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Family extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Modules;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Species extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
}
|
||||
16
app/Models/Shop/Family.php
Normal file
16
app/Models/Shop/Family.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Family extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_product_families';
|
||||
|
||||
public function genres()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\Genre');
|
||||
}
|
||||
}
|
||||
17
app/Models/Shop/Genre.php
Normal file
17
app/Models/Shop/Genre.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Genres extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_product_genres';
|
||||
|
||||
public function family()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Family');
|
||||
}
|
||||
|
||||
}
|
||||
16
app/Models/Shop/Specie.php
Normal file
16
app/Models/Shop/Specie.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Species extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_product_species';
|
||||
|
||||
public function Genre()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Family');
|
||||
}
|
||||
}
|
||||
54
app/Repositories/Families.php
Normal file
54
app/Repositories/Families.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\Family;
|
||||
|
||||
class Families
|
||||
{
|
||||
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = Family::orderBy('name');
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Family::orderBy('name','asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Family::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 Family::create($data);
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
{
|
||||
return Family::find($id)->update($data);
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Family::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
54
app/Repositories/Genres.php
Normal file
54
app/Repositories/Genres.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\Genre;
|
||||
|
||||
class Genres
|
||||
{
|
||||
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = Genre::orderBy('name');
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Genre::orderBy('name','asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Genre::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 Genre::create($data);
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
{
|
||||
return Genre::find($id)->update($data);
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Genre::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
@@ -15,203 +15,40 @@ class Products
|
||||
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = Product::with(['sections'])->orderBy('name');
|
||||
$model = Product::orderBy('name');
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public static function select_all()
|
||||
public static function getAll()
|
||||
{
|
||||
return Product::select('id','name','active')->orderBy('name','asc')->get()->toArray();
|
||||
return Product::orderBy('name','asc')->get();
|
||||
}
|
||||
|
||||
public static function select_by_id($id)
|
||||
public static function get($id)
|
||||
{
|
||||
return Product::find($id)->toArray();
|
||||
}
|
||||
|
||||
public static function getId($Product = false)
|
||||
{
|
||||
$Product = self::get($Product);
|
||||
return $Product ? $Product->id : false;
|
||||
}
|
||||
|
||||
public static function get($Product = false)
|
||||
{
|
||||
$website = self::getWebsite($Product);
|
||||
return $website ? Product::byWebsite($website->id)->first() : false;
|
||||
return Product::find($id);
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
{
|
||||
$id = isset($data['id']) ? $data['id'] : false;
|
||||
if (!$id) {
|
||||
$Product_id = self::create($data);
|
||||
} else {
|
||||
$Product_id = self::update($data);
|
||||
}
|
||||
|
||||
ApplicationProducts::associate($Product_id, $data['applications']);
|
||||
|
||||
return $Product_id;
|
||||
$item = $id ? self::update($data) : self::create($data);
|
||||
return $item->id;
|
||||
}
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
$slug = Str::slug($data['slug'],'-');
|
||||
$url = $slug . '.' . Partners::getDomain();
|
||||
$website = Websites::create($url);
|
||||
$item = [];
|
||||
$item['website_id'] = $website->id;
|
||||
$item['name'] = $data['name'];
|
||||
$item['slug'] = $slug;
|
||||
$item['repository'] = $slug;
|
||||
$item['session_name'] = $slug . '_sess';
|
||||
$item['logo_image'] = 'logo.png';
|
||||
$item['background_image'] = 'login-background.jpg';
|
||||
$item['custom_css'] = 'Product.css';
|
||||
$item['active'] = true;
|
||||
$Product = Product::create($item);
|
||||
|
||||
$DB_system = Partners::getDBName();
|
||||
$sql = "GRANT SELECT ON `$DB_system`.* TO '" . $website->uuid . "'@localhost";
|
||||
DB::connection('system')->statement($sql);
|
||||
// GRANT SELECT ON `legstack`.* TO '828656d3463e45c0a33e9cc8b5c2f265'@'127.0.0.1';
|
||||
return $Product->id;
|
||||
return Product::create($data);
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
{
|
||||
// TODO
|
||||
return Product::find($id)->update($data);
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
$Product = Product::find($id);
|
||||
|
||||
}
|
||||
|
||||
public static function getPublicPath($repository = false, $Product = false)
|
||||
{
|
||||
return self::getLocalPath() . self::getPath($repository, $Product);
|
||||
}
|
||||
|
||||
/**
|
||||
* [getPrivatePath renvoie le chemin complet du repertoire du tenant ]
|
||||
* @param boolean $repository [description]
|
||||
* @param boolean $Product [description]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public static function getPrivatePath($repository = false, $Product = false)
|
||||
{
|
||||
return self::getPrivateDir($repository, $Product);
|
||||
}
|
||||
|
||||
public static function getPrivateDir($repository = false, $Product = false)
|
||||
{
|
||||
return self::getLocalDir() . self::getPath($repository, $Product);
|
||||
}
|
||||
|
||||
/**
|
||||
* [getRelativePath renvoie le chemin relatif au storage ]
|
||||
* @param boolean $repository [description]
|
||||
* @param boolean $Product [description]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public static function getRelativePath($repository = false, $Product = false)
|
||||
{
|
||||
return self::getTenancyRoot() . self::getPath($repository, $Product);
|
||||
}
|
||||
|
||||
/**
|
||||
* [getPath renvoie le chemin relatif à la tenancy root]
|
||||
* @param boolean $repository [description]
|
||||
* @param boolean $Product [description]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public static function getPath($repository = false, $Product = false)
|
||||
{
|
||||
$path = '/'. self::getSlug($Product);
|
||||
$path .= $repository ? $repository : '';
|
||||
return $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* [getStorage revoie le storage du tenant (local, S3, ...)]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public static function getStorage()
|
||||
{
|
||||
return Storage::disk('tenant');
|
||||
}
|
||||
|
||||
public static function getDirectory()
|
||||
{
|
||||
return app(\Hyn\Tenancy\Website\Directory::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* [getLocalDir renvoie le chemin complet vers la tenancy sur le disque]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public static function getLocalDir()
|
||||
{
|
||||
return storage_path('app' . self::getTenancyRoot());
|
||||
}
|
||||
|
||||
/**
|
||||
* [getLocalPath revnoie le chemin public vers la tenancy publique]
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public static function getLocalPath()
|
||||
{
|
||||
return '/storage' . self::getTenancyRoot();
|
||||
}
|
||||
|
||||
public static function getSlug($Product = false)
|
||||
{
|
||||
if ($Product) {
|
||||
return $Product;
|
||||
}
|
||||
|
||||
$website = self::getWebsite();
|
||||
if ($website) {
|
||||
return($website->uuid);
|
||||
}
|
||||
|
||||
/*
|
||||
// regarde si le Product existe et qu'il possède au moins une licence valide pour une des applications
|
||||
$host = array_key_exists('HTTP_HOST', $_SERVER) ? $_SERVER['HTTP_HOST'] : 'legtech.legtech';
|
||||
$url_hostname = explode(".", $host); // décompose l'url de base
|
||||
$slug = $url_hostname[0];
|
||||
if ($slug == 'legstack') {
|
||||
$slug = 'legtech';
|
||||
}
|
||||
return $slug;
|
||||
*/
|
||||
}
|
||||
|
||||
// récupère les informations de connexion à la base du Product
|
||||
public static function getDatabaseEnvironment($Product_id)
|
||||
{
|
||||
return Product::byId($Product_id)->first()->toArray();
|
||||
}
|
||||
|
||||
public static function isProduct()
|
||||
{
|
||||
$website = self::getWebsite();
|
||||
$is_Product = $website ? true : false;
|
||||
return $is_Product;
|
||||
}
|
||||
|
||||
public static function getWebsite()
|
||||
{
|
||||
return \Hyn\Tenancy\Facades\TenancyFacade::website();
|
||||
}
|
||||
|
||||
public static function getWebsiteByProduct($id)
|
||||
{
|
||||
$Product = Product::find($id);
|
||||
return Website::find($Product->website_id);
|
||||
return Product::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
54
app/Repositories/Species.php
Normal file
54
app/Repositories/Species.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\Specie;
|
||||
|
||||
class Species
|
||||
{
|
||||
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = Specie::orderBy('name');
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Specie::orderBy('name','asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Specie::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 Specie::create($data);
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
{
|
||||
return Specie::find($id)->update($data);
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Specie::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
225
app/User.php
Normal file
225
app/User.php
Normal file
@@ -0,0 +1,225 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Yadahan\AuthenticationLog\AuthenticationLogable;
|
||||
use Laratrust\Traits\LaratrustUserTrait;
|
||||
use Mpociot\Teamwork\Traits\UserHasTeams;
|
||||
use Sebastienheyd\Boilerplate\Notifications\NewUser as NewUserNotification;
|
||||
use Sebastienheyd\Boilerplate\Notifications\ResetPassword as ResetPasswordNotification;
|
||||
|
||||
/**
|
||||
* Sebastienheyd\Boilerplate\Models\User.
|
||||
*
|
||||
* @property int $id
|
||||
* @property bool $active
|
||||
* @property string $first_name
|
||||
* @property string $last_name
|
||||
* @property string $email
|
||||
* @property string $password
|
||||
* @property string $remember_token
|
||||
* @property \Carbon\Carbon $created_at
|
||||
* @property \Carbon\Carbon $updated_at
|
||||
* @property string $deleted_at
|
||||
* @property string $last_login
|
||||
* @property-read string|false $avatar_path
|
||||
* @property-read string $avatar_url
|
||||
* @property-read mixed $name
|
||||
* @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Sebastienheyd\Boilerplate\Models\Permission[] $permissions
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\Sebastienheyd\Boilerplate\Models\Role[] $roles
|
||||
*
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereActive($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereDeletedAt($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereEmail($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereFirstName($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereId($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereLastLogin($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereLastName($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User wherePassword($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereRememberToken($value)
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereRoleIs($role = '')
|
||||
* @method static \Illuminate\Database\Query\Builder|\Sebastienheyd\Boilerplate\Models\User whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use Notifiable;
|
||||
use LaratrustUserTrait;
|
||||
use SoftDeletes;
|
||||
use UserHasTeams;
|
||||
use AuthenticationLogable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = ['active', 'last_name', 'first_name', 'email', 'password', 'remember_token', 'last_login'];
|
||||
|
||||
protected $hidden = ['password', 'remember_token'];
|
||||
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function teams()
|
||||
{
|
||||
return $this->hasManyThrough('App\Models\Core\Auth\Team', 'App\Models\Core\Auth\TeamUser', 'user_id', 'id', 'id', 'team_id');
|
||||
}
|
||||
|
||||
public function scopeByTeam($query, $id)
|
||||
{
|
||||
return $query->whereHas('teams', function ($query) use ($id) {
|
||||
$query->where('id', $id);
|
||||
});
|
||||
}
|
||||
|
||||
public function scopeByUniqueTeam($query)
|
||||
{
|
||||
return $query->has('teams', '=', 1);
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
{
|
||||
return $query->where('active', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the password reset notification.
|
||||
*
|
||||
* @param string $token
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function sendPasswordResetNotification($token)
|
||||
{
|
||||
$this->notify(new ResetPasswordNotification($token));
|
||||
}
|
||||
|
||||
/**
|
||||
* Send notification when a new user is created.
|
||||
*
|
||||
* @param string $token
|
||||
*/
|
||||
public function sendNewUserNotification($token)
|
||||
{
|
||||
$this->notify(new NewUserNotification($token, $this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return last name in uppercase by default.
|
||||
*
|
||||
* @param $value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastNameAttribute($value)
|
||||
{
|
||||
return mb_strtoupper($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return first name with first char of every word in uppercase.
|
||||
*
|
||||
* @param $value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstNameAttribute($value)
|
||||
{
|
||||
return mb_convert_case($value, MB_CASE_TITLE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a concatenation of first name and last_name if field name does not exists.
|
||||
*
|
||||
* @param $value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNameAttribute($value)
|
||||
{
|
||||
if (!empty($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
return $this->first_name.' '.$this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return last login date formatted.
|
||||
*
|
||||
* @param string $format
|
||||
* @param string $default
|
||||
*
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function getLastLogin($format = 'YYYY-MM-DD HH:mm:ss', $default = '')
|
||||
{
|
||||
if ($this->last_login === null) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
return Carbon::createFromTimeString($this->last_login)->isoFormat($format);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return role list as a string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRolesList()
|
||||
{
|
||||
$res = [];
|
||||
foreach ($this->roles as $role) {
|
||||
$res[] = __($role->display_name);
|
||||
}
|
||||
if (empty($res)) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
return implode(', ', $res);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if current user has an avatar.
|
||||
*
|
||||
* @return string|false
|
||||
*/
|
||||
public function getAvatarPathAttribute()
|
||||
{
|
||||
return public_path('images/avatars/'.md5($this->id.$this->email).'.jpg');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return current user avatar uri.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAvatarUrlAttribute()
|
||||
{
|
||||
if (is_file($this->avatar_path)) {
|
||||
$ts = filemtime($this->avatar_path);
|
||||
|
||||
return asset('images/avatars/'.md5($this->id.$this->email).'.jpg?t='.$ts);
|
||||
}
|
||||
|
||||
return asset('/assets/vendor/boilerplate/images/default-user.png');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
@extends('boilerplate::auth.layout', [
|
||||
'title' => __('boilerplate::auth.firstlogin.title'),
|
||||
'bodyClass' => 'hold-transition login-page'
|
||||
])
|
||||
|
||||
@section('content')
|
||||
@component('boilerplate::auth.loginbox')
|
||||
{{ Form::open(['route' => 'boilerplate.users.firstlogin', 'autocomplete' => 'off']) }}
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
<div class="alert alert-info">
|
||||
{{ __('boilerplate::auth.firstlogin.intro') }}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{{ Form::input('password', 'password', Request::old('password'), ['class' => 'form-control'.$errors->first('password', ' is-invalid'), 'autofocus', 'placeholder' => __('boilerplate::auth.fields.password')]) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('password','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{{ Form::input('password', 'password_confirmation', Request::old('password_confirmation'), ['class' => 'form-control'.$errors->first('password_confirmation', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.password_confirm')]) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('password_confirmation','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('boilerplate::auth.firstlogin.button') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@endcomponent
|
||||
@endsection
|
||||
@@ -1,15 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ App::getLocale() }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<title>{{ $title }} | {{ config('app.name') }}</title>
|
||||
<link rel="stylesheet" href="{{ mix('/adminlte.min.css', '/assets/vendor/boilerplate') }}">
|
||||
</head>
|
||||
<body class="hold-transition {{ $bodyClass ?? 'login-page'}}">
|
||||
@yield('content')
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,55 +0,0 @@
|
||||
@extends('boilerplate::auth.layout', [
|
||||
'title' => __('boilerplate::auth.login.title'),
|
||||
'bodyClass' => 'hold-transition login-page'
|
||||
])
|
||||
|
||||
@section('content')
|
||||
@component('boilerplate::auth.loginbox')
|
||||
<p class="login-box-msg text-sm">{{ __('boilerplate::auth.login.intro') }}</p>
|
||||
{!! Form::open(['route' => 'boilerplate.login', 'method' => 'post', 'autocomplete'=> 'off']) !!}
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{{ Form::email('email', old('email'), ['class' => 'form-control'.$errors->first('email', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('email','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{{ Form::password('password', ['class' => 'form-control'.$errors->first('password', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('password','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-7">
|
||||
<div class="icheck-primary">
|
||||
<input type="checkbox" id="remember" name="remember" {{ old('remember') ? 'checked' : '' }}>
|
||||
<label for="remember" class="font-weight-normal text-sm">
|
||||
{{ __('boilerplate::auth.login.rememberme') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<button type="submit" class="btn btn-primary btn-block">{{ __('boilerplate::auth.login.signin') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
<p class="mb-1 text-sm">
|
||||
<a href="{{ route('boilerplate.password.request') }}">{{ __('boilerplate::auth.login.forgotpassword') }}</a><br>
|
||||
</p>
|
||||
@if(config('boilerplate.auth.register'))
|
||||
<p class="mb-0 text-sm">
|
||||
<a href="{{ route('boilerplate.register') }}" class="text-center">{{ __('boilerplate::auth.login.register') }}</a>
|
||||
</p>
|
||||
@endif
|
||||
@endcomponent
|
||||
@endsection
|
||||
@@ -1,12 +0,0 @@
|
||||
<div class="login-box">
|
||||
<div class="login-logo">
|
||||
{!! config('boilerplate.theme.sidebar.brand.logo.icon') ?? '' !!}
|
||||
{!! config('boilerplate.theme.sidebar.brand.logo.text') ?? $title ?? '' !!}
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body login-card-body">
|
||||
{{ $slot }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,44 +0,0 @@
|
||||
@extends('boilerplate::auth.layout', ['title' => __('boilerplate::auth.password.title'), 'bodyClass' => 'hold-transition login-page'])
|
||||
|
||||
@section('content')
|
||||
@component('boilerplate::auth.loginbox')
|
||||
<p class="login-box-msg text-sm">{{ __('boilerplate::auth.password.intro') }}</p>
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success d-flex align-items-center">
|
||||
<span class="far fa-check-circle fa-3x mr-3"></span>
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@else
|
||||
{!! Form::open(['route' => 'boilerplate.password.email', 'method' => 'post', 'autocomplete'=> 'off']) !!}
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{{ Form::email('email', old('email'), ['class' => 'form-control'.$errors->first('email', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('email','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-12 text-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('boilerplate::auth.password.submit') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
@endif
|
||||
<p class="mb-0 text-sm">
|
||||
<a href="{{ route('boilerplate.login') }}">{{ __('boilerplate::auth.password.login_link') }}</a>
|
||||
</p>
|
||||
@if(config('boilerplate.auth.register'))
|
||||
<p class="mb-0 text-sm">
|
||||
<a href="{{ route('boilerplate.register') }}" class="text-center">{{ __('boilerplate::auth.login.register') }}</a>
|
||||
</p>
|
||||
@endif
|
||||
@endcomponent
|
||||
@endsection
|
||||
@@ -1,48 +0,0 @@
|
||||
@extends('boilerplate::auth.layout', ['title' => __('boilerplate::auth.password_reset.title')])
|
||||
|
||||
@section('content')
|
||||
@component('boilerplate::auth.loginbox')
|
||||
<p class="login-box-msg text-sm">{{ __('boilerplate::auth.password_reset.intro') }}</p>
|
||||
{!! Form::open(['route' => 'boilerplate.password.reset.post', 'method' => 'post', 'autocomplete'=> 'off']) !!}
|
||||
{!! Form::hidden('token', $token) !!}
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{{ Form::email('email', old('email', $email), ['class' => 'form-control'.$errors->first('email', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.email'), 'required', 'autofocus']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('email','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{{ Form::password('password', ['class' => 'form-control'.$errors->first('password', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('password','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="input-group">
|
||||
{{ Form::password('password_confirmation', ['class' => 'form-control'.$errors->first('password_confirmation', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.password_confirm'), 'required']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('password_confirmation','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<button class="btn btn-primary" type="submit">{{ __('boilerplate::auth.password_reset.submit') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
@endcomponent
|
||||
@endsection
|
||||
@@ -1,76 +0,0 @@
|
||||
@extends('boilerplate::auth.layout', ['title' => __('boilerplate::auth.register.title'), 'bodyClass' => 'hold-transition login-page'])
|
||||
|
||||
@section('content')
|
||||
@component('boilerplate::auth.loginbox')
|
||||
<p class="login-box-msg text-sm">{{ __('boilerplate::auth.register.intro') }}</p>
|
||||
{!! Form::open(['route' => 'boilerplate.register', 'method' => 'post', 'autocomplete'=> 'off']) !!}
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
{{ Form::text('first_name', old('first_name'), ['class' => 'form-control'.$errors->first('first_name', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.first_name'), 'required', 'autofocus']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-user"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('first_name','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
{{ Form::text('last_name', old('last_name'), ['class' => 'form-control'.$errors->first('last_name', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.last_name'), 'required']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-user"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('last_name','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
{{ Form::email('email', old('email'), ['class' => 'form-control'.$errors->first('email', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.email'), 'required']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-envelope"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('email','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
{{ Form::password('password', ['class' => 'form-control'.$errors->first('password', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.password'), 'required']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('password','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
{{ Form::password('password_confirmation', ['class' => 'form-control'.$errors->first('password_confirmation', ' is-invalid'), 'placeholder' => __('boilerplate::auth.fields.password_confirm'), 'required']) }}
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">
|
||||
<span class="fas fa-lock"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('password_confirmation','<div class="error-bubble"><div>:message</div></div>') !!}
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="col-12 text-right">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('boilerplate::auth.register.register_button') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{!! Form::close() !!}
|
||||
@if(!$firstUser)
|
||||
<p class="mb-0 text-sm">
|
||||
<a href="{{ route('boilerplate.login') }}">{{ __('boilerplate::auth.register.login_link') }}</a><br>
|
||||
</p>
|
||||
@endif
|
||||
@endcomponent
|
||||
@endsection
|
||||
@@ -1,24 +0,0 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Verify Your Email Address') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('resent'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('A fresh verification link has been sent to your email address.') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ __('Before proceeding, please check your email for a verification link.') }}
|
||||
{{ __('If you did not receive the email') }}, <a href="{{ route('verification.resend') }}">{{ __('click here to request another') }}</a>.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
15
resources/js/bootstrap.js
vendored
15
resources/js/bootstrap.js
vendored
@@ -26,3 +26,18 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
|
||||
// forceTLS: true
|
||||
// });
|
||||
|
||||
|
||||
try {
|
||||
window.$ = window.jQuery = require('jquery');
|
||||
|
||||
require('datatables.net');
|
||||
require('datatables.net-bs4');
|
||||
require('datatables.net-buttons-bs4');
|
||||
} catch (e) {}
|
||||
|
||||
|
||||
// require('datatables.net');
|
||||
// require('datatables.net-bs4');
|
||||
// require('datatables.net-buttons');
|
||||
// require('datatables.net-buttons-bs4');
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
//
|
||||
// DataTables
|
||||
@import "~datatables.net-bs4/css/dataTables.bootstrap4.css";
|
||||
@import "~datatables.net-buttons-bs4/css/buttons.bootstrap4.css";
|
||||
@@ -1,3 +1,4 @@
|
||||
TEST
|
||||
<nav class="main-header navbar navbar-expand navbar-{{ config('boilerplate.theme.navbar.bg') }} navbar-{{ config('boilerplate.theme.navbar.type') }} {{ config('boilerplate.theme.navbar.border') ? "" : "border-bottom-0" }}">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item">
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<title>{{ $title }} | {{ config('app.name') }}</title>
|
||||
<link rel="stylesheet" href="{{ mix('/adminlte.min.css', '/assets/vendor/boilerplate') }}">
|
||||
<link rel="stylesheet" href="{{ mix('/css/app.css') }}">
|
||||
@stack('css')
|
||||
</head>
|
||||
<body class="layout-fixed layout-navbar-fixed sidebar-mini">
|
||||
@@ -36,6 +37,9 @@
|
||||
<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 src="{{ mix('js/app.js') }}"></script>
|
||||
<script src="{{ asset('vendor/datatables/buttons.server-side.js') }}"></script>
|
||||
@stack('scripts')
|
||||
<script>
|
||||
$.ajaxSetup({headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'}});
|
||||
bootbox.setLocale('{{ App::getLocale() }}');
|
||||
|
||||
@@ -47,5 +47,8 @@
|
||||
});
|
||||
</script>
|
||||
@stack('js')
|
||||
<script src="{{ mix('js/app.js') }}"></script>
|
||||
<script src="{{ asset('vendor/datatables/buttons.server-side.js') }}"></script>
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
||||
|
||||
22
resources/views/shop/admin/Families/create.blade.php
Normal file
22
resources/views/shop/admin/Families/create.blade.php
Normal file
@@ -0,0 +1,22 @@
|
||||
@extends('boilerplate::layout.index', [
|
||||
'title' => __('shop.families.title'),
|
||||
'subtitle' => __('shop.families.add'),
|
||||
'breadcrumb' => [__('shop.families.title'), __('shop.families.add')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.families.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 text-right">
|
||||
@include('components.button-save')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('Shop.Admin.families.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
39
resources/views/shop/admin/Families/edit.blade.php
Normal file
39
resources/views/shop/admin/Families/edit.blade.php
Normal file
@@ -0,0 +1,39 @@
|
||||
@extends('layout.index', [
|
||||
'title' => 'Familles',
|
||||
'subtitle' => 'Edition d\'une famille',
|
||||
'breadcrumb' => ['Familles']
|
||||
])
|
||||
|
||||
@include('boilerplate::load.icheck')
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@prepend('js')
|
||||
@include('components.js', ['js' => '/js/main.min.js'])
|
||||
@endprepend
|
||||
|
||||
@push('css')
|
||||
@include('components.css', ['css' => '/css/main.min.css'])
|
||||
@endpush
|
||||
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Families.update', 'id' => 'lot-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("Shop.Admin.Families.index") }}" class="btn btn-default">
|
||||
{{ __('families.list.title') }}
|
||||
</a>
|
||||
|
||||
<span class="btn-group pull-right">
|
||||
@include('components.button-save')
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
@include('Shop.Admin.Families.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
38
resources/views/shop/admin/Families/form.blade.php
Normal file
38
resources/views/shop/admin/Families/form.blade.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => (isset($section['name'])) ? $section['name'] : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.textarea', ['name' => 'description', 'id_name' => 'description', 'value' => (isset($section['description'])) ? $section['description'] : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Rubrique parente') }}
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="row">
|
||||
<div class="col-md-12 row-new-lot-photo row-lot-photo mt-3">
|
||||
|
||||
<!--
|
||||
<p>
|
||||
<button type="button" class="btn btn-danger delete-new-lot-photo-btn"><i class="fa fa-minus-circle"></i></button>
|
||||
Photo <span class="row-photo-number"></span>
|
||||
</p>
|
||||
-->
|
||||
|
||||
<input name="lot_photos[][file]" type="file" class="file" data-show-upload="false" data-show-caption="true" data-msg-placeholder="Choisissez une photo">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('boilerplate::load.tinymce')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
$('#description').tinymce({});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
20
resources/views/shop/admin/Families/list.blade.php
Normal file
20
resources/views/shop/admin/Families/list.blade.php
Normal file
@@ -0,0 +1,20 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('shop.families.title'),
|
||||
'breadcrumb' => [__('shop.families.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row pb-3">
|
||||
<div class="col text-right">
|
||||
<a href="{{ route('Shop.Admin.Families.create') }}" class="btn btn-sm btn-success">{{ __('shop.families.add') }} <i class="fa fa-plus"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{$dataTable->table()}}
|
||||
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
{{$dataTable->scripts()}}
|
||||
@endpush
|
||||
30
resources/views/shop/admin/Families/show.blade.php
Normal file
30
resources/views/shop/admin/Families/show.blade.php
Normal file
@@ -0,0 +1,30 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('products.title'),
|
||||
'subtitle' => __('products.title'),
|
||||
'breadcrumb' => [__('products.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-offset-2 col-md-8">
|
||||
|
||||
<div class="box box-info">
|
||||
<div class="box-body">
|
||||
<div class="col-md-6">
|
||||
<h3>{{ name }}</h3>
|
||||
<h4>
|
||||
{{ $product.section.name }}<br>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
@include('components.carousel')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@@ -1,38 +0,0 @@
|
||||
<div class="col-lg-4 col-md-6">
|
||||
<div class="property bg-light-2 m-bottom-30 box-shadow-1 box-shadow-2-hover border-1 border-solid border-light">
|
||||
<div class="property-media overlay-wrapper">
|
||||
<img class="img-fluid wow fadeIn" data-wow-offset="100" src="/storage/images/site/{{ $image }}" alt="Lot">
|
||||
<div class="media-data">
|
||||
<div class="position-top">
|
||||
<div class="text-white text-size-24 pull-right">
|
||||
<a class="text-white text-base-hover" href="#">
|
||||
<i class="fa fa-heart-o"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="position-bottom">
|
||||
<div class="badge badge-base text-white pull-left m-right-8 p-top-8 p-right-12 p-bottom-8 p-left-12 rounded-0">{{ $dispositif }}</div>
|
||||
<div class="text-white text-size-18 pull-right"><i class="fa fa-camera"></i> {{ $nb_photos }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overlay bg-bg opacity-9"></div>
|
||||
</div>
|
||||
<div class="property-section p-left-15 p-right-15">
|
||||
<div class="m-top-20 m-bottom-20">
|
||||
<h2 class="text-base text-bold-700 m-top-15 bleu wow heartBeat" data-wow-offset="100">
|
||||
{{ $prix }} €
|
||||
<small class="text-size-14 text-muted"></small>
|
||||
</h2>
|
||||
<h5><a class="text-bold-600 text-dark text-base-hover" href="#">{{ $titre }}</a></h5>
|
||||
<p>Au sein d'une résidence récente et sécurisée, dans un cadre calme et verdoyant, appartement T3 de 58 m² situé au 1er étage comprenant</p>
|
||||
<p><a href="#" class="bleu"><span class="fa fa-2x fa-map-marker"></span></a> <strong>{{ $adresse }} {{ $ville }}</strong></p>
|
||||
<ul class="icon-list list-inline m-bottom-0">
|
||||
<li class="list-inline-item"><span class="bleu fa fa-map-o"></span> {{ $nb_chambres+2 }} pièces</li>
|
||||
<li class="list-inline-item"><span class="bleu fa fa-bed"></span> {{ $nb_chambres }} chambres</li>
|
||||
<li class="list-inline-item"><span class="bleu fa fa-expand"></span> <strong>{{ $surface }} m²</strong></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -1,110 +0,0 @@
|
||||
<section style="padding-top: 20px;">
|
||||
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
|
||||
<div class="container-fluid position-absolute" style="z-index: 5; padding-top: 40px;">
|
||||
<div class="row justify-content-md-center">
|
||||
<div class="col-sm-8">
|
||||
<div class="widget padding-lg bg-dark">
|
||||
<h1 class="text-center text-light wow rubberBand">Recherchez un lot</h1>
|
||||
<form action="{{ route('Hestimmo.Lots.disponibles') }}" method="GET" class="form-inline">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<label for="">Type de logement</label>
|
||||
<select name="type_lot_id" class="form-control">
|
||||
<option>Type de lots</option>
|
||||
@foreach($type_lots as $key => $type_lot)
|
||||
<option value="{{$key}}">{{$type_lot}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label for="">Ville</label>
|
||||
<select name="ville" id="ville" class="form-control" placeholder="Ville"></select>
|
||||
|
||||
<div class="form-group">
|
||||
<input type="number" style="width: 100%;" id="distance" name="distance" data-provide="slider" data-slider-min="0" data-slider-max="40" data-slider-step="5" >
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
Distance : <span id="distanceSliderVal">5</span> km
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 text-center">
|
||||
<label class="col-sm-12">Budget</label>
|
||||
<div class="form-group">
|
||||
<input type="number" style="width: 100%;" id="budget" name="budget" data-provide="slider" data-slider-min="50000" data-slider-max="600000" data-slider-step="10000" >
|
||||
</div>
|
||||
<h3><span id="budgetSliderVal">50 000,00 €</span></h3>
|
||||
<div class="w-100">+/- 5000 €</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label for=""></label>
|
||||
<button class="btn btn-primary btn-block">Rechercher</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-item active">
|
||||
<img src="/storage/images/site/slide01.jpg" class="d-block w-100" alt="...">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img src="/storage/images/site/slide02.jpg" class="d-block w-100" alt="...">
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img src="/storage/images/site/slide03.jpg" class="d-block w-100" alt="...">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@include('boilerplate::load.select2')
|
||||
|
||||
@push('js')
|
||||
<script src="/js/bootstrap-slider.min.js"></script>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
var mySlider = $("input.slider").slider();
|
||||
|
||||
$("#budget").on("slide", function(slideEvt) {
|
||||
value = new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' }).format(slideEvt.value);
|
||||
$("#budgetSliderVal").text(value);
|
||||
});
|
||||
|
||||
$("#distance").on("slide", function(slideEvt) {
|
||||
$("#distanceSliderVal").text(slideEvt.value);
|
||||
});
|
||||
|
||||
$('#ville').select2({
|
||||
ajax: {
|
||||
url: "{{ route('Villes.autocomplete') }}",
|
||||
data: function (params) {
|
||||
var query = {
|
||||
search: params.term
|
||||
}
|
||||
|
||||
// Query parameters will be ?search=[term]
|
||||
return query;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var wew = new Wew({
|
||||
target: '.wow',
|
||||
keyword: 'wow',
|
||||
});
|
||||
wew.init();
|
||||
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="/css/bootstrap-slider.min.css">
|
||||
@endpush
|
||||
22
resources/views/shop/admin/Species/create.blade.php
Normal file
22
resources/views/shop/admin/Species/create.blade.php
Normal file
@@ -0,0 +1,22 @@
|
||||
@extends('boilerplate::layout.index', [
|
||||
'title' => __('shop.families.title'),
|
||||
'subtitle' => __('shop.families.add'),
|
||||
'breadcrumb' => [__('shop.families.title'), __('shop.families.add')]
|
||||
])
|
||||
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.families.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 text-right">
|
||||
@include('components.button-save')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('Shop.Admin.families.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
39
resources/views/shop/admin/Species/edit.blade.php
Normal file
39
resources/views/shop/admin/Species/edit.blade.php
Normal file
@@ -0,0 +1,39 @@
|
||||
@extends('layout.index', [
|
||||
'title' => 'Familles',
|
||||
'subtitle' => 'Edition d\'une famille',
|
||||
'breadcrumb' => ['Familles']
|
||||
])
|
||||
|
||||
@include('boilerplate::load.icheck')
|
||||
@include('boilerplate::load.fileinput')
|
||||
|
||||
@prepend('js')
|
||||
@include('components.js', ['js' => '/js/main.min.js'])
|
||||
@endprepend
|
||||
|
||||
@push('css')
|
||||
@include('components.css', ['css' => '/css/main.min.css'])
|
||||
@endpush
|
||||
|
||||
|
||||
@section('content')
|
||||
|
||||
{{ Form::open(['route' => 'Shop.Admin.Families.update', 'id' => 'lot-form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 mbl">
|
||||
<a href="{{ route("Shop.Admin.Families.index") }}" class="btn btn-default">
|
||||
{{ __('families.list.title') }}
|
||||
</a>
|
||||
|
||||
<span class="btn-group pull-right">
|
||||
@include('components.button-save')
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="id" value="{{ $id }}">
|
||||
@include('Shop.Admin.Families.form')
|
||||
</form>
|
||||
|
||||
@endsection
|
||||
38
resources/views/shop/admin/Species/form.blade.php
Normal file
38
resources/views/shop/admin/Species/form.blade.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{{ Form::label('name', 'Nom') }}
|
||||
@include('components.input', ['name' => 'name', 'value' => (isset($section['name'])) ? $section['name'] : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Description') }}
|
||||
@include('components.textarea', ['name' => 'description', 'id_name' => 'description', 'value' => (isset($section['description'])) ? $section['description'] : null, 'required' => true])
|
||||
|
||||
{{ Form::label('description', 'Rubrique parente') }}
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="row">
|
||||
<div class="col-md-12 row-new-lot-photo row-lot-photo mt-3">
|
||||
|
||||
<!--
|
||||
<p>
|
||||
<button type="button" class="btn btn-danger delete-new-lot-photo-btn"><i class="fa fa-minus-circle"></i></button>
|
||||
Photo <span class="row-photo-number"></span>
|
||||
</p>
|
||||
-->
|
||||
|
||||
<input name="lot_photos[][file]" type="file" class="file" data-show-upload="false" data-show-caption="true" data-msg-placeholder="Choisissez une photo">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('boilerplate::load.tinymce')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
$('#description').tinymce({});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
62
resources/views/shop/admin/Species/list.blade.php
Normal file
62
resources/views/shop/admin/Species/list.blade.php
Normal file
@@ -0,0 +1,62 @@
|
||||
@extends('boilerplate::layout.index', [
|
||||
'title' => __('shop.species.title'),
|
||||
'breadcrumb' => [__('shop.species.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<table class="table table-striped table-hover va-middle" id="species-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<input type="text" class="form-control-sm" style="max-width: 100px;">
|
||||
</th>
|
||||
<th>
|
||||
</th>
|
||||
<th class="text-right">
|
||||
<a href="{{ route('Shop.Admin.Species.create') }}" class="btn btn-sm btn-success">{{ __('shop.species.add') }} <i class="fa fa-plus"></i></a>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nom</th>
|
||||
<th>Nb produits</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('boilerplate::load.datatables')
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
$('#species-table').dataTable();
|
||||
|
||||
$('#species-table').on('click', '.destroy', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var href = $(this).attr('href');
|
||||
var line = $(this).closest('tr');
|
||||
|
||||
bootbox.confirm("{{ __('boilerplate::shop.admin.species.list.confirmdelete') }}", function (result) {
|
||||
if (result === false) return;
|
||||
|
||||
$.ajax({
|
||||
url: href,
|
||||
method: 'delete',
|
||||
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
||||
success: function(){
|
||||
line.remove();
|
||||
growl("{{ __('boilerplate::shop.admin.species.list.deletesuccess') }}", 'success');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
30
resources/views/shop/admin/Species/show.blade.php
Normal file
30
resources/views/shop/admin/Species/show.blade.php
Normal file
@@ -0,0 +1,30 @@
|
||||
@extends('layout.index', [
|
||||
'title' => __('products.title'),
|
||||
'subtitle' => __('products.title'),
|
||||
'breadcrumb' => [__('products.title')]
|
||||
])
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-offset-2 col-md-8">
|
||||
|
||||
<div class="box box-info">
|
||||
<div class="box-body">
|
||||
<div class="col-md-6">
|
||||
<h3>{{ name }}</h3>
|
||||
<h4>
|
||||
{{ $product.section.name }}<br>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
@include('components.carousel')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
12
routes/Admin/Shop/Families.php
Normal file
12
routes/Admin/Shop/Families.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
Route::prefix('Families')->name('Families.')->group(function () {
|
||||
Route::get('', 'FamilyController@index')->name('index');
|
||||
Route::get('create', 'FamilyController@create')->name('create');
|
||||
Route::delete('destroy', 'FamilyController@destroy')->name('destroy');
|
||||
Route::post('update', 'FamilyController@update')->name('update');
|
||||
Route::post('store', 'FamilyController@store')->name('store');
|
||||
Route::get('edit/{id}', 'FamilyController@edit')->name('edit');
|
||||
|
||||
});
|
||||
|
||||
12
routes/Admin/Shop/Genres.php
Normal file
12
routes/Admin/Shop/Genres.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
Route::prefix('Genres')->name('Genres.')->group(function () {
|
||||
Route::get('', 'GenreController@index')->name('index');
|
||||
Route::get('create', 'GenreController@create')->name('create');
|
||||
Route::delete('destroy', 'GenreController@destroy')->name('destroy');
|
||||
Route::post('update', 'GenreController@update')->name('update');
|
||||
Route::post('store', 'GenreController@store')->name('store');
|
||||
Route::get('edit/{id}', 'GenreController@edit')->name('edit');
|
||||
|
||||
});
|
||||
|
||||
12
routes/Admin/Shop/Species.php
Normal file
12
routes/Admin/Shop/Species.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
Route::prefix('Species')->name('Species.')->group(function () {
|
||||
Route::get('', 'SpecieController@index')->name('index');
|
||||
Route::get('create', 'SpecieController@create')->name('create');
|
||||
Route::delete('destroy', 'SpecieController@destroy')->name('destroy');
|
||||
Route::post('update', 'SpecieController@update')->name('update');
|
||||
Route::post('store', 'SpecieController@store')->name('store');
|
||||
Route::get('edit/{id}', 'SpecieController@edit')->name('edit');
|
||||
|
||||
});
|
||||
|
||||
5
routes/Admin/Shop/route.php
Normal file
5
routes/Admin/Shop/route.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
include( __DIR__ . '/Families.php');
|
||||
include( __DIR__ . '/Genres.php');
|
||||
include( __DIR__ . '/Species.php');
|
||||
5
routes/Admin/route.php
Normal file
5
routes/Admin/route.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
Route::middleware('auth')->prefix('Admin')->namespace('Admin')->name('Admin.')->group(function () {
|
||||
Route::get('', 'HomeController@index')->name('home');
|
||||
});
|
||||
@@ -13,4 +13,7 @@ Route::middleware('auth')->prefix('Admin')->namespace('Admin')->name('Admin.')->
|
||||
include( __DIR__ . '/ProductPrices.php');
|
||||
include( __DIR__ . '/Products.php');
|
||||
include( __DIR__ . '/Sections.php');
|
||||
|
||||
include( __DIR__ . '/../../Admin/Shop/route.php');
|
||||
|
||||
});
|
||||
|
||||
@@ -6,5 +6,6 @@ Route::prefix('Shop')->namespace('Shop')->name('Shop.')->group(function () {
|
||||
include( __DIR__ . '/Orders.php');
|
||||
include( __DIR__ . '/Products.php');
|
||||
include( __DIR__ . '/Sections.php');
|
||||
include( __DIR__ . '/admin/route.php');
|
||||
|
||||
include( __DIR__ . '/Admin/route.php');
|
||||
});
|
||||
|
||||
@@ -17,8 +17,8 @@ Route::get('', 'Shop\HomeController@index')->name('welcome');
|
||||
Route::get('home', 'Shop\HomeController@index')->name('home');
|
||||
|
||||
// include( __DIR__ . '/boilerplate/route.php');
|
||||
// include( __DIR__ . '/admin/route.php');
|
||||
include( __DIR__ . '/shop/route.php');
|
||||
include( __DIR__ . '/Admin/route.php');
|
||||
include( __DIR__ . '/Shop/route.php');
|
||||
|
||||
|
||||
Route::get('cache', 'JS\CacheController@getCacheVersions')->name('cacheVersions');
|
||||
|
||||
Reference in New Issue
Block a user