Add new version in repository
This commit is contained in:
@@ -19,7 +19,7 @@ class Kernel extends ConsoleKernel
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
@@ -37,6 +37,6 @@ class Kernel extends ConsoleKernel
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
|
||||
require base_path('routes/console.php');
|
||||
include base_path('routes/console.php');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,25 +8,24 @@ use App\Models\Botanic\Family;
|
||||
|
||||
class FamiliesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'families';
|
||||
public $model_name = 'families';
|
||||
|
||||
public function query(Family $model)
|
||||
{
|
||||
$model = $model::withCount(['genres','species','varieties']);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('alias'),
|
||||
Column::make('latin'),
|
||||
Column::make('genres_count')->title('Nb genres')->searchable(false)->addClass('text-right'),
|
||||
Column::make('species_count')->title('Nb espèces')->searchable(false)->addClass('text-right'),
|
||||
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(Family $model)
|
||||
{
|
||||
$model = $model::withCount(['genres','species','varieties']);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('alias'),
|
||||
Column::make('latin'),
|
||||
Column::make('genres_count')->title('Nb genres')->searchable(false)->addClass('text-right'),
|
||||
Column::make('species_count')->title('Nb espèces')->searchable(false)->addClass('text-right'),
|
||||
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,11 +19,12 @@ class GenresDataTable extends DataTable
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn('family_name', function(Genre $genre) {
|
||||
return $genre->family ? $genre->family->name : '';
|
||||
})
|
||||
->rawColumns(['genre_name', 'action'])
|
||||
;
|
||||
->editColumn(
|
||||
'family_name', function (Genre $genre) {
|
||||
return $genre->family ? $genre->family->name : '';
|
||||
}
|
||||
)
|
||||
->rawColumns(['genre_name', 'action']);
|
||||
return Parent::modifier($datatables);
|
||||
}
|
||||
|
||||
@@ -39,5 +40,4 @@ class GenresDataTable extends DataTable
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,36 +8,36 @@ use App\Models\Botanic\Specie;
|
||||
|
||||
class SpeciesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'species';
|
||||
public $model_name = 'species';
|
||||
|
||||
public function query(Specie $model)
|
||||
{
|
||||
$model = $model::withCount('varieties')->with('genre');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
public function query(Specie $model)
|
||||
{
|
||||
$model = $model::withCount('varieties')->with('genre');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn('genre_name', function(Specie $specie) {
|
||||
return $specie->genre ? $specie->genre->name : '';
|
||||
})
|
||||
->rawColumns(['genre_name', 'action'])
|
||||
;
|
||||
return Parent::modifier($datatables);
|
||||
}
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn(
|
||||
'genre_name', function (Specie $specie) {
|
||||
return $specie->genre ? $specie->genre->name : '';
|
||||
}
|
||||
)
|
||||
->rawColumns(['genre_name', 'action']);
|
||||
return Parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('alias'),
|
||||
Column::make('genre.name')->data('genre_name')->title('Genre'),
|
||||
Column::make('latin'),
|
||||
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('alias'),
|
||||
Column::make('genre.name')->data('genre_name')->title('Genre'),
|
||||
Column::make('latin'),
|
||||
Column::make('varieties_count')->title('Nb variétés')->searchable(false)->addClass('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,39 +8,40 @@ use App\Models\Botanic\Variety;
|
||||
|
||||
class VarietiesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'varieties';
|
||||
public $model_name = 'varieties';
|
||||
|
||||
public function query(Variety $model)
|
||||
{
|
||||
// $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*');
|
||||
$model = $model::joinRelations('Specie')->select('botanic_varieties.*','botanic_species.name as specie_name')->with('Specie')->withCount('Articles');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
public function query(Variety $model)
|
||||
{
|
||||
// $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*');
|
||||
$model = $model::joinRelations('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with('Specie')->withCount('Articles');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn('photo', function(Variety $variety) {
|
||||
$media = $variety->getFirstMedia();
|
||||
dump($variety);
|
||||
return "{{ $media('thumb') }}";
|
||||
})
|
||||
->rawColumns(['photo', 'action'])
|
||||
;
|
||||
return Parent::modifier($datatables);
|
||||
}
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
->editColumn(
|
||||
'photo', function (Variety $variety) {
|
||||
$media = $variety->getFirstMedia();
|
||||
// dump($media);
|
||||
// return $media('thumb');
|
||||
return '';
|
||||
}
|
||||
)
|
||||
->rawColumns(['photo', 'action']);
|
||||
return Parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('Specie.name')->data('specie_name')->title('Espèce'),
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('articles_count')->title('Nb articles')->class('text-right')->searchable(false),
|
||||
Column::make('photo')->title('')->searchable(false)->orderable(false),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('Specie.name')->data('specie_name')->title('Espèce'),
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('articles_count')->title('Nb articles')->class('text-right')->searchable(false),
|
||||
Column::make('photo')->title('')->searchable(false)->orderable(false),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,195 +10,200 @@ use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class ParentDataTable extends DataTable
|
||||
{
|
||||
public $rowReorder = true;
|
||||
public $rowReorderSelector; // ['selector' => 'tr']
|
||||
public $colReorder = false;
|
||||
public $fixedColumns = false;
|
||||
public $scrollX = false;
|
||||
public $scrollCollapse = true;
|
||||
public $sortedColumn = 0;
|
||||
public $sortedOrder = 'asc';
|
||||
public $stateSave = false;
|
||||
public $rowReorder = true;
|
||||
public $rowReorderSelector; // ['selector' => 'tr']
|
||||
public $colReorder = false;
|
||||
public $fixedColumns = false;
|
||||
public $scrollX = false;
|
||||
public $scrollCollapse = true;
|
||||
public $sortedColumn = 0;
|
||||
public $sortedOrder = 'asc';
|
||||
public $stateSave = false;
|
||||
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
return $this->modifier(datatables()->eloquent($query));
|
||||
}
|
||||
/**
|
||||
* Build DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function dataTable($query)
|
||||
{
|
||||
return $this->modifier(datatables()->eloquent($query));
|
||||
}
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
return $this->addButtons($datatables->setRowId('{{$id}}'));
|
||||
}
|
||||
public function modifier($datatables)
|
||||
{
|
||||
return $this->addButtons($datatables->setRowId('{{$id}}'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add buttons DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function addButtons($datatables)
|
||||
{
|
||||
return $datatables->addColumn('action', $this->getHtmlButtons());
|
||||
}
|
||||
/**
|
||||
* Add buttons DataTable class.
|
||||
*
|
||||
* @param mixed $query Results from query() method.
|
||||
* @return \Yajra\DataTables\DataTableAbstract
|
||||
*/
|
||||
public function addButtons($datatables)
|
||||
{
|
||||
return $datatables->addColumn('action', $this->getHtmlButtons());
|
||||
}
|
||||
|
||||
public function getHtmlButtons()
|
||||
{
|
||||
$buttons = '';
|
||||
public function getHtmlButtons()
|
||||
{
|
||||
$buttons = '';
|
||||
|
||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-leaf-alt"></i></button>';
|
||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
||||
return $buttons;
|
||||
// return view('components.datatables.buttons.row_action');
|
||||
}
|
||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-secondary btn-show mr-2"><i class="fa fa-fw fa-eye"></i></button>';
|
||||
// $buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-leaf-alt"></i></button>';
|
||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-primary btn-edit mr-2"><i class="fa fa-fw fa-pencil-alt"></i></button>';
|
||||
$buttons .= '<button type="button" data-id="{{$id}}" class="btn btn-xs btn-danger btn-del"><i class="fa fa-fw fa-trash"></i></button>';
|
||||
return $buttons;
|
||||
// return view('components.datatables.buttons.row_action');
|
||||
}
|
||||
|
||||
public function makeColumnButtons()
|
||||
{
|
||||
return Column::computed('action')
|
||||
->title('')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->searchable(false)
|
||||
->width("74")
|
||||
->addClass('text-center text-nowrap');
|
||||
}
|
||||
public function makeColumnButtons()
|
||||
{
|
||||
return Column::computed('action')
|
||||
->title('')
|
||||
->exportable(false)
|
||||
->printable(false)
|
||||
->searchable(false)
|
||||
->width("74")
|
||||
->addClass('text-center text-nowrap');
|
||||
}
|
||||
|
||||
public static function isFilteredByField($field)
|
||||
{
|
||||
return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false);
|
||||
}
|
||||
public static function isFilteredByField($field)
|
||||
{
|
||||
return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Family $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function buildQuery($model)
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->buildHtml(strtolower($this->model_name) . '-table');
|
||||
}
|
||||
/**
|
||||
* Get query source of dataTable.
|
||||
*
|
||||
* @param \App\Family $model
|
||||
* @return \Illuminate\Database\Eloquent\Builder
|
||||
*/
|
||||
public function buildQuery($model)
|
||||
{
|
||||
return $model->newQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->buildHtml(strtolower($this->model_name) . '-table');
|
||||
}
|
||||
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function buildHtml($table_id = false, $selector = false)
|
||||
{
|
||||
$table_id = $table_id ? $table_id : strtolower($this->model_name) . '-table';
|
||||
$selector = $selector ? $selector : '#' . $this->model_name . '-filters';
|
||||
return $this->builder()
|
||||
->setTableId($table_id)
|
||||
->parameters($this->getParameters())
|
||||
->columns($this->getColumns())
|
||||
->ajax([
|
||||
'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }',
|
||||
'url' => isset($this->url) ? $this->url : ''
|
||||
])
|
||||
->dom($this->getDom())
|
||||
->orderBy($this->sortedColumn,$this->sortedOrder)
|
||||
->buttons($this->getButtons());
|
||||
}
|
||||
/**
|
||||
* Optional method if you want to use html builder.
|
||||
*
|
||||
* @return \Yajra\DataTables\Html\Builder
|
||||
*/
|
||||
public function buildHtml($table_id = false, $selector = false)
|
||||
{
|
||||
$table_id = $table_id ? $table_id : strtolower($this->model_name) . '-table';
|
||||
$selector = $selector ? $selector : '#' . $this->model_name . '-filters';
|
||||
return $this->builder()
|
||||
->setTableId($table_id)
|
||||
->parameters($this->getParameters())
|
||||
->columns($this->getColumns())
|
||||
->ajax(
|
||||
[
|
||||
'data' => 'function(d) { d.filters = $("' . $selector . '").serializeJSON(); }',
|
||||
'url' => isset($this->url) ? $this->url : ''
|
||||
]
|
||||
)
|
||||
->dom($this->getDom())
|
||||
->orderBy($this->sortedColumn, $this->sortedOrder)
|
||||
->buttons($this->getButtons());
|
||||
}
|
||||
|
||||
public function getButtons() {
|
||||
return [
|
||||
Button::make('export'),
|
||||
Button::make('print'),
|
||||
Button::make('colvis'),
|
||||
Button::make('columnsToggle')
|
||||
];
|
||||
}
|
||||
public function getButtons()
|
||||
{
|
||||
return [
|
||||
Button::make('export'),
|
||||
Button::make('print'),
|
||||
Button::make('colvis'),
|
||||
Button::make('columnsToggle')
|
||||
];
|
||||
}
|
||||
|
||||
public function getParameters()
|
||||
{
|
||||
$data = [
|
||||
'pageLength' => 5,
|
||||
'scrollX' => $this->scrollX,
|
||||
'scrollCollapse' => $this->scrollCollapse,
|
||||
'searchDelay' => 500,
|
||||
'colReorder' => $this->colReorder,
|
||||
'fixedColumns' => $this->fixedColumns,
|
||||
// 'autoWidth' => false,
|
||||
'stateSave' => $this->stateSave
|
||||
];
|
||||
if ($this->rowReorder) {
|
||||
$data['rowReorder'] = ['selector' => $this->rowReorderSelector];
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function getParameters()
|
||||
{
|
||||
$data = [
|
||||
'pageLength' => 5,
|
||||
'scrollX' => $this->scrollX,
|
||||
'scrollCollapse' => $this->scrollCollapse,
|
||||
'searchDelay' => 500,
|
||||
'colReorder' => $this->colReorder,
|
||||
'fixedColumns' => $this->fixedColumns,
|
||||
// 'autoWidth' => false,
|
||||
'stateSave' => $this->stateSave
|
||||
];
|
||||
if ($this->rowReorder) {
|
||||
$data['rowReorder'] = ['selector' => $this->rowReorderSelector];
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function getDom()
|
||||
{
|
||||
$dom = '';
|
||||
// $dom .= $this->getDatatablesHeaderDefault();
|
||||
$dom .= "rt";
|
||||
$dom .= $this->getDatatablesFooterDefault();
|
||||
return $dom;
|
||||
}
|
||||
public function getDom()
|
||||
{
|
||||
$dom = '';
|
||||
// $dom .= $this->getDatatablesHeaderDefault();
|
||||
$dom .= "rt";
|
||||
$dom .= $this->getDatatablesFooterDefault();
|
||||
return $dom;
|
||||
}
|
||||
|
||||
public function getDatatablesHeader() {
|
||||
return view('components.datatables.header');
|
||||
}
|
||||
public function getDatatablesHeader()
|
||||
{
|
||||
return view('components.datatables.header');
|
||||
}
|
||||
|
||||
public function getDatatablesHeaderDefault() {
|
||||
// return "<div class'row'><div class='col'></div></div>";
|
||||
/*
|
||||
|
||||
$dom = 't<"row datatable-pager light"<"col-md-12"'
|
||||
. '<"datatable-more-export-buttons filter-buttons pull-left">'
|
||||
. '<"datatable-more-export-favorites-buttons filter-buttons pull-left">'
|
||||
. '<"datatable-more-export-basket-buttons filter-buttons pull-left">'
|
||||
. '<"datatable-download-buttons filter-buttons pull-left">'
|
||||
. '>>'
|
||||
. '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>';
|
||||
public function getDatatablesHeaderDefault()
|
||||
{
|
||||
// return "<div class'row'><div class='col'></div></div>";
|
||||
/*
|
||||
|
||||
*/
|
||||
|
||||
$dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
||||
return $dom;
|
||||
// return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>';
|
||||
$dom = 't<"row datatable-pager light"<"col-md-12"'
|
||||
. '<"datatable-more-export-buttons filter-buttons pull-left">'
|
||||
. '<"datatable-more-export-favorites-buttons filter-buttons pull-left">'
|
||||
. '<"datatable-more-export-basket-buttons filter-buttons pull-left">'
|
||||
. '<"datatable-download-buttons filter-buttons pull-left">'
|
||||
. '>>'
|
||||
. '<"dt-toolbar-footer"<"col"i><"col pull-right datatable-pager light nopadding-right"p>>';
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
$dom = "<'row dt-toolbar-header'<'col-lg-4'l><'col-lg-4'B><'col-lg-4 text-right add'f>>";
|
||||
return $dom;
|
||||
// return 't<"row datatable-pager light"<"col-md-12"<"datatable-more-export-buttons filter-buttons pull-left"><"datatable-more-export-favorites-buttons filter-buttons pull-left"><"datatable-more-export-basket-buttons filter-buttons pull-left"><"datatable-download-buttons filter-buttons pull-left">>><"dt-toolbar-footer"<"col-md-6"i><"col-md-6 pull-right datatable-pager light nopadding-right"p>>';
|
||||
}
|
||||
|
||||
public function getDatatablesFooterDefault() {
|
||||
return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>";
|
||||
}
|
||||
public function getDatatablesFooterDefault()
|
||||
{
|
||||
return "<'row pt-3 dt-toolbar-footer'<'col-md-6'i><'col-md-6'p>>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function filename()
|
||||
{
|
||||
return self::buildFilename($this->model_name);
|
||||
}
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function filename()
|
||||
{
|
||||
return self::buildFilename($this->model_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildFilename($name)
|
||||
{
|
||||
return $name . '_' . date('YmdHis');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get filename for export.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function buildFilename($name)
|
||||
{
|
||||
return $name . '_' . date('YmdHis');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\ArticleFamily;
|
||||
|
||||
class ArticleFamiliesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'article_families';
|
||||
|
||||
public function query(ArticleFamily $model)
|
||||
{
|
||||
$model = $model::withCount('Articles');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('articles_count')->title('Nb articles')->addClass('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
27
app/Datatables/Shop/ArticleNaturesDataTable.php
Normal file
27
app/Datatables/Shop/ArticleNaturesDataTable.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\ArticleNature;
|
||||
|
||||
class ArticleNaturesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'article_natures';
|
||||
|
||||
public function query(ArticleNature $model)
|
||||
{
|
||||
$model = $model::withCount('Articles');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('articles_count')->title('Nb articles')->addClass('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -8,24 +8,22 @@ use App\Models\Shop\Article;
|
||||
|
||||
class ArticlesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'articles';
|
||||
public $model_name = 'articles';
|
||||
|
||||
public function query(Article $model)
|
||||
{
|
||||
// $model = $model::with('Family')->select('shop_articles.*','family.name as family_name')->join('shop_article_families as family', 'family.id', '=', 'shop_articles.article_family_id')->groupBy('shop_articles.id');
|
||||
$model = $model::with('article_family')->select('shop_articles.*');
|
||||
// $model = $model::joinRelations('Family')->select('shop_articles.*','shop_article_families.name as family_name');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('article_family.name')->title('Famille')->orderable(false),
|
||||
Column::make('name')->title('Nom'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
|
||||
}
|
||||
public function query(Article $model)
|
||||
{
|
||||
// $model = $model::with('Family')->select('shop_articles.*','family.name as family_name')->join('shop_article_families as family', 'family.id', '=', 'shop_articles.article_family_id')->groupBy('shop_articles.id');
|
||||
$model = $model::with('article_nature')->select('shop_articles.*');
|
||||
// $model = $model::joinRelations('Family')->select('shop_articles.*','shop_article_families.name as family_name');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('article_nature.name')->title('Nature')->orderable(false),
|
||||
Column::make('name')->title('Nom'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,21 +8,20 @@ use App\Models\Shop\Category;
|
||||
|
||||
class CategoriesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'categories';
|
||||
public $model_name = 'categories';
|
||||
|
||||
public function query(Category $model)
|
||||
{
|
||||
$model = $model::withCount('articles');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('articles_count')->title('Nb Articles')->class('text-right')->searchable(false),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(Category $model)
|
||||
{
|
||||
$model = $model::withCount('articles');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('articles_count')->title('Nb Articles')->class('text-right')->searchable(false),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,22 +8,21 @@ use App\Models\Shop\Customer;
|
||||
|
||||
class CustomersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'customers';
|
||||
public $model_name = 'customers';
|
||||
|
||||
public function query(Customer $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('address')->title('Adresse'),
|
||||
Column::make('zipcode')->title('Code postal'),
|
||||
Column::make('city')->title('Ville'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(Customer $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('address')->title('Adresse'),
|
||||
Column::make('zipcode')->title('Code postal'),
|
||||
Column::make('city')->title('Ville'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,21 +8,20 @@ use App\Models\Shop\Invoice;
|
||||
|
||||
class InvoicesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'Invoices';
|
||||
public $model_name = 'Invoices';
|
||||
|
||||
public function query(Invoice $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('status.name'),
|
||||
Column::make('customer.name'),
|
||||
Column::make('total'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(Invoice $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('status.name'),
|
||||
Column::make('customer.name'),
|
||||
Column::make('total'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
28
app/Datatables/Shop/OffersDataTable.php
Normal file
28
app/Datatables/Shop/OffersDataTable.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Offer;
|
||||
|
||||
class OffersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tariffs';
|
||||
|
||||
public function query(Offer $model)
|
||||
{
|
||||
$model = $model->with(['article','variation','tariff'])->select(['shop_offers.*']);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('article.name')->title('Article'),
|
||||
Column::make('variation.name')->title('Déclinaison'),
|
||||
Column::make('tariff.name')->title('Tarif'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -8,19 +8,18 @@ use App\Models\Shop\Order;
|
||||
|
||||
class OrdersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'orders';
|
||||
public $model_name = 'orders';
|
||||
|
||||
public function query(Product $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(Product $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,28 +8,18 @@ use App\Models\Shop\Package;
|
||||
|
||||
class PackagesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'packages';
|
||||
public $model_name = 'packages';
|
||||
|
||||
public function query(Package $model)
|
||||
{
|
||||
$model = $model::with(['article_family'])->select('shop_packages.*');
|
||||
$model = self::filterByFamily($model);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
public static function filterByFamily($model, $family_id = false)
|
||||
{
|
||||
$family_id = $family_id ? $family_id : self::isFilteredByField('family_id');
|
||||
return $family_id ? $model->byArticleFamily($family_id) : $model;
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('article_family.name')->title('Famille d\'articles'),
|
||||
Column::make('value')->title('Valeur'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(Package $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('value')->title('Valeur'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,21 +8,20 @@ use App\Models\Shop\PriceGenericCategory;
|
||||
|
||||
class PriceGenericCategoriesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'price_generic_categories';
|
||||
public $model_name = 'price_generic_categories';
|
||||
|
||||
public function query(PriceGenericCategory $model)
|
||||
{
|
||||
$model = $model->withCount('price_generics');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('price_generics_count')->title('Nb Tarifs')->class('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(PriceGenericCategory $model)
|
||||
{
|
||||
$model = $model->withCount('price_generics');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('price_generics_count')->title('Nb Tarifs')->class('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\PriceGeneric;
|
||||
|
||||
class PriceGenericsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'price_generics';
|
||||
|
||||
public function query(PriceGeneric $model)
|
||||
{
|
||||
$model = $model::with(['category','priceByUnit'])->withCount('prices');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('category.name')->title('Catégorie'),
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('price_by_unit.price')->title('Prix HT')->class('text-right'),
|
||||
Column::make('price_by_unit.price_taxed')->title('Prix TTC')->class('text-right'),
|
||||
Column::make('prices_count')->title('Nb tarifs')->class('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
38
app/Datatables/Shop/PriceListsDataTable.php
Normal file
38
app/Datatables/Shop/PriceListsDataTable.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\PriceList;
|
||||
|
||||
class PriceListsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'price_lists';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->url = route('Admin.Shop.PriceLists.index');
|
||||
}
|
||||
|
||||
public function query(PriceList $model)
|
||||
{
|
||||
$model = self::filterByTariff($model);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
public static function filterByTariff($model, $tariff_id = false)
|
||||
{
|
||||
$tariff_id = $tariff_id ? $tariff_id : self::isFilteredByField('tariff_id');
|
||||
return $tariff_id ? $model->byTariff($tariff_id) : $model;
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
25
app/Datatables/Shop/SaleChannelsDataTable.php
Normal file
25
app/Datatables/Shop/SaleChannelsDataTable.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\SaleChannel;
|
||||
|
||||
class SaleChannelsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'sale_channels';
|
||||
|
||||
public function query(SaleChannel $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -8,21 +8,20 @@ use App\Models\Shop\TagGroup;
|
||||
|
||||
class TagGroupsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tag_groups';
|
||||
public $model_name = 'tag_groups';
|
||||
|
||||
public function query(TagGroup $model)
|
||||
{
|
||||
$model = $model::withCount('tags');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name'),
|
||||
Column::make('tags_count')->title('Nb de tags')->searchable(false)->addClass('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(TagGroup $model)
|
||||
{
|
||||
$model = $model::withCount('tags');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name'),
|
||||
Column::make('tags_count')->title('Nb de tags')->searchable(false)->addClass('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,23 +8,22 @@ use App\Models\Shop\Tag;
|
||||
|
||||
class TagsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tags';
|
||||
public $rowReorder = ['selector' => 'tr'];
|
||||
public $model_name = 'tags';
|
||||
public $rowReorder = ['selector' => 'tr'];
|
||||
|
||||
public function query(Tag $model)
|
||||
{
|
||||
$model = $model::with('group')->select(['tags.*']);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('group.name')->title('Groupe'),
|
||||
Column::make('sort_order')->title('Ordre'),
|
||||
Column::make('name')->title('Nom'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(Tag $model)
|
||||
{
|
||||
$model = $model::with('group')->select(['tags.*']);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('group.name')->title('Groupe'),
|
||||
Column::make('sort_order')->title('Ordre'),
|
||||
Column::make('name')->title('Nom'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
29
app/Datatables/Shop/TariffsDataTable.php
Normal file
29
app/Datatables/Shop/TariffsDataTable.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Tariff;
|
||||
|
||||
class TariffsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tariffs';
|
||||
|
||||
public function query(Tariff $model)
|
||||
{
|
||||
$model = $model->with(['sale_channel'])->select(['shop_tariffs.*']);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('sale_channel.name')->title('Canal de vente'),
|
||||
Column::make('code')->title('Code'),
|
||||
Column::make('ref')->title('Référence'),
|
||||
Column::make('name')->title('Nom'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -8,29 +8,18 @@ use App\Models\Shop\Unity;
|
||||
|
||||
class UnitiesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'unities';
|
||||
public $model_name = 'unities';
|
||||
|
||||
public function query(Unity $model)
|
||||
{
|
||||
$model = $model::with(['package.article_family'])->select('shop_unities.*');
|
||||
$model = self::filterByFamily($model);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
public static function filterByFamily($model, $family_id = false)
|
||||
{
|
||||
$family_id = $family_id ? $family_id : self::isFilteredByField('family_id');
|
||||
return $family_id ? $model->byArticleFamily($family_id) : $model;
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('package.article_family.name')->title('Famille'),
|
||||
Column::make('package.value')->title('Package'),
|
||||
Column::make('value')->title('Valeur'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
public function query(Unity $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('value')->title('Valeur'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
28
app/Datatables/Shop/VariationsDataTable.php
Normal file
28
app/Datatables/Shop/VariationsDataTable.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Variation;
|
||||
|
||||
class VariationsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'variations';
|
||||
|
||||
public function query(Variation $model)
|
||||
{
|
||||
$model = $model->with(['package','unity']);
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('package.value')->title('Package'),
|
||||
Column::make('quantity')->title('Quantité')->class('text-right'),
|
||||
Column::make('unity.value')->title('Unité'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ class Handler extends ExceptionHandler
|
||||
/**
|
||||
* Report or log an exception.
|
||||
*
|
||||
* @param \Exception $exception
|
||||
* @param \Exception $exception
|
||||
* @return void
|
||||
*
|
||||
* @throws \Exception
|
||||
@@ -42,8 +42,8 @@ class Handler extends ExceptionHandler
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $exception
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $exception
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*
|
||||
* @throws \Exception
|
||||
|
||||
@@ -12,9 +12,8 @@ class FamiliesExport implements FromQuery
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
public function query()
|
||||
public function query()
|
||||
{
|
||||
return Family::query();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,8 @@ class GenresExport implements FromQuery
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
public function query()
|
||||
public function query()
|
||||
{
|
||||
return Genre::query();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,8 @@ class SpeciesExport implements FromQuery
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
public function query()
|
||||
public function query()
|
||||
{
|
||||
return Specie::query();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,8 @@ class VarietiesExport implements FromQuery
|
||||
{
|
||||
use Exportable;
|
||||
|
||||
public function query()
|
||||
public function query()
|
||||
{
|
||||
return Variety::query();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
13
app/Http/Controllers/Admin/Botanic/Controller.php
Normal file
13
app/Http/Controllers/Admin/Botanic/Controller.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Botanic;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
||||
55
app/Http/Controllers/Admin/Botanic/FamilyController.php
Normal file
55
app/Http/Controllers/Admin/Botanic/FamilyController.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Botanic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Botanic\Families;
|
||||
use App\Datatables\Botanic\FamiliesDataTable;
|
||||
|
||||
class FamilyController extends Controller
|
||||
{
|
||||
public function index(FamiliesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Botanic.Families.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Families::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Botanic.Families.create', $data ?? []);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Families::store($data);
|
||||
return redirect()->route('Admin.Botanic.Families.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Families::get($id);
|
||||
return view('Admin.Botanic.Families.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['family'] = Families::get($id)->toArray();
|
||||
return view('Admin.Botanic.Families.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Families::destroy($id);
|
||||
}
|
||||
|
||||
public function exportExcel()
|
||||
{
|
||||
return Families::exportExcel();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Botanic\Admin;
|
||||
namespace App\Http\Controllers\Admin\Botanic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Botanic\Genres;
|
||||
use App\Repositories\Botanic\Families;
|
||||
@@ -13,7 +12,7 @@ class GenreController extends Controller
|
||||
{
|
||||
public function index(GenresDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Botanic.Admin.Genres.list');
|
||||
return $dataTable->render('Admin.Botanic.Genres.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
@@ -23,26 +22,27 @@ class GenreController extends Controller
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Botanic.Admin.Genres.create');
|
||||
$data['families'] = Families::getOptions();
|
||||
return view('Admin.Botanic.Genres.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Genres::store($request);
|
||||
return redirect()->route('Botanic.Admin.Genres.index');
|
||||
return redirect()->route('Admin.Botanic.Genres.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Genres::get($id);
|
||||
return view('Botanic.Admin.Genres.view', $data);
|
||||
$data['genre'] = Genres::get($id);
|
||||
return view('Admin.Botanic.Genres.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Genres::get($id);
|
||||
$data['genre'] = Genres::get($id);
|
||||
$data['families'] = Families::getOptions();
|
||||
return view('Botanic.Admin.Genres.edit', $data);
|
||||
return view('Admin.Botanic.Genres.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
@@ -50,9 +50,8 @@ class GenreController extends Controller
|
||||
return Genres::destroy($id);
|
||||
}
|
||||
|
||||
public function exportExcel()
|
||||
public function exportExcel()
|
||||
{
|
||||
return Genres::exportExcel();
|
||||
}
|
||||
|
||||
}
|
||||
63
app/Http/Controllers/Admin/Botanic/SpecieController.php
Normal file
63
app/Http/Controllers/Admin/Botanic/SpecieController.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Botanic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Genres;
|
||||
use App\Datatables\Botanic\SpeciesDataTable;
|
||||
|
||||
class SpecieController extends Controller
|
||||
{
|
||||
public function index(SpeciesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Botanic.Species.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Species::getDatatable($request->all());
|
||||
}
|
||||
|
||||
public function getOptions()
|
||||
{
|
||||
return response()->json(Species::getOptions());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['genres'] = Genres::getOptions();
|
||||
return view('Admin.Botanic.Species.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Species::store($data);
|
||||
return redirect()->route('Admin.Botanic.Species.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
return view('Admin.Botanic.Species.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['specie'] = Species::get($id);
|
||||
$data['genres'] = Genres::getOptions();
|
||||
return view('Admin.Botanic.Species.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Species::destroy($id);
|
||||
}
|
||||
|
||||
public function exportExcel()
|
||||
{
|
||||
return Species::exportExcel();
|
||||
}
|
||||
}
|
||||
77
app/Http/Controllers/Admin/Botanic/VarietyController.php
Normal file
77
app/Http/Controllers/Admin/Botanic/VarietyController.php
Normal file
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Botanic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Datatables\Botanic\VarietiesDataTable;
|
||||
|
||||
use App\Models\Shop\Variety;
|
||||
|
||||
class VarietyController extends Controller
|
||||
{
|
||||
public function index(VarietiesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Botanic.Varieties.list');
|
||||
}
|
||||
|
||||
public function getOptionsWithSpecie()
|
||||
{
|
||||
return response()->json(Varieties::getOptionsWithSpecie());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['species'] = Species::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
return view('Admin.Botanic.Varieties.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
Varieties::storeFull($data);
|
||||
return redirect()->route('Admin.Botanic.Varieties.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
return view('Admin.Botanic.Varieties.view', Varieties::get($id));
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Varieties::getFull($id);
|
||||
$data['species'] = Species::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
return view('Admin.Botanic.Varieties.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Varieties::destroy($id);
|
||||
}
|
||||
|
||||
public function getImages(Request $request, $id = false, $can_edit = true)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Varieties::getImages($id);
|
||||
$data['can_edit'] = $can_edit;
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
public function deleteImage(Request $request)
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
return Varieties::deleteImage($id, $index);
|
||||
}
|
||||
|
||||
public function exportExcel()
|
||||
{
|
||||
return Varieties::exportExcel();
|
||||
}
|
||||
}
|
||||
9
app/Http/Controllers/Admin/Controller.php
Normal file
9
app/Http/Controllers/Admin/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use App\Http\Controllers\Controller as ParentController;
|
||||
|
||||
class Controller extends ParentController
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\App;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
use Yajra\DataTables\DataTables;
|
||||
|
||||
use App\Repositories\Core\App\Applications;
|
||||
use App\Datatables\Admin\Core\App\ApplicationsDataTable;
|
||||
|
||||
class ApplicationController extends Controller
|
||||
{
|
||||
public function index(ApplicationsDataTable $dataTable)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
return $dataTable->render('admin.Core.App.Application.index', $data);
|
||||
}
|
||||
|
||||
public function getDatatable()
|
||||
{
|
||||
return Applications::getDatatable();
|
||||
}
|
||||
|
||||
public function edit(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data = Applications::select_by_id($id);
|
||||
return view('admin.Core.App.Application.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
Applications::store($request->all());
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
Applications::destroy($id);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = Applications::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\App;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
use App\Repositories\Core\App\Applications;
|
||||
use App\Repositories\Core\App\ApplicationModules;
|
||||
use App\Datatables\Admin\Core\App\ApplicationModulesDataTable;
|
||||
|
||||
class ApplicationModuleController extends Controller
|
||||
{
|
||||
public function index(ApplicationModulesDataTable $dataTable)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
return $dataTable->render('admin.Core.App.ApplicationModule.index', $data);
|
||||
}
|
||||
|
||||
public function getDatatable()
|
||||
{
|
||||
return ApplicationModules::getDatatable();
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['applications'] = Applications::getOptions();
|
||||
return view('admin.Core.App.ApplicationModule.create', $data);
|
||||
}
|
||||
|
||||
public function edit(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data = ApplicationModules::get($id)->toArray();
|
||||
$data['applications'] = Applications::getOptions();
|
||||
return view('admin.Core.App.ApplicationModule.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
ApplicationModules::store($request->all());
|
||||
return redirect()->route('admin.Core.App.ApplicationModule.index')
|
||||
->with('growl', [__('admin.successadd'), 'success']);
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
ApplicationModules::destroy($id);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = ApplicationModules::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
9
app/Http/Controllers/Admin/Core/App/Controller.php
Normal file
9
app/Http/Controllers/Admin/Core/App/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\App;
|
||||
|
||||
use App\Http\Controllers\Controller as ParentController;
|
||||
|
||||
class Controller extends ParentController
|
||||
{
|
||||
}
|
||||
9
app/Http/Controllers/Admin/Core/Auth/Controller.php
Normal file
9
app/Http/Controllers/Admin/Core/Auth/Controller.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller as ParentController;
|
||||
|
||||
class Controller extends ParentController
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Core\App\Applications;
|
||||
use App\Repositories\Core\App\ApplicationModules;
|
||||
use App\Repositories\Core\Auth\Permissions;
|
||||
use App\Repositories\Core\Auth\Users;
|
||||
|
||||
use App\Datatables\Admin\Core\Auth\PermissionsDataTable;
|
||||
|
||||
class PermissionController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('ability:admin,permissions_crud');
|
||||
}
|
||||
|
||||
public function index(PermissionsDataTable $dataTable)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
return $dataTable->render('admin.Core.Auth.Permission.index', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
$data['applications'] = Applications::getOptions();
|
||||
$data['application_modules'] = ApplicationModules::getOptions();
|
||||
return view('admin.Core.Auth.Permission.create', $data);
|
||||
}
|
||||
|
||||
public function edit(Request $request, $id = false)
|
||||
{
|
||||
$id = (int) $id ? $id : $request->input('id');
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['permission'] = Permissions::get($id);
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
$data['applications'] = Applications::getOptions();
|
||||
$data['application_modules'] = ApplicationModules::getOptions();
|
||||
return view('admin.Core.Auth.Permission.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
unset($data['roles']);
|
||||
unset($data['_token']);
|
||||
|
||||
/*
|
||||
$this->validate($request, [
|
||||
'name' => 'required|unique:permissions,name',
|
||||
'display_name' => 'required',
|
||||
'description' => 'required',
|
||||
]);
|
||||
$data['name'] = Str::slug($data['display_name']);
|
||||
*/
|
||||
|
||||
Permissions::store($data);
|
||||
return redirect()->route('Admin.Core.Auth.Permission.index')->with('growl', [__('permissions.successadd'), 'success']);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
Permissions::destroy($id);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
96
app/Http/Controllers/Admin/Core/Auth/RoleController.php
Normal file
96
app/Http/Controllers/Admin/Core/Auth/RoleController.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Yajra\DataTables\DataTables;
|
||||
|
||||
use App\Models\Core\Auth\Role;
|
||||
use App\Models\Core\Auth\Permission;
|
||||
use App\Models\Core\App\ApplicationModule;
|
||||
|
||||
use App\Repositories\Core\Auth\Permissions;
|
||||
use App\Repositories\Core\Auth\Roles;
|
||||
use App\Datatables\Admin\Core\Auth\RolesDataTable;
|
||||
|
||||
class RoleController extends Controller
|
||||
{
|
||||
public function index(RolesDataTable $dataTable)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['modules'] = ApplicationModule::with('permissions')->get()->toArray();
|
||||
return $dataTable->render('admin.Core.Auth.Role.index', $data);
|
||||
}
|
||||
|
||||
public function getTable(Request $request)
|
||||
{
|
||||
$model = Role::orderBy('name')->get();
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
return view('admin.Core.Auth.Role.create', $data);
|
||||
}
|
||||
|
||||
public function edit(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['role'] = Roles::getWithPermissions($id);
|
||||
$data['modules'] = ApplicationModule::with('permissions')->get()->toArray();
|
||||
|
||||
return view('admin.Core.Auth.Role.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
Roles::store($request->all());
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
Roles::destroy($id);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function manage(Request $request, $id = false)
|
||||
{
|
||||
$data = [];
|
||||
$id = (int) $id ? $id : $request->input('id');
|
||||
$data['role'] = Role::with('permissions')->find($id)->toArray();
|
||||
$permissions = Permission::orderBy('app')->orderBy('module')->orderBy('action')->get();
|
||||
foreach ($permissions as $permission) {
|
||||
$data[$permission->app][$permission->module][] = [
|
||||
'action' => $permission->action,
|
||||
'description' => $permission->description,
|
||||
'id' => $permission->id,
|
||||
];
|
||||
}
|
||||
// Debug::fdump($data);
|
||||
// Debug::fdump($permissions);
|
||||
// exit;
|
||||
$data['permissions'] = $data;
|
||||
return view('admin.Core.Auth.Role.manage', $data);
|
||||
}
|
||||
|
||||
public function manage_store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$role = Role::find($data['role_id']);
|
||||
foreach ($data['permissions'] as $key) {
|
||||
$permission = Permission::find($key);
|
||||
$role->attachPermission($permission);
|
||||
}
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = Roles::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
75
app/Http/Controllers/Admin/Core/Auth/TeamController.php
Normal file
75
app/Http/Controllers/Admin/Core/Auth/TeamController.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\Core\Auth\Team;
|
||||
use App\Models\Core\Auth\Role;
|
||||
|
||||
class TeamController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('ability:admin,teams_crud');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('admin.Core.Auth.Team.list', ['teams' => Team::all()]);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('admin.Core.Auth.Team.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
$input['name'] = Str::slug($input['display_name']);
|
||||
$request->replace($input);
|
||||
|
||||
$this->validate(
|
||||
$request, [
|
||||
'name' => 'required|unique:teams,name',
|
||||
'display_name' => 'required',
|
||||
'description' => 'required',
|
||||
]
|
||||
);
|
||||
|
||||
$team = Team::create($input);
|
||||
$team->teams()->sync(array_keys($request->input('team', [])));
|
||||
|
||||
return redirect()->route('admin.Teams.edit', $team)
|
||||
->with('growl', [__('teams.successadd'), 'success']);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$team = Team::find($id);
|
||||
|
||||
return view('admin.Core.Auth.Team.edit', compact('team', 'teams'));
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->validate(
|
||||
$request, [
|
||||
'display_name' => 'required',
|
||||
'description' => 'required',
|
||||
]
|
||||
);
|
||||
|
||||
$team = Team::find($id);
|
||||
|
||||
return redirect()->route('admin.Teams.edit', $team)
|
||||
->with('growl', [__('teams.successmod'), 'success']);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
Team::destroy($id);
|
||||
}
|
||||
}
|
||||
183
app/Http/Controllers/Admin/Core/Auth/UserController.php
Normal file
183
app/Http/Controllers/Admin/Core/Auth/UserController.php
Normal file
@@ -0,0 +1,183 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||
|
||||
use Auth;
|
||||
use Image;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
use App\Models\Core\Auth\Role;
|
||||
use App\Models\Core\Auth\User;
|
||||
|
||||
use App\Repositories\Core\Auth\Users;
|
||||
use App\Datatables\Admin\Core\Auth\UsersDataTable;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
public function index(UsersDataTable $dataTable)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
return $dataTable->render('admin.Core.Auth.User.index', $data);
|
||||
}
|
||||
|
||||
public function modalCreate()
|
||||
{
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
return view('admin.Core.Auth.User.modal', $data);
|
||||
}
|
||||
|
||||
public function modalEdit($id = false)
|
||||
{
|
||||
$user = $id ? Users::get($id) : false;
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
$data['user'] = $user ? $user->toArray() : [];
|
||||
$data['user']['roles'] = $user->roles->pluck('id')->toArray();
|
||||
return view('admin.Core.Auth.User.modal', $data);
|
||||
}
|
||||
|
||||
public function storeAjax(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Users::store($data);
|
||||
return response()->json(['code' => '200']);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
return view('admin.Core.Auth.User.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
/*
|
||||
$this->validate($request, [
|
||||
'last_name' => 'required',
|
||||
'first_name' => 'required',
|
||||
'email' => 'required|email|unique:users,email,NULL,id,deleted_at,NULL',
|
||||
]);
|
||||
*/
|
||||
$input = $request->all();
|
||||
if (empty($input['password'])) {
|
||||
unset($input['password']);
|
||||
}
|
||||
$user = Users::store($input);
|
||||
|
||||
return redirect()->route('admin.Core.Auth.User.index')
|
||||
->with('growl', [__('boilerplate::users.successadd'), 'success']);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
$data['user'] = Users::get($id);
|
||||
return view('admin.Core.Auth.User.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
Users::delete($id);
|
||||
}
|
||||
|
||||
public function firstLogin($token, Request $request)
|
||||
{
|
||||
$user = User::where(['remember_token' => $token])->firstOrFail();
|
||||
|
||||
return view('boilerplate::auth.firstlogin', compact('user', 'token'));
|
||||
}
|
||||
|
||||
public function firstLoginPost(Request $request)
|
||||
{
|
||||
$this->validate(
|
||||
$request, [
|
||||
'token' => 'required',
|
||||
'password' => 'required|min:8',
|
||||
'password_confirmation' => 'required|same:password',
|
||||
]
|
||||
);
|
||||
|
||||
$user = User::where(['remember_token' => $request->input('token')])->first();
|
||||
|
||||
$user->password = bcrypt($request->input('password'));
|
||||
$user->remember_token = Str::random(32);
|
||||
$user->last_login = Carbon::now()->toDateTimeString();
|
||||
$user->save();
|
||||
|
||||
Auth::attempt(['email' => $user->email, 'password' => $request->input('password'), 'active' => 1]);
|
||||
|
||||
return redirect()->route('boilerplate.dashboard')
|
||||
->with('growl', [__('boilerplate::users.newpassword'), 'success']);
|
||||
}
|
||||
|
||||
public function profile()
|
||||
{
|
||||
$user = Users::get();
|
||||
$data['user'] = $user ? $user->toArray() : [];
|
||||
$data['user']['name'] = $user->name;
|
||||
$data['user']['avatar'] = Users::getAvatar($user->id);
|
||||
return view('admin.Core.Auth.User.modalProfile', $data);
|
||||
}
|
||||
|
||||
public function profilePost(Request $request)
|
||||
{
|
||||
$this->validate(
|
||||
$request, [
|
||||
'avatar' => 'mimes:jpeg,png|max:10000',
|
||||
'last_name' => 'required',
|
||||
'first_name' => 'required',
|
||||
'password_confirmation' => 'same:password',
|
||||
]
|
||||
);
|
||||
|
||||
$avatar = $request->file('avatar');
|
||||
$user = Auth::user();
|
||||
|
||||
if ($avatar && $file = $avatar->isValid()) {
|
||||
$destinationPath = dirname($user->avatar_path);
|
||||
if (!is_dir($destinationPath)) {
|
||||
mkdir($destinationPath, 0766, true);
|
||||
}
|
||||
$extension = $avatar->getClientOriginalExtension();
|
||||
$fileName = md5($user->id.$user->email).'_tmp.'.$extension;
|
||||
$avatar->move($destinationPath, $fileName);
|
||||
|
||||
Image::make($destinationPath.DIRECTORY_SEPARATOR.$fileName)
|
||||
->fit(100, 100)
|
||||
->save($user->avatar_path);
|
||||
|
||||
unlink($destinationPath.DIRECTORY_SEPARATOR.$fileName);
|
||||
}
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
if ($input['password'] !== null) {
|
||||
$input['password'] = bcrypt($input['password']);
|
||||
$input['remember_token'] = Str::random(32);
|
||||
} else {
|
||||
unset($input['password']);
|
||||
}
|
||||
|
||||
$user->update($input);
|
||||
|
||||
return redirect()->route('boilerplate.user.profile')
|
||||
->with('growl', [__('boilerplate::users.profile.successupdate'), 'success']);
|
||||
}
|
||||
|
||||
public function avatarDelete()
|
||||
{
|
||||
$user = Auth::user();
|
||||
if (is_file($user->avatar_path)) {
|
||||
unlink($user->avatar_path);
|
||||
}
|
||||
}
|
||||
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = Users::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
8
app/Http/Controllers/Admin/Core/Controller.php
Normal file
8
app/Http/Controllers/Admin/Core/Controller.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers\Admin\Core;
|
||||
|
||||
use App\Http\Controllers\Controller as ParentController;
|
||||
|
||||
class Controller extends ParentController
|
||||
{
|
||||
}
|
||||
@@ -7,13 +7,13 @@ use App\Http\Controllers\Controller;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
public function index()
|
||||
{
|
||||
return view('admin.Shop.Dashboard.index');
|
||||
}
|
||||
}
|
||||
|
||||
68
app/Http/Controllers/Admin/Shop/ArticleController.php
Normal file
68
app/Http/Controllers/Admin/Shop/ArticleController.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Datatables\Shop\ArticlesDataTable;
|
||||
|
||||
class ArticleController extends Controller
|
||||
{
|
||||
public function autocomplete(Request $request, $str = false)
|
||||
{
|
||||
$str = $str ? $str : $request->input('q');
|
||||
return response()->json(Articles::autocomplete($str));
|
||||
}
|
||||
|
||||
public function index(ArticlesDataTable $dataTable)
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
return $dataTable->render('Admin.Shop.Articles.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = Articles::getMeta();
|
||||
return view('Admin.Shop.Articles.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
Articles::storeFull($data);
|
||||
return redirect()->route('Admin.Shop.Articles.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Articles::get($id);
|
||||
return view('Admin.Shop.Articles.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Articles::getFull($id);
|
||||
return view('Admin.Shop.Articles.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Articles::destroy($id);
|
||||
}
|
||||
|
||||
public function getImages(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Articles::getImages($id);
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
public function deleteImage(Request $request)
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
return Articles::deleteImage($id, $index);
|
||||
}
|
||||
}
|
||||
49
app/Http/Controllers/Admin/Shop/ArticleNatureController.php
Normal file
49
app/Http/Controllers/Admin/Shop/ArticleNatureController.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Datatables\Shop\ArticleNaturesDataTable;
|
||||
|
||||
class ArticleNatureController extends Controller
|
||||
{
|
||||
public function index(ArticleNaturesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.ArticleNatures.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return ArticleNatures::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Shop.ArticleNatures.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = ArticleNatures::store($request->all());
|
||||
return redirect()->route('Admin.Shop.ArticleNatures.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['article_nature'] = ArticleNatures::get($id);
|
||||
return view('Admin.Shop.ArticleNatures.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['article_nature'] = ArticleNatures::get($id);
|
||||
return view('Admin.Shop.ArticleNatures.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return ArticleNatures::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Categories;
|
||||
use App\Datatables\Shop\CategoriesDataTable;
|
||||
use App\Datatables\Shop\CategoriesDataTable;
|
||||
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
|
||||
public function index(CategoriesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.Categories.list');
|
||||
return $dataTable->render('Admin.Shop.Categories.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
@@ -26,26 +24,26 @@ class CategoryController extends Controller
|
||||
$data = [];
|
||||
$data['category_id'] = 0;
|
||||
$data['categories'] = Categories::getOptions();
|
||||
return view('Shop.Admin.Categories.create', $data);
|
||||
return view('Admin.Shop.Categories.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Categories::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Categories.index');
|
||||
return redirect()->route('Admin.Shop.Categories.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Categories::get($id);
|
||||
return view('Shop.Admin.Categories.view', $data);
|
||||
return view('Admin.Shop.Categories.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Categories::get($id)->toArray();
|
||||
$data['categories'] = Categories::getOptions();
|
||||
return view('Shop.Admin.Categories.edit', $data);
|
||||
return view('Admin.Shop.Categories.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
@@ -79,5 +77,4 @@ class CategoryController extends Controller
|
||||
$type = $request->input('type');
|
||||
return Categories::moveTree($node_id, $target_id, $type);
|
||||
}
|
||||
|
||||
}
|
||||
13
app/Http/Controllers/Admin/Shop/Controller.php
Normal file
13
app/Http/Controllers/Admin/Shop/Controller.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
||||
45
app/Http/Controllers/Admin/Shop/CustomerController.php
Normal file
45
app/Http/Controllers/Admin/Shop/CustomerController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Datatables\Shop\CustomersDataTable;
|
||||
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
public function index(CustomersDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
return $dataTable->render('Admin.Shop.Customers.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Shop.Customers.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Customers::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Customers.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['customer'] = Customers::get($id);
|
||||
return view('Admin.Shop.Customers.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Customers::get($id)->toArray();
|
||||
return view('Admin.Shop.Customers.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Customers::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -33,6 +33,6 @@ class DashboardController extends Controller
|
||||
$data = [];
|
||||
}
|
||||
|
||||
return view('Shop.Admin.Dashboard.index', $data);
|
||||
return view('Admin.Shop.Dashboard.index', $data);
|
||||
}
|
||||
}
|
||||
29
app/Http/Controllers/Admin/Shop/HomeController.php
Normal file
29
app/Http/Controllers/Admin/Shop/HomeController.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\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');
|
||||
}
|
||||
}
|
||||
45
app/Http/Controllers/Admin/Shop/InvoiceController.php
Normal file
45
app/Http/Controllers/Admin/Shop/InvoiceController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Invoices;
|
||||
use App\Datatables\Shop\InvoicesDataTable;
|
||||
|
||||
class InvoiceController extends Controller
|
||||
{
|
||||
public function index(InvoicesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.Invoices.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Shop.Invoices.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Invoices::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Invoices.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Invoices::get($id);
|
||||
return view('Admin.Shop.Invoices.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Invoices::get($id)->toArray();
|
||||
return view('Admin.Shop.Invoices.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Invoices::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\InvoiceItem;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -31,7 +31,7 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
@@ -42,7 +42,7 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(InvoiceItem $invoiceItem)
|
||||
@@ -53,7 +53,7 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(InvoiceItem $invoiceItem)
|
||||
@@ -64,8 +64,8 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, InvoiceItem $invoiceItem)
|
||||
@@ -76,7 +76,7 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(InvoiceItem $invoiceItem)
|
||||
45
app/Http/Controllers/Admin/Shop/OfferController.php
Normal file
45
app/Http/Controllers/Admin/Shop/OfferController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Offers;
|
||||
use App\Datatables\Shop\OffersDataTable;
|
||||
|
||||
class OfferController extends Controller
|
||||
{
|
||||
public function index(OffersDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.Offers.list', $data ?? []);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Shop.Offers.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Offers::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Offers.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Offers::get($id);
|
||||
return view('Admin.Shop.Offers.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Offers::get($id)->toArray();
|
||||
return view('Admin.Shop.Offers.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Offers::destroy($id);
|
||||
}
|
||||
}
|
||||
45
app/Http/Controllers/Admin/Shop/OrderController.php
Normal file
45
app/Http/Controllers/Admin/Shop/OrderController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Orders;
|
||||
use App\Datatables\Shop\OrdersDataTable;
|
||||
|
||||
class OrderController extends Controller
|
||||
{
|
||||
public function index(OrdersDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.Orders.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Shop.Orders.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Orders::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Orders.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Orders::get($id);
|
||||
return view('Admin.Shop.Orders.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Orders::get($id)->toArray();
|
||||
return view('Admin.Shop.Orders.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Orders::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\OrderPayment;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -31,7 +31,7 @@ class OrderPaymentController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
@@ -42,7 +42,7 @@ class OrderPaymentController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\OrderPayment $orderPayment
|
||||
* @param \App\OrderPayment $orderPayment
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(OrderPayment $orderPayment)
|
||||
@@ -53,7 +53,7 @@ class OrderPaymentController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\OrderPayment $orderPayment
|
||||
* @param \App\OrderPayment $orderPayment
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(OrderPayment $orderPayment)
|
||||
@@ -64,8 +64,8 @@ class OrderPaymentController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\OrderPayment $orderPayment
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\OrderPayment $orderPayment
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, OrderPayment $orderPayment)
|
||||
@@ -76,7 +76,7 @@ class OrderPaymentController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\OrderPayment $orderPayment
|
||||
* @param \App\OrderPayment $orderPayment
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(OrderPayment $orderPayment)
|
||||
65
app/Http/Controllers/Admin/Shop/PackageController.php
Normal file
65
app/Http/Controllers/Admin/Shop/PackageController.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Datatables\Shop\PackagesDataTable;
|
||||
|
||||
class PackageController extends Controller
|
||||
{
|
||||
public function index(PackagesDataTable $dataTable)
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
return $dataTable->render('Admin.Shop.Packages.list', $data);
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Packages::getTables($request->all());
|
||||
}
|
||||
|
||||
public function getOptionsByFamily(Request $request)
|
||||
{
|
||||
$id = $request->input('family_id');
|
||||
return response()->json(Packages::getSelectByFamily($id));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
return view('Admin.Shop.Packages.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Packages::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Packages.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Packages::get($id);
|
||||
return view('Admin.Shop.Packages.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['package'] = Packages::get($id);
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
return view('Admin.Shop.Packages.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Packages::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\PriceGenericCategories;
|
||||
use App\Datatables\Shop\PriceGenericCategoriesDataTable;
|
||||
|
||||
class PriceGenericCategoryController extends Controller
|
||||
{
|
||||
public function index(PriceGenericCategoriesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.PriceGenericCategories.list');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
return view('Admin.Shop.PriceGenericCategories.create', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
$data['generic_category'] = PriceGenericCategories::get($id)->toArray();
|
||||
return view('Admin.Shop.PriceGenericCategories.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = PriceGenericCategories::store($request->all());
|
||||
return redirect()->route('Admin.Shop.PriceGenericCategories.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = PriceGenericCategories::get($id);
|
||||
return view('Admin.Shop.PriceGenericCategories.view', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return PriceGenericCategories::destroy($id);
|
||||
}
|
||||
}
|
||||
85
app/Http/Controllers/Admin/Shop/PriceListController.php
Normal file
85
app/Http/Controllers/Admin/Shop/PriceListController.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\Shop\PriceList;
|
||||
use App\Repositories\Shop\PriceLists;
|
||||
use App\Repositories\Shop\Taxes;
|
||||
use App\Repositories\Shop\Tariffs;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use App\Datatables\Shop\PriceListsDataTable;
|
||||
|
||||
class PriceListController extends Controller
|
||||
{
|
||||
public function index(PriceListsDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
return $dataTable->render('Admin.Shop.PriceLists.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = [];
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
return view('Admin.Shop.PriceLists.create', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['price_list'] = PriceLists::get($id);
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
return view('Admin.Shop.PriceLists.edit', $data);
|
||||
}
|
||||
|
||||
public function modalCreate($tariff_id)
|
||||
{
|
||||
$data = [];
|
||||
$data['price_list']['tariff_id'] = $tariff_id;
|
||||
$data['price_list']['price_list_values'] = array_fill(0, 3, '');
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
return view('Admin.Shop.PriceLists.modal', $data);
|
||||
}
|
||||
|
||||
public function modalEdit($id)
|
||||
{
|
||||
$data['price_list'] = PriceLists::getFull($id);
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
return view('Admin.Shop.PriceLists.modal', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = PriceLists::store($request->all());
|
||||
return redirect()->route('Admin.Shop.PriceLists.index');
|
||||
}
|
||||
|
||||
public function storeAjax(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = PriceLists::store($data);
|
||||
return response()->json(['code' => '200']);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = PriceLists::get($id);
|
||||
return view('Admin.Shop.PriceLists.view', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return PriceLists::destroy($id);
|
||||
}
|
||||
|
||||
public function getPrice($id)
|
||||
{
|
||||
$data['generic'] = PriceLists::getFull($id);
|
||||
return view('Admin.Shop.PriceLists.partials.table-prices', $data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\Shop\PriceListValue;
|
||||
use App\Repositories\Shop\PriceListValues;
|
||||
use App\Repositories\Shop\PriceListValueCategories;
|
||||
use App\Repositories\Shop\Taxes;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use App\Datatables\Shop\PriceListValuesDataTable;
|
||||
|
||||
class PriceListValueController extends Controller
|
||||
{
|
||||
public function index(PriceListValuesDataTable $dataTable)
|
||||
{
|
||||
$data['categories'] = PriceListValueCategories::getOptions();
|
||||
return $dataTable->render('Admin.Shop.PriceListValues.list', $data);
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return PriceListValues::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['unities'] = Unities::getOptions();
|
||||
$data['taxes_options'] = Taxes::getOptions();
|
||||
$data['categories'] = PriceListValueCategories::getOptions();
|
||||
return view('Admin.Shop.PriceListValues.create', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['generic'] = PriceListValues::getFull($id)->toArray();
|
||||
$data['packages'] = Packages::getSelectByFamily($data['generic']['category']['article_family_id']);
|
||||
$data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : [];
|
||||
$data['taxes_options'] = Taxes::getOptions();
|
||||
$data['categories'] = PriceListValueCategories::getOptions();
|
||||
return view('Admin.Shop.PriceListValues.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = PriceListValues::store($request->all());
|
||||
return redirect()->route('Admin.Shop.PriceListValues.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = PriceListValues::get($id);
|
||||
return view('Admin.Shop.PriceListValues.view', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return PriceListValues::destroy($id);
|
||||
}
|
||||
|
||||
public function getPrice($id)
|
||||
{
|
||||
$data['generic'] = PriceListValues::getFull($id);
|
||||
return view('Admin.Shop.PriceListValues.partials.table-prices', $data);
|
||||
}
|
||||
}
|
||||
46
app/Http/Controllers/Admin/Shop/SaleChannelController.php
Normal file
46
app/Http/Controllers/Admin/Shop/SaleChannelController.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use App\Datatables\Shop\SaleChannelsDataTable;
|
||||
|
||||
class SaleChannelController extends Controller
|
||||
{
|
||||
public function index(SaleChannelsDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.SaleChannels.list', $data ?? []);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Shop.SaleChannels.create', $data ?? []);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = SaleChannels::store($request->all());
|
||||
return redirect()->route('Admin.Shop.SaleChannels.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['sale_channel'] = SaleChannels::get($id);
|
||||
return view('Admin.Shop.SaleChannels.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['sale_channel'] = SaleChannels::get($id);
|
||||
return view('Admin.Shop.SaleChannels.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return SaleChannels::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Tags;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Datatables\Shop\TagsDataTable;
|
||||
use App\Datatables\Shop\TagsDataTable;
|
||||
|
||||
class TagController extends Controller
|
||||
{
|
||||
public function index(TagsDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.Tags.list');
|
||||
return $dataTable->render('Admin.Shop.Tags.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
@@ -25,26 +25,26 @@ class TagController extends Controller
|
||||
{
|
||||
$data = [];
|
||||
$data['tag_groups'] = TagGroups::getOptions();
|
||||
return view('Shop.Admin.Tags.create', $data);
|
||||
return view('Admin.Shop.Tags.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Tags::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Tags.index');
|
||||
return redirect()->route('Admin.Shop.Tags.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Tags::get($id);
|
||||
return view('Shop.Admin.Tags.view', $data);
|
||||
return view('Admin.Shop.Tags.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Tags::get($id);
|
||||
$data['tag_groups'] = TagGroups::getOptions();
|
||||
return view('Shop.Admin.Tags.edit', $data);
|
||||
return view('Admin.Shop.Tags.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
@@ -56,5 +56,4 @@ class TagController extends Controller
|
||||
{
|
||||
return Tags::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
58
app/Http/Controllers/Admin/Shop/TagGroupController.php
Normal file
58
app/Http/Controllers/Admin/Shop/TagGroupController.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Datatables\Shop\TagGroupsDataTable;
|
||||
|
||||
class TagGroupController extends Controller
|
||||
{
|
||||
public function index(TagGroupsDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.TagGroups.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return TagGroups::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['article_families'] = ArticleNatures::getOptions();
|
||||
return view('Admin.Shop.TagGroups.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = TagGroups::store($request->all());
|
||||
return redirect()->route('Admin.Shop.TagGroups.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = TagGroups::get($id);
|
||||
return view('Admin.Shop.TagGroups.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = TagGroups::get($id);
|
||||
$data['article_families'] = ArticleNatures::getOptions();
|
||||
return view('Admin.Shop.TagGroups.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return TagGroups::destroy($id);
|
||||
}
|
||||
}
|
||||
67
app/Http/Controllers/Admin/Shop/TariffController.php
Normal file
67
app/Http/Controllers/Admin/Shop/TariffController.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use App\Repositories\Shop\Tariffs;
|
||||
use App\Repositories\Shop\TariffUnities;
|
||||
use App\Datatables\Shop\TariffsDataTable;
|
||||
use App\Datatables\Shop\PriceListsDataTable;
|
||||
|
||||
class TariffController extends Controller
|
||||
{
|
||||
public function autocomplete(Request $request, $str = false)
|
||||
{
|
||||
$str = $str ? $str : $request->input('q');
|
||||
return response()->json(Tariffs::autocomplete($str));
|
||||
}
|
||||
|
||||
public function index(TariffsDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.Tariffs.list');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
$data['tariff_unities'] = TariffUnities::getOptions();
|
||||
|
||||
$model = new PriceListsDataTable();
|
||||
$data['datatables']['price_lists'] = $model->html();
|
||||
|
||||
return view('Admin.Shop.Tariffs.create', $data);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['tariff'] = Tariffs::getFull($id);
|
||||
return view('Admin.Shop.Tariffs.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['tariff'] = Tariffs::get($id);
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
$data['tariff_unities'] = TariffUnities::getOptions();
|
||||
|
||||
$model = new PriceListsDataTable();
|
||||
$data['datatables']['price_lists'] = $model->html();
|
||||
|
||||
return view('Admin.Shop.Tariffs.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Tariffs::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Tariffs.index');
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Tariffs::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -11,7 +11,7 @@ class TaxController extends Controller
|
||||
{
|
||||
public function index(TaxesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.Taxes.list');
|
||||
return $dataTable->render('Admin.Shop.Taxes.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
@@ -23,26 +23,26 @@ class TaxController extends Controller
|
||||
{
|
||||
$data = [];
|
||||
$data['groups'] = TagGroups::getOptions();
|
||||
return view('Shop.Admin.Taxes.create', $data);
|
||||
return view('Admin.Shop.Taxes.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Taxes::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Taxes.index');
|
||||
return redirect()->route('Admin.Shop.Taxes.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Taxes::get($id);
|
||||
return view('Shop.Admin.Taxes.view', $data);
|
||||
return view('Admin.Shop.Taxes.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Taxes::get($id);
|
||||
$data['groups'] = TagGroups::getOptions();
|
||||
return view('Shop.Admin.Taxes.edit', $data);
|
||||
return view('Admin.Shop.Taxes.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
@@ -54,5 +54,4 @@ class TaxController extends Controller
|
||||
{
|
||||
return Taxes::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
66
app/Http/Controllers/Admin/Shop/UnityController.php
Normal file
66
app/Http/Controllers/Admin/Shop/UnityController.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use App\Datatables\Shop\UnitiesDataTable;
|
||||
|
||||
class UnityController extends Controller
|
||||
{
|
||||
public function index(UnitiesDataTable $dataTable)
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
$data['packages'] = Packages::getOptions();
|
||||
return $dataTable->render('Admin.Shop.Unities.list', $data);
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Unities::getTables($request->all());
|
||||
}
|
||||
|
||||
public function getOptionsByPackage(Request $request)
|
||||
{
|
||||
$id = $request->input('package_id');
|
||||
return response()->json(Unities::getOptionsByPackage($id));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
return view('Admin.Shop.Unities.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Unities::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Unities.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Unities::get($id);
|
||||
return view('Admin.Shop.Unities.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data['unity'] = Unities::get($id)->toArray();
|
||||
return view('Admin.Shop.Unities.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Unities::destroy($id);
|
||||
}
|
||||
|
||||
public function update($id)
|
||||
{
|
||||
}
|
||||
}
|
||||
57
app/Http/Controllers/Admin/Shop/VariationController.php
Normal file
57
app/Http/Controllers/Admin/Shop/VariationController.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use App\Repositories\Shop\Variations;
|
||||
|
||||
use App\Datatables\Shop\VariationsDataTable;
|
||||
|
||||
class VariationController extends Controller
|
||||
{
|
||||
public function autocomplete(Request $request, $str = false)
|
||||
{
|
||||
$str = $str ? $str : $request->input('q');
|
||||
return response()->json(Variations::autocomplete($str));
|
||||
}
|
||||
|
||||
public function index(VariationsDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Admin.Shop.Variations.list');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data['unities'] = Unities::getOptions();
|
||||
return view('Admin.Shop.Variations.create', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['variation'] = Variations::get($id);
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data['unities'] = Unities::getOptions();
|
||||
return view('Admin.Shop.Variations.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Variations::store($request->all());
|
||||
return redirect()->route('Admin.Shop.Variations.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Variations::get($id);
|
||||
return view('Admin.Shop.Variations.view', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Variations::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ class ConfirmPasswordController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
protected $redirectTo = '';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
|
||||
@@ -19,4 +19,20 @@ class ForgotPasswordController extends Controller
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
public function showLinkRequestForm()
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
return view('auth.passwords.email', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,38 +3,49 @@
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Repositories\Layout;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesUsers;
|
||||
protected $redirectTo = '/';
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
$this->middleware('guest:web')->except('logout');
|
||||
}
|
||||
|
||||
public function showLoginForm()
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
return view('auth.login', $data);
|
||||
}
|
||||
|
||||
public function authenticated(Request $request, $user)
|
||||
{
|
||||
$request->session()->forget('password_expired_id');
|
||||
|
||||
if ($user->passwordSecurity->password_expiry_days > 0) {
|
||||
$password_updated_at = $user->passwordSecurity->password_updated_at;
|
||||
$password_expiry_days = $user->passwordSecurity->password_expiry_days;
|
||||
$password_expiry_at = Carbon::parse($password_updated_at)->addDays($password_expiry_days);
|
||||
if ($password_expiry_at->lessThan(Carbon::now())) {
|
||||
$request->session()->put('password_expired_id', $user->id);
|
||||
auth()->logout();
|
||||
return redirect('/reset-password')->with('message', "Your password is expired. You need to change your password.");
|
||||
}
|
||||
}
|
||||
|
||||
return redirect()->intended($this->redirectPath());
|
||||
}
|
||||
|
||||
public function username()
|
||||
{
|
||||
return 'username';
|
||||
}
|
||||
}
|
||||
|
||||
71
app/Http/Controllers/Auth/PasswordSecurityController.php
Normal file
71
app/Http/Controllers/Auth/PasswordSecurityController.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class PasswordSecurityController extends Controller
|
||||
{
|
||||
// reset password form
|
||||
public function resetPasswordForm(Request $request)
|
||||
{
|
||||
$password_expired_id = $request->session()->get('password_expired_id');
|
||||
if (!isset($password_expired_id)) {
|
||||
return redirect('/login');
|
||||
}
|
||||
return view('auth.reset_password');
|
||||
}
|
||||
|
||||
// reset password
|
||||
public function resetPassword(Request $request)
|
||||
{
|
||||
// check expire id
|
||||
$password_expired_id = $request->session()->get('password_expired_id');
|
||||
if (!isset($password_expired_id)) {
|
||||
return redirect('/login');
|
||||
}
|
||||
|
||||
// validate
|
||||
$validatedData = $request->validate(
|
||||
[
|
||||
'current_password' => 'required',
|
||||
'new_password' => 'required|string|min:6|confirmed',
|
||||
]
|
||||
);
|
||||
|
||||
// the requests
|
||||
$request_current_password = $request->current_password;
|
||||
$request_new_password = $request->new_password;
|
||||
$request_new_password_confirm = $request->new_password_confirm;
|
||||
|
||||
// the passwords matches
|
||||
$user = User::find($password_expired_id);
|
||||
if (!(Hash::check($request_current_password, $user->password))) {
|
||||
return redirect()->back()->with("error", "Your current password does not matches with the password you provided. Please try again.");
|
||||
}
|
||||
|
||||
// current password and new password are same
|
||||
if (strcmp($request_current_password, $request->new_password) == 0) {
|
||||
return redirect()->back()->with("error", "New password cannot be same as your current password. Please choose a different password.");
|
||||
}
|
||||
|
||||
// new password and new password confirm doesn't match
|
||||
if (strcmp($request_new_password, $request_new_password_confirm) == 1) {
|
||||
return redirect()->back()->with("error", "New password doesn't match with confirm password.");
|
||||
}
|
||||
|
||||
// change Password
|
||||
$user->password = bcrypt($request->new_password);
|
||||
$user->save();
|
||||
|
||||
// update password update time
|
||||
$user->passwordSecurity->password_updated_at = Carbon::now();
|
||||
$user->passwordSecurity->save();
|
||||
|
||||
return redirect('/login')->with("status", "Password changed successfully. Now you can login!");
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use App\Models\Core\Auth\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
@@ -29,7 +28,7 @@ class RegisterController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
@@ -38,36 +37,40 @@ class RegisterController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
]);
|
||||
return Validator::make(
|
||||
$data, [
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|string|email|max:255|unique:users',
|
||||
'password' => 'required|string|min:6|confirmed',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
* @return \App\User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
return User::create(
|
||||
[
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
@@ -26,5 +26,23 @@ class ResetPasswordController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
public function showResetForm(Request $request, $token = null)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['token'] = $token;
|
||||
$data['email'] = $request->email;
|
||||
return view('auth.passwords.reset', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
@@ -26,7 +25,7 @@ class VerificationController extends Controller
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Botanic\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Botanic\Families;
|
||||
use App\Datatables\Botanic\FamiliesDataTable;
|
||||
|
||||
class FamilyController extends Controller
|
||||
{
|
||||
|
||||
public function index(FamiliesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Botanic.Admin.Families.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Families::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = [];
|
||||
return view('Botanic.Admin.Families.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Families::store($request);
|
||||
return redirect()->route('Botanic.Admin.Families.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Families::get($id);
|
||||
return view('Botanic.Admin.Families.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['family'] = Families::get($id)->toArray();
|
||||
return view('Botanic.Admin.Families.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Families::destroy($id);
|
||||
}
|
||||
|
||||
public function exportExcel()
|
||||
{
|
||||
return Families::exportExcel();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Botanic\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Genres;
|
||||
use App\Datatables\Botanic\SpeciesDataTable;
|
||||
|
||||
class SpecieController extends Controller
|
||||
{
|
||||
public function index(SpeciesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Botanic.Admin.Species.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Species::getDatatable($request->all());
|
||||
}
|
||||
|
||||
public function getOptions()
|
||||
{
|
||||
return response()->json(Species::getOptions());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Botanic.Admin.Species.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Species::store($data);
|
||||
return redirect()->route('Botanic.Admin.Species.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
return view('Botanic.Admin.Species.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
$data['genres'] = Genres::getOptions();
|
||||
return view('Botanic.Admin.Species.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Species::destroy($id);
|
||||
}
|
||||
|
||||
public function exportExcel()
|
||||
{
|
||||
return Species::exportExcel();
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Botanic\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Datatables\Botanic\VarietiesDataTable;
|
||||
|
||||
use App\Models\Shop\Variety;
|
||||
|
||||
class VarietyController extends Controller
|
||||
{
|
||||
public function index(VarietiesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Botanic.Admin.Varieties.list');
|
||||
}
|
||||
|
||||
public function getOptionsWithSpecie()
|
||||
{
|
||||
return response()->json(Varieties::getOptionsWithSpecie());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
return view('Botanic.Admin.Varieties.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
Varieties::storeFull($data);
|
||||
return redirect()->route('Botanic.Admin.Varieties.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
return view('Botanic.Admin.Varieties.view', Varieties::get($id));
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Varieties::getFull($id);
|
||||
$data['species'] = Species::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
return view('Botanic.Admin.Varieties.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Varieties::destroy($id);
|
||||
}
|
||||
|
||||
public function getImages(Request $request, $id = false, $can_edit = true)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Varieties::getImages($id);
|
||||
$data['can_edit'] = $can_edit;
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
public function deleteImage(Request $request)
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
return Varieties::deleteImage($id, $index);
|
||||
}
|
||||
|
||||
public function exportExcel()
|
||||
{
|
||||
return Varieties::exportExcel();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\JS;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Config;
|
||||
|
||||
class CacheController extends Controller
|
||||
{
|
||||
public function getCacheVersions()
|
||||
{
|
||||
$data['versions'] = Config::getCacheVersions();
|
||||
|
||||
$d = (string) view('js.cache', $data);
|
||||
$d = html_entity_decode($d);
|
||||
|
||||
return self::render($d);
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\ArticleFamilies;
|
||||
use App\Datatables\Shop\ArticlesDataTable;
|
||||
|
||||
class ArticleController extends Controller
|
||||
{
|
||||
public function index(ArticlesDataTable $dataTable)
|
||||
{
|
||||
$data['families'] = ArticleFamilies::getOptions();
|
||||
return $dataTable->render('Shop.Admin.Articles.list', $data);
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Articles::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = $this->getMeta();
|
||||
return view('Shop.Admin.Articles.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$data = $request->all();
|
||||
// dump($data);
|
||||
// exit;
|
||||
Articles::storeFull($data);
|
||||
return redirect()->route('Shop.Admin.Articles.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Articles::get($id);
|
||||
return view('Shop.Admin.Articles.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Articles::getFull($id);
|
||||
return view('Shop.Admin.Articles.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Articles::destroy($id);
|
||||
}
|
||||
|
||||
public function getMeta($data = [])
|
||||
{
|
||||
return Articles::getMeta($data);
|
||||
}
|
||||
|
||||
public function getImages(Request $request, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Articles::getImages($id);
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
public function deleteImage(Request $request)
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
return Articles::deleteImage($id, $index);
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleFamilies;
|
||||
use App\Datatables\Shop\ArticleFamiliesDataTable;
|
||||
|
||||
class ArticleFamilyController extends Controller
|
||||
{
|
||||
public function index(ArticleFamiliesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.ArticleFamilies.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return ArticleFamilies::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Shop.Admin.ArticleFamilies.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = ArticleFamilies::store($request->all());
|
||||
return redirect()->route('Shop.Admin.ArticleFamilies.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = ArticleFamilies::get($id);
|
||||
return view('Shop.Admin.ArticleFamilies.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = ArticleFamilies::get($id);
|
||||
return view('Shop.Admin.ArticleFamilies.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return ArticleFamilies::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\Shop\ArticlePrice;
|
||||
use App\Repositories\Shop\ArticlePrices;
|
||||
|
||||
class ArticlePriceController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\ArticlePrice $ArticlePrice
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(ArticlePrice $ArticlePrice)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\ArticlePrice $ArticlePrice
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(ArticlePrice $ArticlePrice)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\ArticlePrice $ArticlePrice
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, ArticlePrice $ArticlePrice)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\ArticlePrice $ArticlePrice
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(ArticlePrice $ArticlePrice)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Datatables\Shop\CustomersDataTable;
|
||||
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
public function index(CustomersDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
return $dataTable->render('Shop.Admin.Customers.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Shop.Admin.Customers.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Customers::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Customers.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['customer'] = Customers::get($id);
|
||||
return view('Shop.Admin.Customers.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Customers::get($id)->toArray();
|
||||
return view('Shop.Admin.Customers.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Customers::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\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');
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use App\Inventory;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class InventoryController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Inventory $inventory
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Inventory $inventory)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Inventory $inventory
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Inventory $inventory)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Inventory $inventory
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Inventory $inventory)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Inventory $inventory
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Inventory $inventory)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use App\InventoryPlace;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class InventoryPlaceController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\InventoryPlace $inventoryPlace
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(InventoryPlace $inventoryPlace)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\InventoryPlace $inventoryPlace
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(InventoryPlace $inventoryPlace)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\InventoryPlace $inventoryPlace
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, InventoryPlace $inventoryPlace)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\InventoryPlace $inventoryPlace
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(InventoryPlace $inventoryPlace)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Invoices;
|
||||
use App\Datatables\Shop\InvoicesDataTable;
|
||||
|
||||
class InvoiceController extends Controller
|
||||
{
|
||||
public function index(InvoicesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.Invoices.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Shop.Admin.Invoices.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Invoices::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Invoices.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Invoices::get($id);
|
||||
return view('Shop.Admin.Invoices.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Invoices::get($id)->toArray();
|
||||
return view('Shop.Admin.Invoices.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Invoices::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Orders;
|
||||
use App\Datatables\Shop\OrdersDataTable;
|
||||
|
||||
class OrderController extends Controller
|
||||
{
|
||||
public function index(OrdersDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.Orders.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Shop.Admin.Orders.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Orders::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Orders.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Orders::get($id);
|
||||
return view('Shop.Admin.Orders.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = Orders::get($id)->toArray();
|
||||
return view('Shop.Admin.Orders.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Orders::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleFamilies;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Datatables\Shop\PackagesDataTable;
|
||||
|
||||
class PackageController extends Controller
|
||||
{
|
||||
public function index(PackagesDataTable $dataTable)
|
||||
{
|
||||
$data['families'] = ArticleFamilies::getOptions();
|
||||
return $dataTable->render('Shop.Admin.Packages.list', $data);
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Packages::getTables($request->all());
|
||||
}
|
||||
|
||||
public function getOptionsByFamily(Request $request)
|
||||
{
|
||||
$id = $request->input('family_id');
|
||||
return response()->json(Packages::getSelectByFamily($id));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['families'] = ArticleFamilies::getOptions();
|
||||
return view('Shop.Admin.Packages.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Packages::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Packages.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Packages::get($id);
|
||||
return view('Shop.Admin.Packages.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['package'] = Packages::get($id);
|
||||
$data['families'] = ArticleFamilies::getOptions();
|
||||
return view('Shop.Admin.Packages.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Packages::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleFamilies;
|
||||
use App\Repositories\Shop\PriceGenericCategories;
|
||||
use App\Datatables\Shop\PriceGenericCategoriesDataTable;
|
||||
|
||||
class PriceGenericCategoryController extends Controller
|
||||
{
|
||||
public function index(PriceGenericCategoriesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.PriceGenericCategories.list');
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['families'] = ArticleFamilies::getOptions();
|
||||
return view('Shop.Admin.PriceGenericCategories.create', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['families'] = ArticleFamilies::getOptions();
|
||||
$data['generic_category'] = PriceGenericCategories::get($id)->toArray();
|
||||
return view('Shop.Admin.PriceGenericCategories.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = PriceGenericCategories::store($request->all());
|
||||
return redirect()->route('Shop.Admin.PriceGenericCategories.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = PriceGenericCategories::get($id);
|
||||
return view('Shop.Admin.PriceGenericCategories.view', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return PriceGenericCategories::destroy($id);
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Models\Shop\PriceGeneric;
|
||||
use App\Repositories\Shop\PriceGenerics;
|
||||
use App\Repositories\Shop\PriceGenericCategories;
|
||||
use App\Repositories\Shop\Taxes;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use App\Datatables\Shop\PriceGenericsDataTable;
|
||||
|
||||
class PriceGenericController extends Controller
|
||||
{
|
||||
public function index(PriceGenericsDataTable $dataTable)
|
||||
{
|
||||
$data['categories'] = PriceGenericCategories::getOptions();
|
||||
return $dataTable->render('Shop.Admin.PriceGenerics.list', $data);
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return PriceGenerics::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['unities'] = Unities::getOptions();
|
||||
$data['taxes_options'] = Taxes::getOptions();
|
||||
$data['categories'] = PriceGenericCategories::getOptions();
|
||||
return view('Shop.Admin.PriceGenerics.create',$data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['generic'] = PriceGenerics::getFull($id)->toArray();
|
||||
$data['packages'] = Packages::getSelectByFamily($data['generic']['category']['article_family_id']);
|
||||
$data['unities'] = ($data['packages']['id'] ?? false) ? Unities::getSelectByPackage($data['packages']['id']) : [];
|
||||
$data['taxes_options'] = Taxes::getOptions();
|
||||
$data['categories'] = PriceGenericCategories::getOptions();
|
||||
return view('Shop.Admin.PriceGenerics.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = PriceGenerics::store($request->all());
|
||||
return redirect()->route('Shop.Admin.PriceGenerics.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = PriceGenerics::get($id);
|
||||
return view('Shop.Admin.PriceGenerics.view', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return PriceGenerics::destroy($id);
|
||||
}
|
||||
|
||||
public function getPrice($id) {
|
||||
$data['generic'] = PriceGenerics::getFull($id);
|
||||
return view('Shop.Admin.PriceGenerics.partials.table-prices', $data);
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Repositories\Shop\ArticleFamilies;
|
||||
use App\Datatables\Shop\TagGroupsDataTable;
|
||||
|
||||
class TagGroupController extends Controller
|
||||
{
|
||||
public function index(TagGroupsDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Admin.TagGroups.list');
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return TagGroups::getTables($request->all());
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['article_families'] = ArticleFamilies::getOptions();
|
||||
return view('Shop.Admin.TagGroups.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = TagGroups::store($request->all());
|
||||
return redirect()->route('Shop.Admin.TagGroups.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = TagGroups::get($id);
|
||||
return view('Shop.Admin.TagGroups.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = TagGroups::get($id);
|
||||
$data['article_families'] = ArticleFamilies::getOptions();
|
||||
return view('Shop.Admin.TagGroups.edit', $data);
|
||||
}
|
||||
|
||||
public function update(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return TagGroups::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Shop\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleFamilies;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use App\Datatables\Shop\UnitiesDataTable;
|
||||
|
||||
class UnityController extends Controller
|
||||
{
|
||||
public function index(UnitiesDataTable $dataTable)
|
||||
{
|
||||
$data['families'] = ArticleFamilies::getOptions();
|
||||
$data['packages'] = Packages::getOptions();
|
||||
return $dataTable->render('Shop.Admin.Unities.list', $data);
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
return Unities::getTables($request->all());
|
||||
}
|
||||
|
||||
public function getOptionsByPackage(Request $request)
|
||||
{
|
||||
$id = $request->input('package_id');
|
||||
return response()->json(Unities::getOptionsByPackage($id));
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
return view('Shop.Admin.Unities.create');
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Unities::store($request->all());
|
||||
return redirect()->route('Shop.Admin.Unities.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Unities::get($id);
|
||||
return view('Shop.Admin.Unities.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data['unity'] = Unities::get($id)->toArray();
|
||||
return view('Shop.Admin.Unities.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return Unities::destroy($id);
|
||||
}
|
||||
|
||||
public function update($id) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class ArticleController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
@@ -43,7 +43,7 @@ class ArticleController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Article $article
|
||||
* @param \App\Article $article
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show($id)
|
||||
@@ -54,7 +54,7 @@ class ArticleController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Article $article
|
||||
* @param \App\Article $article
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit($id)
|
||||
@@ -65,8 +65,8 @@ class ArticleController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Article $article
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Article $article
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
@@ -77,7 +77,7 @@ class ArticleController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Article $article
|
||||
* @param \App\Article $article
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
|
||||
@@ -6,15 +6,14 @@ use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Categories;
|
||||
use App\Datatables\Shop\CategoriesDataTable;
|
||||
use App\Datatables\Shop\CategoriesDataTable;
|
||||
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
|
||||
public function index(CategoriesDataTable $dataTable)
|
||||
{
|
||||
return $dataTable->render('Shop.Categories.list');
|
||||
}
|
||||
}
|
||||
|
||||
public function getDatatable(Request $request)
|
||||
{
|
||||
@@ -31,5 +30,4 @@ class CategoryController extends Controller
|
||||
{
|
||||
return response()->json(Categories::getTree());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class CustomerController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Customer $customer)
|
||||
@@ -23,7 +23,7 @@ class CustomerController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Customer $customer)
|
||||
@@ -34,8 +34,8 @@ class CustomerController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Customer $customer
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Customer $customer)
|
||||
@@ -46,7 +46,7 @@ class CustomerController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Customer $customer
|
||||
* @param \App\Customer $customer
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Customer $customer)
|
||||
|
||||
@@ -10,27 +10,27 @@ use App\Repositories\Shop\Categories;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// $this->middleware('auth');
|
||||
}
|
||||
/**
|
||||
* 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()
|
||||
{
|
||||
$data['categories'] = Categories::getTree();
|
||||
$data['category'] = Categories::get(15)->toArray();
|
||||
$data['articles'] = Articles::getByCategory(0)->toArray();
|
||||
// dump($data);
|
||||
return view('Shop.home', $data);
|
||||
}
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Support\Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['categories'] = Categories::getTree();
|
||||
$data['category'] = Categories::get(15)->toArray();
|
||||
$data['articles'] = Articles::getByCategory(0)->toArray();
|
||||
// dump($data);
|
||||
return view('Shop.home', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class InvoiceController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
@@ -43,7 +43,7 @@ class InvoiceController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Invoice $invoice
|
||||
* @param \App\Invoice $invoice
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Invoice $invoice)
|
||||
@@ -54,7 +54,7 @@ class InvoiceController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Invoice $invoice
|
||||
* @param \App\Invoice $invoice
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Invoice $invoice)
|
||||
@@ -65,8 +65,8 @@ class InvoiceController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Invoice $invoice
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Invoice $invoice
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Invoice $invoice)
|
||||
@@ -77,7 +77,7 @@ class InvoiceController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Invoice $invoice
|
||||
* @param \App\Invoice $invoice
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Invoice $invoice)
|
||||
|
||||
@@ -32,7 +32,7 @@ class OrderController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
@@ -43,7 +43,7 @@ class OrderController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\Order $order
|
||||
* @param \App\Order $order
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(Order $order)
|
||||
@@ -54,7 +54,7 @@ class OrderController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Order $order
|
||||
* @param \App\Order $order
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Order $order)
|
||||
@@ -65,8 +65,8 @@ class OrderController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Order $order
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\Order $order
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, Order $order)
|
||||
@@ -77,7 +77,7 @@ class OrderController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Order $order
|
||||
* @param \App\Order $order
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(Order $order)
|
||||
|
||||
@@ -9,7 +9,7 @@ class Authenticate extends Middleware
|
||||
/**
|
||||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string|null
|
||||
*/
|
||||
protected function redirectTo($request)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user