add shipping rules
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\Shop\Tag;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class addTagGroup extends Command
|
||||
{
|
||||
protected $signature = 'addTagGroup';
|
||||
|
||||
protected $description = 'Migrations of tags';
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\Shop\Category;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class untranslateShelves extends Command
|
||||
{
|
||||
protected $signature = 'untranslateShelves';
|
||||
|
||||
protected $description = 'Migrations of shelves';
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Models\Shop\Tag;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class untranslateTags extends Command
|
||||
{
|
||||
protected $signature = 'untranslateTags';
|
||||
|
||||
protected $description = 'Migrations of tags';
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -19,7 +19,6 @@ class Kernel extends ConsoleKernel
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
|
||||
namespace BeyondCode\Comments\Contracts;
|
||||
|
||||
|
||||
interface Commentator
|
||||
{
|
||||
/**
|
||||
* Check if a comment for a specific model needs to be approved.
|
||||
*
|
||||
* @param mixed $model
|
||||
* @return bool
|
||||
*/
|
||||
public function needsCommentApproval($model): bool;
|
||||
|
||||
}
|
||||
@@ -2,11 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Admin\Core;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
|
||||
use App\Models\Core\Comment;
|
||||
use App\Repositories\Core\Comments;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CommentsDataTable extends DataTable
|
||||
{
|
||||
@@ -20,6 +18,7 @@ class CommentsDataTable extends DataTable
|
||||
public function query(Comment $model)
|
||||
{
|
||||
$model = $model::with(['user'])->select('*');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Botanic;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Botanic\Family;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class FamiliesDataTable extends DataTable
|
||||
{
|
||||
@@ -12,7 +12,8 @@ class FamiliesDataTable extends DataTable
|
||||
|
||||
public function query(Family $model)
|
||||
{
|
||||
$model = $model::withCount(['genres','species','varieties']);
|
||||
$model = $model::withCount(['genres', 'species', 'varieties']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Botanic;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Botanic\Genre;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class GenresDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class GenresDataTable extends DataTable
|
||||
public function query(Genre $model)
|
||||
{
|
||||
$model = $model::with('family')->withCount('species')->withCount('varieties');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -23,6 +24,7 @@ class GenresDataTable extends DataTable
|
||||
return $genre->family ? $genre->family->name : '';
|
||||
})
|
||||
->rawColumns(['genre_name', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Datatables\Botanic;
|
||||
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Botanic\Specie;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class SpeciesDataTable extends DataTable
|
||||
{
|
||||
@@ -15,6 +15,7 @@ class SpeciesDataTable extends DataTable
|
||||
public function query(Specie $model)
|
||||
{
|
||||
$model = $model::withCount(['images', 'varieties', 'tags'])->with(['genre', 'image', 'tags']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -32,9 +33,11 @@ class SpeciesDataTable extends DataTable
|
||||
foreach ($specie->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['thumb', 'tags2', 'genre_name', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Datatables\Botanic;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Botanic\Variety;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class VarietiesDataTable extends DataTable
|
||||
{
|
||||
@@ -15,6 +15,7 @@ class VarietiesDataTable extends DataTable
|
||||
public function query(Variety $model)
|
||||
{
|
||||
$model = $model::joinRelationship('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with(['image', 'Specie', 'tags'])->withCount(['Articles', 'tags', 'images']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -29,13 +30,14 @@ class VarietiesDataTable extends DataTable
|
||||
foreach ($variety->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['thumb', 'tags2', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -4,22 +4,30 @@ namespace App\Datatables;
|
||||
|
||||
use Yajra\DataTables\Html\Button;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use Yajra\DataTables\Html\Editor\Editor;
|
||||
use Yajra\DataTables\Html\Editor\Fields;
|
||||
use Yajra\DataTables\Services\DataTable;
|
||||
|
||||
class ParentDataTable extends DataTable
|
||||
{
|
||||
public $autoWidth = false;
|
||||
|
||||
public $colReorder = false;
|
||||
|
||||
public $fixedColumns = false;
|
||||
|
||||
public $fixedHeader = false;
|
||||
|
||||
public $rowReorder = false;
|
||||
|
||||
public $rowReorderSelector; // ['selector' => 'tr']
|
||||
|
||||
public $scrollCollapse = false;
|
||||
|
||||
public $scrollX = false;
|
||||
|
||||
public $sortedColumn = 0;
|
||||
|
||||
public $sortedOrder = 'asc';
|
||||
|
||||
public $stateSave = true;
|
||||
|
||||
/**
|
||||
@@ -54,6 +62,7 @@ class ParentDataTable extends DataTable
|
||||
$buttons = '';
|
||||
$buttons .= self::getButtonEdit();
|
||||
$buttons .= self::getButtonDel();
|
||||
|
||||
return $buttons;
|
||||
// return view('components.datatables.buttons.row_action');
|
||||
}
|
||||
@@ -86,7 +95,7 @@ class ParentDataTable extends DataTable
|
||||
|
||||
public static function isFilteredByField($field)
|
||||
{
|
||||
return (request()->has('filters.' . $field)) ? request()->input('filters.'. $field) : (request()->has($field) ? request()->input($field) : false);
|
||||
return (request()->has('filters.'.$field)) ? request()->input('filters.'.$field) : (request()->has($field) ? request()->input($field) : false);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +116,7 @@ class ParentDataTable extends DataTable
|
||||
*/
|
||||
public function html()
|
||||
{
|
||||
return $this->buildHtml(strtolower($this->model_name) . '-table');
|
||||
return $this->buildHtml(strtolower($this->model_name).'-table');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,15 +126,16 @@ class ParentDataTable extends DataTable
|
||||
*/
|
||||
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';
|
||||
$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 : ''
|
||||
'data' => 'function(d) { d.filters = $("'.$selector.'").serializeJSON(); }',
|
||||
'url' => isset($this->url) ? $this->url : '',
|
||||
])
|
||||
->dom($this->getDom())
|
||||
->orderBy($this->sortedColumn, $this->sortedOrder)
|
||||
@@ -138,7 +148,7 @@ class ParentDataTable extends DataTable
|
||||
// Button::make('export'),
|
||||
Button::make('print'),
|
||||
Button::make('colvis'),
|
||||
Button::make('columnsToggle')
|
||||
Button::make('columnsToggle'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -153,11 +163,12 @@ class ParentDataTable extends DataTable
|
||||
'searchDelay' => 500,
|
||||
'scrollX' => $this->scrollX,
|
||||
'scrollCollapse' => $this->scrollCollapse,
|
||||
'stateSave' => $this->stateSave
|
||||
'stateSave' => $this->stateSave,
|
||||
];
|
||||
if ($this->rowReorder) {
|
||||
$data['rowReorder'] = ['selector' => $this->rowReorderSelector];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -165,8 +176,9 @@ class ParentDataTable extends DataTable
|
||||
{
|
||||
$dom = '';
|
||||
// $dom .= $this->getDatatablesHeaderDefault();
|
||||
$dom .= "rt";
|
||||
$dom .= 'rt';
|
||||
$dom .= $this->getDatatablesFooterDefault();
|
||||
|
||||
return $dom;
|
||||
}
|
||||
|
||||
@@ -191,6 +203,7 @@ class ParentDataTable extends DataTable
|
||||
*/
|
||||
|
||||
$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>>';
|
||||
}
|
||||
@@ -217,6 +230,6 @@ class ParentDataTable extends DataTable
|
||||
*/
|
||||
protected function buildFilename($name)
|
||||
{
|
||||
return $name . '_' . date('YmdHis');
|
||||
return $name.'_'.date('YmdHis');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\ArticleNature;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class ArticleNaturesDataTable extends DataTable
|
||||
{
|
||||
@@ -14,6 +14,7 @@ class ArticleNaturesDataTable extends DataTable
|
||||
public function query(ArticleNature $model)
|
||||
{
|
||||
$model = $model::withCount('Articles');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -24,6 +25,7 @@ class ArticleNaturesDataTable extends DataTable
|
||||
return ArticleNatures::getProductTypeName($nature->product_type);
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Article;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class ArticlesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'articles';
|
||||
|
||||
public $sortedColumn = 2;
|
||||
|
||||
public function query(Article $model)
|
||||
@@ -20,24 +20,28 @@ class ArticlesDataTable extends DataTable
|
||||
$model = self::filterByArticleNature($model);
|
||||
$model = self::filterByCategory($model);
|
||||
$model = self::filterByTag($model);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public static function filterByArticleNature($model, $article_nature_id = false)
|
||||
{
|
||||
$article_nature_id = $article_nature_id ? $article_nature_id : self::isFilteredByField('article_nature_id');
|
||||
|
||||
return $article_nature_id ? $model->byArticleNature($article_nature_id) : $model;
|
||||
}
|
||||
|
||||
public static function filterByCategory($model, $category_id = false)
|
||||
{
|
||||
$category_id = $category_id ? $category_id : self::isFilteredByField('category_id');
|
||||
|
||||
return $category_id ? $model->byCategory($category_id) : $model;
|
||||
}
|
||||
|
||||
public static function filterByTag($model, $tag_id = false)
|
||||
{
|
||||
$tag_id = $tag_id ? $tag_id : self::isFilteredByField('tag_id');
|
||||
|
||||
return $tag_id ? $model->byTag($tag_id) : $model;
|
||||
}
|
||||
|
||||
@@ -45,29 +49,30 @@ class ArticlesDataTable extends DataTable
|
||||
{
|
||||
$datatables
|
||||
->editColumn('visible', function (Article $article) {
|
||||
return view("components.form.toggle", [
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'visible',
|
||||
'value' => $article->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $article->id,
|
||||
'meta' => 'data-id='.$article->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->editColumn('homepage', function (Article $article) {
|
||||
return view("components.form.toggle", [
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'homepage',
|
||||
'value' => $article->homepage,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $article->id,
|
||||
'meta' => 'data-id='.$article->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'homepage',
|
||||
]);
|
||||
})
|
||||
->editColumn('thumb', function (Article $article) {
|
||||
$image = Articles::getFullImageByArticle($article);
|
||||
|
||||
return Articles::getThumb($image, false);
|
||||
})
|
||||
->editColumn('article_nature.name', function (Article $article) {
|
||||
@@ -78,12 +83,14 @@ class ArticlesDataTable extends DataTable
|
||||
foreach ($article->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->editColumn('images_count2', function (Article $article) {
|
||||
return Articles::countFullImagesByArticle($article);
|
||||
})
|
||||
->rawColumns(['tags2', 'thumb', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Category;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CategoriesDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class CategoriesDataTable extends DataTable
|
||||
public function query(Category $model)
|
||||
{
|
||||
$model = $model::notRoot()->with(['tags.articles'])->withCount(['articles', 'tags']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -23,23 +24,23 @@ class CategoriesDataTable extends DataTable
|
||||
return $category->name;
|
||||
})
|
||||
->editColumn('visible', function (Category $category) {
|
||||
return view("components.form.toggle", [
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'visible',
|
||||
'value' => $category->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $category->id,
|
||||
'meta' => 'data-id='.$category->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->editColumn('homepage', function (Category $category) {
|
||||
return view("components.form.toggle", [
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'homepage',
|
||||
'value' => $category->homepage,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $category->id,
|
||||
'meta' => 'data-id='.$category->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'homepage',
|
||||
]);
|
||||
@@ -50,9 +51,11 @@ class CategoriesDataTable extends DataTable
|
||||
$nb = collect($tag->articles)->count();
|
||||
$count += $nb;
|
||||
}
|
||||
|
||||
return $count;
|
||||
})
|
||||
->rawColumns(['visible', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\CustomerAddress;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomerAddressesDataTable extends DataTable
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Customer;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomerDeliveriesDataTable extends DataTable
|
||||
{
|
||||
|
||||
@@ -2,25 +2,27 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Order;
|
||||
use App\Repositories\Shop\InvoicePayments;
|
||||
use App\Repositories\Shop\Orders;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomerOrdersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'orders';
|
||||
|
||||
public $sortedColumn = 1;
|
||||
|
||||
public $sortedOrder = 'desc';
|
||||
|
||||
public $stateSave = true;
|
||||
|
||||
public function query(Order $model)
|
||||
{
|
||||
$customer_id = Auth::id();
|
||||
$model = $model->byCustomer($customer_id)->with(['delivery']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -37,6 +39,7 @@ class CustomerOrdersDataTable extends DataTable
|
||||
return InvoicePayments::getPaymentType($order->payment_type);
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Customer;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class CustomersDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class CustomersDataTable extends DataTable
|
||||
public function query(Customer $model)
|
||||
{
|
||||
$model = $model->with('addresses');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Delivery;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class DeliveriesDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class DeliveriesDataTable extends DataTable
|
||||
public function query(Delivery $model)
|
||||
{
|
||||
$model = $model->with('sale_channel');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -20,18 +21,19 @@ class DeliveriesDataTable extends DataTable
|
||||
{
|
||||
$datatables
|
||||
->editColumn('active', function (Delivery $delivery) {
|
||||
return view("components.form.toggle", [
|
||||
return view('components.form.toggle', [
|
||||
'value' => $delivery->active,
|
||||
'on' => __('active'),
|
||||
'off' => __('inactive'),
|
||||
'meta' => 'data-id=' . $delivery->id,
|
||||
'meta' => 'data-id='.$delivery->id,
|
||||
'size' => 'sm',
|
||||
]);
|
||||
})
|
||||
->editColumn('address', function (Delivery $delivery) {
|
||||
return $delivery->address . ' ' . $delivery->zipcode . ' ' . $delivery->city;
|
||||
return $delivery->address.' '.$delivery->zipcode.' '.$delivery->city;
|
||||
})
|
||||
->rawColumns(['active', 'address', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
27
app/Datatables/Shop/DeliveryPackagesDataTable.php
Normal file
27
app/Datatables/Shop/DeliveryPackagesDataTable.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\DeliveryPackage;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class DeliveryPackagesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'delivery_packages';
|
||||
|
||||
public function query(DeliveryPackage $model)
|
||||
{
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('weight')->title('Poids'),
|
||||
Column::make('weight_flyer')->title('Flyer'),
|
||||
Column::make('weight_packaging')->title('Packaging'),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Datatables/Shop/DeliveryTypeCalculationsDataTable.php
Normal file
29
app/Datatables/Shop/DeliveryTypeCalculationsDataTable.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\DeliveryTypeCalculation;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class DeliveryTypeCalculationsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'delivery_type_calculations';
|
||||
|
||||
public function query(DeliveryTypeCalculation $model)
|
||||
{
|
||||
$model = $model->with('delivery_type');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('delivery_type.name')->title('Nom'),
|
||||
Column::make('weight')->title('Poids en g')->addClass('text-right'),
|
||||
Column::make('price')->title('Prix')->addClass('text-right'),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
25
app/Datatables/Shop/DeliveryTypesDataTable.php
Normal file
25
app/Datatables/Shop/DeliveryTypesDataTable.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\DeliveryType;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class DeliveryTypesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'delivery_types';
|
||||
|
||||
public function query(DeliveryType $model)
|
||||
{
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
$this->makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Homepage;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class HomepagesDataTable extends DataTable
|
||||
{
|
||||
@@ -18,6 +18,7 @@ class HomepagesDataTable extends DataTable
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables->rawColumns(['text', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Invoice;
|
||||
use App\Repositories\Shop\Invoices;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class InvoicesDataTable extends DataTable
|
||||
{
|
||||
@@ -14,6 +14,7 @@ class InvoicesDataTable extends DataTable
|
||||
public function query(Invoice $model)
|
||||
{
|
||||
$model = $model->with('customer');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -27,9 +28,10 @@ class InvoicesDataTable extends DataTable
|
||||
return $invoice->created_at->toDateTimeString();
|
||||
})
|
||||
->editColumn('customer.last_name', function (Invoice $invoice) {
|
||||
return ($invoice->customer ?? false) ? $invoice->customer->last_name . ' ' . $invoice->customer->first_name : '';
|
||||
return ($invoice->customer ?? false) ? $invoice->customer->last_name.' '.$invoice->customer->first_name : '';
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Shop\Merchandises;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class MerchandisesDataTable extends DataTable
|
||||
{
|
||||
@@ -15,10 +15,10 @@ class MerchandisesDataTable extends DataTable
|
||||
public function query(Merchandise $model)
|
||||
{
|
||||
$model = $model::with(['image', 'tags'])->withCount(['Articles', 'tags', 'images']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
@@ -30,13 +30,14 @@ class MerchandisesDataTable extends DataTable
|
||||
foreach ($merchandise->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['thumb', 'tags2', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -2,33 +2,37 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Offer;
|
||||
use App\Repositories\Shop\Offers;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class OffersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'offers';
|
||||
|
||||
public $sortedColumn = 1;
|
||||
|
||||
public function query(Offer $model)
|
||||
{
|
||||
$model = $model->with(['article.article_nature', 'variation', 'tariff'])->select($model->getTable() . '.*');
|
||||
$model = $model->with(['article.article_nature', 'variation', 'tariff'])->select($model->getTable().'.*');
|
||||
$model = self::filterByArticleNature($model);
|
||||
$model = self::filterByPackage($model);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
public static function filterByArticleNature($model, $article_nature_id = false)
|
||||
{
|
||||
$article_nature_id = $article_nature_id ? $article_nature_id : self::isFilteredByField('article_nature_id');
|
||||
|
||||
return $article_nature_id ? $model->byArticleNature($article_nature_id) : $model;
|
||||
}
|
||||
|
||||
public static function filterByPackage($model, $package_id = false)
|
||||
{
|
||||
$package_id = $package_id ? $package_id : self::isFilteredByField('package_id');
|
||||
|
||||
return $package_id ? $model->byPackage($package_id) : $model;
|
||||
}
|
||||
|
||||
@@ -36,10 +40,10 @@ class OffersDataTable extends DataTable
|
||||
{
|
||||
$datatables
|
||||
->editColumn('thumb', function (Offer $offer) {
|
||||
return '<img src="' . Offers::getThumbSrc($offer) . '">';
|
||||
return '<img src="'.Offers::getThumbSrc($offer).'">';
|
||||
})
|
||||
->editColumn('status_id', function (Offer $offer) {
|
||||
return view("components.form.toggle", [
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'status_id',
|
||||
'value' => $offer->status_id,
|
||||
'on' => __('active'),
|
||||
@@ -49,9 +53,10 @@ class OffersDataTable extends DataTable
|
||||
]);
|
||||
})
|
||||
->editColumn('stock_delayed', function (Offer $offer) {
|
||||
return $offer->stock_delayed . ' - ' . $offer->delay_type;
|
||||
return $offer->stock_delayed.' - '.$offer->delay_type;
|
||||
})
|
||||
->rawColumns(['active', 'thumb', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,23 +2,26 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Order;
|
||||
use App\Repositories\Shop\InvoicePayments;
|
||||
use App\Repositories\Shop\Orders;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class OrdersDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'orders';
|
||||
|
||||
public $sortedColumn = 1;
|
||||
|
||||
public $sortedOrder = 'desc';
|
||||
|
||||
public $stateSave = true;
|
||||
|
||||
public function query(Order $model)
|
||||
{
|
||||
$model = $model->with(['customer', 'delivery']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -32,12 +35,13 @@ class OrdersDataTable extends DataTable
|
||||
return $order->created_at->toDateTimeString();
|
||||
})
|
||||
->editColumn('customer.last_name', function (Order $order) {
|
||||
return $order->customer->last_name . ' ' . $order->customer->first_name;
|
||||
return $order->customer->last_name.' '.$order->customer->first_name;
|
||||
})
|
||||
->editColumn('payment_type', function (Order $order) {
|
||||
return InvoicePayments::getPaymentType($order->payment_type);
|
||||
})
|
||||
->rawColumns(['action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Package;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class PackagesDataTable extends DataTable
|
||||
{
|
||||
@@ -12,7 +12,8 @@ class PackagesDataTable extends DataTable
|
||||
|
||||
public function query(Package $model)
|
||||
{
|
||||
$model = $model->withCount(['variations','offers']);
|
||||
$model = $model->withCount(['variations', 'offers']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\PriceGenericCategory;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class PriceGenericCategoriesDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class PriceGenericCategoriesDataTable extends DataTable
|
||||
public function query(PriceGenericCategory $model)
|
||||
{
|
||||
$model = $model->withCount('price_generics');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\PriceList;
|
||||
use App\Repositories\Shop\PriceLists;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class PriceListsDataTable extends DataTable
|
||||
{
|
||||
@@ -20,12 +20,14 @@ class PriceListsDataTable extends DataTable
|
||||
{
|
||||
$model = $model->with(['sale_channel', 'price_list_values']);
|
||||
$model = self::filterByTariff($model);
|
||||
|
||||
return $this->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;
|
||||
}
|
||||
|
||||
@@ -39,6 +41,7 @@ class PriceListsDataTable extends DataTable
|
||||
return view('Admin.Shop.PriceLists.partials.table-prices', ['prices' => $price_list['price_list_values']]);
|
||||
})
|
||||
->rawColumns(['tariff_id', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Producer;
|
||||
use App\Repositories\Shop\Producers;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class ProducersDataTable extends DataTable
|
||||
{
|
||||
@@ -15,10 +15,10 @@ class ProducersDataTable extends DataTable
|
||||
public function query(Producer $model)
|
||||
{
|
||||
$model = $model::with(['image', 'tags'])->withCount(['Merchandises', 'tags', 'images']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
public function modifier($datatables)
|
||||
{
|
||||
$datatables
|
||||
@@ -30,13 +30,14 @@ class ProducersDataTable extends DataTable
|
||||
foreach ($producer->tags as $tag) {
|
||||
$html .= Tags::getTagHtml($tag);
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['thumb', 'tags2', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\SaleChannel;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class SaleChannelsDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class SaleChannelsDataTable extends DataTable
|
||||
public function query(SaleChannel $model)
|
||||
{
|
||||
$model = $model->withCount(['deliveries', 'tariffs']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\TagGroup;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class TagGroupsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tag_groups';
|
||||
|
||||
public $sortedColumn = 2;
|
||||
|
||||
public function query(TagGroup $model)
|
||||
{
|
||||
$model = $model::with('article_family')->withCount('tags');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -21,17 +23,18 @@ class TagGroupsDataTable extends DataTable
|
||||
{
|
||||
$datatables
|
||||
->editColumn('visible', function (TagGroup $tag_group) {
|
||||
return view("components.form.toggle", [
|
||||
return view('components.form.toggle', [
|
||||
'name' => 'visible',
|
||||
'value' => $tag_group->visible,
|
||||
'on' => __('oui'),
|
||||
'off' => __('non'),
|
||||
'meta' => 'data-id=' . $tag_group->id,
|
||||
'meta' => 'data-id='.$tag_group->id,
|
||||
'size' => 'sm',
|
||||
'class' => 'visible',
|
||||
]);
|
||||
})
|
||||
->rawColumns(['visible', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Tag;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class TagsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'tags';
|
||||
|
||||
public $rowReorder = ['selector' => 'tr'];
|
||||
|
||||
public function query(Tag $model)
|
||||
{
|
||||
$model = $model::with('tag_group')->withCount(['articles', 'shelves', 'species', 'varieties']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -24,6 +26,7 @@ class TagsDataTable extends DataTable
|
||||
return $tag->name;
|
||||
})
|
||||
->rawColumns(['active', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Tariff;
|
||||
use App\Repositories\Shop\Tariffs;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class TariffsDataTable extends DataTable
|
||||
{
|
||||
@@ -14,6 +14,7 @@ class TariffsDataTable extends DataTable
|
||||
public function query(Tariff $model)
|
||||
{
|
||||
$model = $model->with(['sale_channels'])->withCount(['price_lists', 'offers']);
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -26,11 +27,13 @@ class TariffsDataTable extends DataTable
|
||||
->editColumn('sale_channels2', function (Tariff $tariff) {
|
||||
$html = '';
|
||||
foreach ($tariff->sale_channels as $sale_channel) {
|
||||
$html .= $sale_channel->code . ', ';
|
||||
$html .= $sale_channel->code.', ';
|
||||
}
|
||||
|
||||
return $html;
|
||||
})
|
||||
->rawColumns(['sale_channels2', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Unity;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class UnitiesDataTable extends DataTable
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Datatables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\Datatables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\Variation;
|
||||
use Yajra\DataTables\Html\Column;
|
||||
|
||||
class VariationsDataTable extends DataTable
|
||||
{
|
||||
@@ -13,6 +13,7 @@ class VariationsDataTable extends DataTable
|
||||
public function query(Variation $model)
|
||||
{
|
||||
$model = $model->with(['package', 'unity'])->withCount('offers');
|
||||
|
||||
return $this->buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -23,6 +24,7 @@ class VariationsDataTable extends DataTable
|
||||
return $variation->unity ? $variation->unity->value : '';
|
||||
})
|
||||
->rawColumns(['description', 'action']);
|
||||
|
||||
return parent::modifier($datatables);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Throwable;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/admin';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
use AuthenticatesUsers;
|
||||
protected $redirectTo = '/admin';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
$this->middleware('guest:web')->except('logout');
|
||||
}
|
||||
|
||||
public function showLoginForm()
|
||||
{
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
public function authenticated(Request $request, $user)
|
||||
{
|
||||
return redirect()->intended($this->redirectPath());
|
||||
}
|
||||
|
||||
public function username()
|
||||
{
|
||||
return 'username';
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\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!");
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Auth;
|
||||
|
||||
use App\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
|
||||
use RegistersUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/admin';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @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:6|confirmed',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \App\User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create(
|
||||
[
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Auth;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
public function showResetForm(Request $request, $token = null)
|
||||
{
|
||||
$data['token'] = $token;
|
||||
$data['email'] = $request->email;
|
||||
return view('auth.passwords.reset', $data);
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Botanic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Botanic\Families;
|
||||
use App\Datatables\Botanic\FamiliesDataTable;
|
||||
use App\Repositories\Botanic\Families;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FamilyController extends Controller
|
||||
{
|
||||
@@ -23,18 +22,21 @@ class FamilyController extends Controller
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Botanic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Botanic\Genres;
|
||||
use App\Repositories\Botanic\Families;
|
||||
use App\Datatables\Botanic\GenresDataTable;
|
||||
use App\Repositories\Botanic\Families;
|
||||
use App\Repositories\Botanic\Genres;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GenreController extends Controller
|
||||
{
|
||||
@@ -23,6 +22,7 @@ class GenreController extends Controller
|
||||
public function create()
|
||||
{
|
||||
$data['families'] = Families::getOptions();
|
||||
|
||||
return view('Admin.Botanic.Genres.create', $data);
|
||||
}
|
||||
|
||||
@@ -30,12 +30,14 @@ class GenreController extends Controller
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Genres::store($data);
|
||||
|
||||
return redirect()->route('Admin.Botanic.Genres.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['genre'] = Genres::get($id);
|
||||
|
||||
return view('Admin.Botanic.Genres.view', $data);
|
||||
}
|
||||
|
||||
@@ -43,6 +45,7 @@ class GenreController extends Controller
|
||||
{
|
||||
$data['genre'] = Genres::get($id);
|
||||
$data['families'] = Families::getOptions();
|
||||
|
||||
return view('Admin.Botanic.Genres.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Botanic;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Genres;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Datatables\Botanic\SpeciesDataTable;
|
||||
use App\Repositories\Botanic\Genres;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SpecieController extends Controller
|
||||
{
|
||||
@@ -25,6 +24,7 @@ class SpecieController extends Controller
|
||||
{
|
||||
$data['genres'] = Genres::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Botanic.Species.create', $data);
|
||||
}
|
||||
|
||||
@@ -32,12 +32,14 @@ class SpecieController extends Controller
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Species::storeFull($data);
|
||||
|
||||
return redirect()->route('Admin.Botanic.Species.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Species::get($id);
|
||||
|
||||
return view('Admin.Botanic.Species.view', $data);
|
||||
}
|
||||
|
||||
@@ -46,6 +48,7 @@ class SpecieController extends Controller
|
||||
$data['specie'] = Species::getFull($id);
|
||||
$data['genres'] = Genres::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Botanic.Species.edit', $data);
|
||||
}
|
||||
|
||||
@@ -59,6 +62,7 @@ class SpecieController extends Controller
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Species::getImages($id);
|
||||
$data['can_edit'] = $can_edit;
|
||||
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
@@ -66,6 +70,7 @@ class SpecieController extends Controller
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
|
||||
return Species::deleteImage($id, $index);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,11 @@
|
||||
|
||||
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;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class VarietyController extends Controller
|
||||
{
|
||||
@@ -27,6 +24,7 @@ class VarietyController extends Controller
|
||||
{
|
||||
$data['species'] = Species::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Botanic.Varieties.create', $data);
|
||||
}
|
||||
|
||||
@@ -34,6 +32,7 @@ class VarietyController extends Controller
|
||||
{
|
||||
$data = $request->all();
|
||||
Varieties::storeFull($data);
|
||||
|
||||
return redirect()->route('Admin.Botanic.Varieties.index');
|
||||
}
|
||||
|
||||
@@ -47,6 +46,7 @@ class VarietyController extends Controller
|
||||
$data['variety'] = Varieties::getFull($id);
|
||||
$data['species'] = Species::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Botanic.Varieties.edit', $data);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ class VarietyController extends Controller
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Varieties::getImages($id);
|
||||
$data['can_edit'] = $can_edit;
|
||||
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
@@ -67,6 +68,7 @@ class VarietyController extends Controller
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
|
||||
return Varieties::deleteImage($id, $index);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,20 +2,16 @@
|
||||
|
||||
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;
|
||||
use App\Repositories\Core\App\Applications;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ApplicationController extends Controller
|
||||
{
|
||||
public function index(ApplicationsDataTable $dataTable)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
|
||||
return $dataTable->render('admin.Core.App.Application.index', $data);
|
||||
}
|
||||
|
||||
@@ -24,12 +20,14 @@ class ApplicationController extends Controller
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data = Applications::get($id);
|
||||
|
||||
return view('Admin.Core.App.Application.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
Applications::store($request->all());
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
@@ -37,12 +35,14 @@ class ApplicationController extends Controller
|
||||
{
|
||||
$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]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,17 @@
|
||||
|
||||
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;
|
||||
use App\Repositories\Core\App\ApplicationModules;
|
||||
use App\Repositories\Core\App\Applications;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ApplicationModuleController extends Controller
|
||||
{
|
||||
public function index(ApplicationModulesDataTable $dataTable)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
|
||||
return $dataTable->render('admin.Core.App.ApplicationModule.index', $data);
|
||||
}
|
||||
|
||||
@@ -22,6 +20,7 @@ class ApplicationModuleController extends Controller
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['applications'] = Applications::getOptions();
|
||||
|
||||
return view('Admin.Core.App.ApplicationModule.create', $data);
|
||||
}
|
||||
|
||||
@@ -31,12 +30,14 @@ class ApplicationModuleController extends Controller
|
||||
$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']);
|
||||
}
|
||||
@@ -45,12 +46,14 @@ class ApplicationModuleController extends Controller
|
||||
{
|
||||
$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]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Core\App\Applications;
|
||||
use App\Datatables\Admin\Core\Auth\PermissionsDataTable;
|
||||
use App\Repositories\Core\App\ApplicationModules;
|
||||
use App\Repositories\Core\App\Applications;
|
||||
use App\Repositories\Core\Auth\Permissions;
|
||||
use App\Repositories\Core\Auth\Users;
|
||||
|
||||
use App\Datatables\Admin\Core\Auth\PermissionsDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PermissionController extends Controller
|
||||
{
|
||||
@@ -21,6 +19,7 @@ class PermissionController extends Controller
|
||||
public function index(PermissionsDataTable $dataTable)
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
|
||||
return $dataTable->render('admin.Core.Auth.Permission.index', $data);
|
||||
}
|
||||
|
||||
@@ -30,6 +29,7 @@ class PermissionController extends Controller
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
$data['applications'] = Applications::getOptions();
|
||||
$data['application_modules'] = ApplicationModules::getOptions();
|
||||
|
||||
return view('Admin.Core.Auth.Permission.create', $data);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ class PermissionController extends Controller
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
$data['applications'] = Applications::getOptions();
|
||||
$data['application_modules'] = ApplicationModules::getOptions();
|
||||
|
||||
return view('Admin.Core.Auth.Permission.edit', $data);
|
||||
}
|
||||
|
||||
@@ -60,12 +61,14 @@ class PermissionController extends Controller
|
||||
*/
|
||||
|
||||
Permissions::store($data);
|
||||
|
||||
return redirect()->route('Admin.Core.Auth.Permission.index')->with('growl', [__('permissions.successadd'), 'success']);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
Permissions::delete($id);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,35 +2,35 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||
|
||||
use App\Datatables\Admin\Core\Auth\RolesDataTable;
|
||||
use App\Models\Core\App\ApplicationModule;
|
||||
use App\Models\Core\Auth\Permission;
|
||||
use App\Models\Core\Auth\Role;
|
||||
use App\Repositories\Core\Auth\Roles;
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ class RoleController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
Roles::store($request->all());
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
@@ -54,6 +55,7 @@ class RoleController extends Controller
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
Roles::delete($id);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
@@ -74,6 +76,7 @@ class RoleController extends Controller
|
||||
// Debug::fdump($permissions);
|
||||
// exit;
|
||||
$data['permissions'] = $data;
|
||||
|
||||
return view('Admin.Core.Auth.Role.manage', $data);
|
||||
}
|
||||
|
||||
@@ -85,12 +88,14 @@ class RoleController extends Controller
|
||||
$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]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Core\Auth\Team;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Models\Core\Auth\Team;
|
||||
use App\Models\Core\Auth\Role;
|
||||
|
||||
class TeamController extends Controller
|
||||
{
|
||||
@@ -49,6 +48,7 @@ class TeamController extends Controller
|
||||
public function edit($id)
|
||||
{
|
||||
$team = Team::find($id);
|
||||
|
||||
return view('Admin.Core.Auth.Team.edit', compact('team'));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,29 +2,28 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core\Auth;
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Intervention\Image\Facades\Image;
|
||||
use App\Datatables\Admin\Core\Auth\UsersDataTable;
|
||||
use App\Models\Core\Auth\User;
|
||||
use App\Repositories\Core\Auth\Users;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
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;
|
||||
use Intervention\Image\Facades\Image;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -34,6 +33,7 @@ class UserController extends Controller
|
||||
$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);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ class UserController extends Controller
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Users::store($data);
|
||||
|
||||
return response()->json(['code' => '200']);
|
||||
}
|
||||
|
||||
@@ -48,6 +49,7 @@ class UserController extends Controller
|
||||
{
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
|
||||
return view('Admin.Core.Auth.User.create', $data);
|
||||
}
|
||||
|
||||
@@ -75,6 +77,7 @@ class UserController extends Controller
|
||||
$data = \App\Repositories\Config::init();
|
||||
$data['roles'] = Users::getRolesToEdit();
|
||||
$data['user'] = Users::get($id);
|
||||
|
||||
return view('Admin.Core.Auth.User.edit', $data);
|
||||
}
|
||||
|
||||
@@ -119,6 +122,7 @@ class UserController extends Controller
|
||||
$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);
|
||||
}
|
||||
|
||||
@@ -138,7 +142,7 @@ class UserController extends Controller
|
||||
|
||||
if ($avatar && $file = $avatar->isValid()) {
|
||||
$destinationPath = dirname($user->avatar_path);
|
||||
if (!is_dir($destinationPath)) {
|
||||
if (! is_dir($destinationPath)) {
|
||||
mkdir($destinationPath, 0766, true);
|
||||
}
|
||||
$extension = $avatar->getClientOriginalExtension();
|
||||
@@ -178,6 +182,7 @@ class UserController extends Controller
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = Users::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Core;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Datatables\Admin\Core\CommentsDataTable;
|
||||
use App\Repositories\Core\Comments;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CommentController extends Controller
|
||||
{
|
||||
public function index($model, $model_id)
|
||||
{
|
||||
$data['comments'] = Comments::getCommentsByModel($model, $model_id);
|
||||
|
||||
return view('Admin.Core.Comments.partials.list-comments', $data);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class CommentController extends Controller
|
||||
{
|
||||
$data['model'] = $model;
|
||||
$data['model_id'] = $model_id;
|
||||
|
||||
return $dataTable->render('Admin.Core.Comment.index', $data);
|
||||
}
|
||||
|
||||
@@ -26,6 +27,7 @@ class CommentController extends Controller
|
||||
{
|
||||
$data['comment']['commentable_type'] = $model;
|
||||
$data['comment']['commentable_id'] = $model_id;
|
||||
|
||||
return view('Admin.Core.Comments.partials.modal', $data);
|
||||
}
|
||||
|
||||
@@ -33,6 +35,7 @@ class CommentController extends Controller
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data = Comments::get($id);
|
||||
|
||||
return view('Admin.Core.Comments.partials.modal', $data);
|
||||
}
|
||||
|
||||
@@ -40,6 +43,7 @@ class CommentController extends Controller
|
||||
{
|
||||
$data = $request->all();
|
||||
Comments::store($data);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
@@ -47,6 +51,7 @@ class CommentController extends Controller
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
Comments::destroy($id);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -21,6 +21,7 @@ class MailTemplateController extends Controller
|
||||
public function modalCreate()
|
||||
{
|
||||
$data = MailTemplates::init();
|
||||
|
||||
return view('Admin.Core.Mail.MailTemplate.modal', $data ?? []);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Dashboards;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
|
||||
@@ -2,20 +2,19 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Datatables\Shop\ArticlesDataTable;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Categories;
|
||||
use App\Repositories\Shop\Tags;
|
||||
|
||||
use App\Datatables\Shop\ArticlesDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ArticleController extends Controller
|
||||
{
|
||||
public function autocomplete(Request $request, $str = false)
|
||||
{
|
||||
$str = $str ? $str : $request->input('q');
|
||||
|
||||
return response()->json(Articles::autocomplete($str));
|
||||
}
|
||||
|
||||
@@ -24,12 +23,14 @@ class ArticleController extends Controller
|
||||
$data['article_natures'] = ArticleNatures::getOptions();
|
||||
$data['categories'] = Categories::getOptions();
|
||||
$data['tags'] = Tags::getOptionsFullName();
|
||||
|
||||
return $dataTable->render('Admin.Shop.Articles.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = Articles::getMeta();
|
||||
|
||||
return view('Admin.Shop.Articles.create', $data);
|
||||
}
|
||||
|
||||
@@ -37,18 +38,21 @@ class ArticleController extends Controller
|
||||
{
|
||||
$data = $request->all();
|
||||
Articles::storeFull($data);
|
||||
|
||||
return redirect()->route('Admin.Shop.Articles.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['article'] = 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);
|
||||
}
|
||||
|
||||
@@ -60,12 +64,14 @@ class ArticleController extends Controller
|
||||
public function getProductDescription($product_id, $model)
|
||||
{
|
||||
$data['article']['inherited'] = Articles::getInheritedByProduct($product_id, base64_decode($model));
|
||||
|
||||
return view('Admin.Shop.Articles.partials.product.description', $data);
|
||||
}
|
||||
|
||||
public function getProductTags($product_id, $model)
|
||||
{
|
||||
$data = Articles::getInheritedByProduct($product_id, base64_decode($model));
|
||||
|
||||
return view('Admin.Shop.Articles.partials.product.tags', $data);
|
||||
}
|
||||
|
||||
@@ -73,6 +79,7 @@ class ArticleController extends Controller
|
||||
{
|
||||
$data['article']['product_id'] = $product_id;
|
||||
$data['no_popup'] = false;
|
||||
|
||||
return view('Admin.Shop.Articles.partials.product.images', $data);
|
||||
}
|
||||
|
||||
@@ -80,6 +87,7 @@ class ArticleController extends Controller
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Articles::getImages($id);
|
||||
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
@@ -87,18 +95,21 @@ class ArticleController extends Controller
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
|
||||
return Articles::deleteImage($id, $index);
|
||||
}
|
||||
|
||||
public function toggleVisible(Request $request)
|
||||
{
|
||||
$data = Articles::toggleVisible($request->input('id'), ($request->input('visible') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function toggleHomepage(Request $request)
|
||||
{
|
||||
$data = Articles::toggleHomepage($request->input('id'), ($request->input('homepage') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Datatables\Shop\ArticleNaturesDataTable;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ArticleNatureController extends Controller
|
||||
{
|
||||
@@ -22,12 +21,14 @@ class ArticleNatureController extends Controller
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -48,6 +49,7 @@ class ArticleNatureController extends Controller
|
||||
public static function getOptions(Request $request)
|
||||
{
|
||||
$data = ArticleNatures::getOptionsByProductTypeModel($request->input('product_type'));
|
||||
|
||||
return response()->json(['0' => ''] + $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Datatables\Shop\CategoriesDataTable;
|
||||
use App\Repositories\Shop\Categories;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Datatables\Shop\CategoriesDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CategoryController extends Controller
|
||||
{
|
||||
@@ -22,18 +21,21 @@ class CategoryController extends Controller
|
||||
'categories' => Categories::getOptions(),
|
||||
'tags_list' => TagGroups::getTreeTags(),
|
||||
];
|
||||
|
||||
return view('Admin.Shop.Categories.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Categories::storeFull($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.Categories.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Categories::get($id);
|
||||
|
||||
return view('Admin.Shop.Categories.view', $data);
|
||||
}
|
||||
|
||||
@@ -42,6 +44,7 @@ class CategoryController extends Controller
|
||||
$data['category'] = Categories::getFull($id);
|
||||
$data['categories'] = Categories::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Shop.Categories.edit', $data);
|
||||
}
|
||||
|
||||
@@ -54,6 +57,7 @@ class CategoryController extends Controller
|
||||
{
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Categories::getImages($id);
|
||||
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
@@ -61,6 +65,7 @@ class CategoryController extends Controller
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
|
||||
return Categories::deleteImage($id, $index);
|
||||
}
|
||||
|
||||
@@ -69,18 +74,21 @@ class CategoryController extends Controller
|
||||
$node_id = $request->input('node_id');
|
||||
$target_id = $request->input('target_id');
|
||||
$type = $request->input('type');
|
||||
|
||||
return Categories::moveTree($node_id, $target_id, $type);
|
||||
}
|
||||
|
||||
public function toggleVisible(Request $request)
|
||||
{
|
||||
$data = Categories::toggle_visible($request->input('id'), ($request->input('visible') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
public function toggleHomepage(Request $request)
|
||||
{
|
||||
$data = Categories::toggleHomepage($request->input('id'), ($request->input('homepage') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\CustomerAddresses;
|
||||
use App\Datatables\Shop\CustomerAddressesDataTable;
|
||||
use App\Repositories\Shop\CustomerAddresses;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CustomerAddressController extends Controller
|
||||
{
|
||||
public function index(CustomerAddressesDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
return $dataTable->render('Admin.Shop.Customers.list', $data);
|
||||
}
|
||||
|
||||
@@ -23,18 +23,21 @@ class CustomerAddressController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = CustomerAddresses::storeFull($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.CustomerAddresses.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['customer'] = CustomerAddresses::get($id);
|
||||
|
||||
return view('Admin.Shop.CustomerAddresses.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['customer'] = CustomerAddresses::edit($id);
|
||||
|
||||
return view('Admin.Shop.CustomerAddresses.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,36 +2,39 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Datatables\Shop\CustomerAddressesDataTable;
|
||||
use App\Datatables\Shop\CustomersDataTable;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Repositories\Shop\Deliveries;
|
||||
use App\Datatables\Shop\CustomersDataTable;
|
||||
use App\Datatables\Shop\CustomerAddressesDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CustomerController extends Controller
|
||||
{
|
||||
public function index(CustomersDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
return $dataTable->render('Admin.Shop.Customers.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['deliveries'] = Deliveries::getOptions();
|
||||
|
||||
return view('Admin.Shop.Customers.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Customers::storeFull($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);
|
||||
}
|
||||
|
||||
@@ -41,6 +44,7 @@ class CustomerController extends Controller
|
||||
$data['deliveries'] = Deliveries::getOptions();
|
||||
$model = new CustomerAddressesDataTable();
|
||||
$data['customer_addresses'] = $model->html();
|
||||
|
||||
return view('Admin.Shop.Customers.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Dashboards;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
|
||||
@@ -2,35 +2,38 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Datatables\Shop\DeliveriesDataTable;
|
||||
use App\Repositories\Shop\Deliveries;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use App\Datatables\Shop\DeliveriesDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DeliveryController extends Controller
|
||||
{
|
||||
public function index(DeliveriesDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
return $dataTable->render('Admin.Shop.Deliveries.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.Deliveries.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Deliveries::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.Deliveries.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['delivery'] = Deliveries::get($id);
|
||||
|
||||
return view('Admin.Shop.Deliveries.view', $data);
|
||||
}
|
||||
|
||||
@@ -38,6 +41,7 @@ class DeliveryController extends Controller
|
||||
{
|
||||
$data['delivery'] = Deliveries::get($id)->toArray();
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.Deliveries.edit', $data);
|
||||
}
|
||||
|
||||
@@ -49,7 +53,7 @@ class DeliveryController extends Controller
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = Deliveries::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Shop\DeliveryPackagesDataTable;
|
||||
use App\Repositories\Shop\DeliveryPackages;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DeliveryPackageController extends Controller
|
||||
{
|
||||
public function index(DeliveryPackagesDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
return $dataTable->render('Admin.Shop.DeliveryPackages.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.DeliveryPackages.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = DeliveryPackages::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.DeliveryPackages.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['delivery'] = DeliveryPackages::get($id);
|
||||
|
||||
return view('Admin.Shop.DeliveryPackages.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['delivery'] = DeliveryPackages::get($id)->toArray();
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.DeliveryPackages.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return DeliveryPackages::destroy($id);
|
||||
}
|
||||
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = DeliveryPackages::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Shop\DeliveryTypeCalculationsDataTable;
|
||||
use App\Repositories\Shop\DeliveryTypeCalculations;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DeliveryTypeCalculationController extends Controller
|
||||
{
|
||||
public function index(DeliveryTypeCalculationsDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
return $dataTable->render('Admin.Shop.DeliveryTypeCalculations.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data = [];
|
||||
|
||||
return view('Admin.Shop.DeliveryTypeCalculations.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = DeliveryTypeCalculations::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.DeliveryTypeCalculations.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['delivery'] = DeliveryTypeCalculations::get($id);
|
||||
|
||||
return view('Admin.Shop.DeliveryTypeCalculations.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['delivery'] = DeliveryTypeCalculations::get($id)->toArray();
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.DeliveryTypeCalculations.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return DeliveryTypeCalculations::destroy($id);
|
||||
}
|
||||
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = DeliveryTypeCalculations::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
59
app/Http/Controllers/Admin/Shop/DeliveryTypeController.php
Normal file
59
app/Http/Controllers/Admin/Shop/DeliveryTypeController.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Datatables\Shop\DeliveryTypesDataTable;
|
||||
use App\Repositories\Shop\DeliveryTypes;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DeliveryTypeController extends Controller
|
||||
{
|
||||
public function index(DeliveryTypesDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
return $dataTable->render('Admin.Shop.DeliveryTypes.list', $data);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.DeliveryTypes.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = DeliveryTypes::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.DeliveryTypes.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['delivery'] = DeliveryTypes::get($id);
|
||||
|
||||
return view('Admin.Shop.DeliveryTypes.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['delivery'] = DeliveryTypes::get($id)->toArray();
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.DeliveryTypes.edit', $data);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
return DeliveryTypes::destroy($id);
|
||||
}
|
||||
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = DeliveryTypes::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -2,10 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Repositories\Shop\Homepages;
|
||||
use App\Datatables\Shop\HomepagesDataTable;
|
||||
use App\Repositories\Shop\Homepages;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomepageController extends Controller
|
||||
{
|
||||
@@ -22,6 +21,7 @@ class HomepageController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Homepages::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.Homepages.index');
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ class HomepageController extends Controller
|
||||
public function edit($id)
|
||||
{
|
||||
$data['homepage'] = Homepages::get($id);
|
||||
|
||||
return view('Admin.Shop.Homepages.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
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;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Invoices;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class InvoiceController extends Controller
|
||||
{
|
||||
@@ -23,12 +22,14 @@ class InvoiceController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Invoices::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.Invoices.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['invoice'] = Invoices::get($id)->toArray();
|
||||
|
||||
return view('Admin.Shop.Invoices.view', $data);
|
||||
}
|
||||
|
||||
@@ -36,6 +37,7 @@ class InvoiceController extends Controller
|
||||
{
|
||||
$data['invoice'] = Invoices::get($id, ['order.customer', 'order.address', 'order.detail'])->toArray();
|
||||
$data['statuses'] = Invoices::statuses();
|
||||
|
||||
return view('Admin.Shop.Invoices.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\InvoiceItem;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
class InvoiceItemController extends Controller
|
||||
{
|
||||
@@ -31,7 +31,6 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
@@ -42,7 +41,6 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(InvoiceItem $invoiceItem)
|
||||
@@ -53,7 +51,6 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(InvoiceItem $invoiceItem)
|
||||
@@ -64,8 +61,6 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, InvoiceItem $invoiceItem)
|
||||
@@ -76,7 +71,6 @@ class InvoiceItemController extends Controller
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\InvoiceItem $invoiceItem
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(InvoiceItem $invoiceItem)
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Datatables\Shop\MerchandisesDataTable;
|
||||
use App\Repositories\Shop\Merchandises;
|
||||
use App\Repositories\Shop\Producers;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Datatables\Shop\MerchandisesDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class MerchandiseController extends Controller
|
||||
{
|
||||
@@ -20,6 +19,7 @@ class MerchandiseController extends Controller
|
||||
{
|
||||
$data['producers_list'] = Producers::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Shop.Merchandises.create', $data);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ class MerchandiseController extends Controller
|
||||
{
|
||||
$data = $request->all();
|
||||
Merchandises::storeFull($data);
|
||||
|
||||
return redirect()->route('Admin.Shop.Merchandises.index');
|
||||
}
|
||||
|
||||
@@ -40,6 +41,7 @@ class MerchandiseController extends Controller
|
||||
$data['merchandise'] = Merchandises::getFull($id);
|
||||
$data['producers_list'] = Producers::getOptions();
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Shop.Merchandises.edit', $data);
|
||||
}
|
||||
|
||||
@@ -53,6 +55,7 @@ class MerchandiseController extends Controller
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Merchandises::getImages($id);
|
||||
$data['can_edit'] = $can_edit;
|
||||
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
@@ -60,6 +63,7 @@ class MerchandiseController extends Controller
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
|
||||
return Merchandises::deleteImage($id, $index);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,16 +2,15 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Datatables\Shop\OffersDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Offers;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\Tariffs;
|
||||
use App\Repositories\Shop\Variations;
|
||||
use App\Datatables\Shop\OffersDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class OfferController extends Controller
|
||||
{
|
||||
@@ -19,6 +18,7 @@ class OfferController extends Controller
|
||||
{
|
||||
$data['article_natures'] = ArticleNatures::getOptions();
|
||||
$data['packages'] = Packages::getOptions();
|
||||
|
||||
return $dataTable->render('Admin.Shop.Offers.list', $data ?? []);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ class OfferController extends Controller
|
||||
$data['articles'] = Articles::getOptionsWithNature();
|
||||
$data['tariffs'] = Tariffs::getOptions();
|
||||
$data['variations'] = Variations::getOptions();
|
||||
|
||||
return view('Admin.Shop.Offers.create', $data);
|
||||
}
|
||||
|
||||
@@ -36,6 +37,7 @@ class OfferController extends Controller
|
||||
$data['articles'] = Articles::getOptionsWithNature();
|
||||
$data['tariffs'] = Tariffs::getOptions();
|
||||
$data['variations'] = Variations::getOptions();
|
||||
|
||||
return view('Admin.Shop.Offers.edit', $data);
|
||||
}
|
||||
|
||||
@@ -43,12 +45,14 @@ class OfferController extends Controller
|
||||
{
|
||||
$data = $request->all();
|
||||
$ret = Offers::store($data);
|
||||
|
||||
return redirect()->route('Admin.Shop.Offers.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data['offer'] = Offers::get($id)->toArray();
|
||||
|
||||
return view('Admin.Shop.Offers.view', $data);
|
||||
}
|
||||
|
||||
@@ -60,25 +64,28 @@ class OfferController extends Controller
|
||||
public function previewArticle($id)
|
||||
{
|
||||
$data['article'] = Articles::getArticle($id);
|
||||
|
||||
return view('Admin.Shop.Offers.partials.article', $data);
|
||||
}
|
||||
|
||||
public function previewVariation($id)
|
||||
{
|
||||
$data['variation'] = Variations::get($id)->toArray();
|
||||
|
||||
return view('Admin.Shop.Offers.partials.variation', $data);
|
||||
}
|
||||
|
||||
public function previewTariff($id)
|
||||
{
|
||||
$data['tariff'] = Tariffs::getPrices($id);
|
||||
|
||||
return view('Admin.Shop.Offers.partials.tariff', $data);
|
||||
}
|
||||
|
||||
public function toggleActive(Request $request)
|
||||
{
|
||||
$data = Offers::toggle_active($request->input('id'), ($request->input('status_id') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
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;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Orders;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class OrderController extends Controller
|
||||
{
|
||||
@@ -23,18 +22,21 @@ class OrderController extends Controller
|
||||
public function show($id)
|
||||
{
|
||||
$data = Orders::get($id);
|
||||
|
||||
return view('Admin.Shop.Orders.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Orders::edit($id);
|
||||
|
||||
return view('Admin.Shop.Orders.edit', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Orders::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.Orders.index');
|
||||
}
|
||||
|
||||
|
||||
@@ -2,42 +2,46 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Datatables\Shop\PackagesDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Datatables\Shop\PackagesDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PackageController extends Controller
|
||||
{
|
||||
public function index(PackagesDataTable $dataTable)
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
|
||||
return $dataTable->render('Admin.Shop.Packages.list', $data);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -45,6 +49,7 @@ class PackageController extends Controller
|
||||
{
|
||||
$data['package'] = Packages::get($id);
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
|
||||
return view('Admin.Shop.Packages.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Datatables\Shop\PriceGenericCategoriesDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\PriceGenericCategories;
|
||||
use App\Datatables\Shop\PriceGenericCategoriesDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PriceGenericCategoryController extends Controller
|
||||
{
|
||||
@@ -19,6 +18,7 @@ class PriceGenericCategoryController extends Controller
|
||||
public function create()
|
||||
{
|
||||
$data['families'] = ArticleNatures::getOptions();
|
||||
|
||||
return view('Admin.Shop.PriceGenericCategories.create', $data);
|
||||
}
|
||||
|
||||
@@ -26,18 +26,21 @@ class PriceGenericCategoryController extends Controller
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,22 +2,20 @@
|
||||
|
||||
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;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\PriceLists;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use App\Repositories\Shop\Tariffs;
|
||||
use App\Repositories\Shop\Taxes;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PriceListController extends Controller
|
||||
{
|
||||
public function index(PriceListsDataTable $dataTable)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
return $dataTable->render('Admin.Shop.PriceLists.list', $data);
|
||||
}
|
||||
|
||||
@@ -25,6 +23,7 @@ class PriceListController extends Controller
|
||||
{
|
||||
$data = [];
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.PriceLists.create', $data);
|
||||
}
|
||||
|
||||
@@ -32,6 +31,7 @@ class PriceListController extends Controller
|
||||
{
|
||||
$data['price_list'] = PriceLists::get($id);
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
|
||||
return view('Admin.Shop.PriceLists.edit', $data);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ class PriceListController extends Controller
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
$data['taxes'] = Taxes::getOptions();
|
||||
|
||||
return view('Admin.Shop.PriceLists.modal', $data);
|
||||
}
|
||||
|
||||
@@ -52,12 +53,14 @@ class PriceListController extends Controller
|
||||
$data['sale_channels'] = SaleChannels::getOptions();
|
||||
$data['statuses'] = Tariffs::getStatuses();
|
||||
$data['taxes'] = Taxes::getOptions();
|
||||
|
||||
return view('Admin.Shop.PriceLists.modal', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = PriceLists::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.PriceLists.index');
|
||||
}
|
||||
|
||||
@@ -65,12 +68,14 @@ class PriceListController extends Controller
|
||||
{
|
||||
$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);
|
||||
}
|
||||
|
||||
@@ -82,6 +87,7 @@ class PriceListController extends Controller
|
||||
public function getPrice($id)
|
||||
{
|
||||
$data['generic'] = PriceLists::getFull($id);
|
||||
|
||||
return view('Admin.Shop.PriceLists.partials.table-prices', $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,21 @@
|
||||
|
||||
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;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\PriceListValueCategories;
|
||||
use App\Repositories\Shop\PriceListValues;
|
||||
use App\Repositories\Shop\Taxes;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PriceListValueController extends Controller
|
||||
{
|
||||
public function index(PriceListValuesDataTable $dataTable)
|
||||
{
|
||||
$data['categories'] = PriceListValueCategories::getOptions();
|
||||
|
||||
return $dataTable->render('Admin.Shop.PriceListValues.list', $data);
|
||||
}
|
||||
|
||||
@@ -26,6 +25,7 @@ class PriceListValueController extends Controller
|
||||
$data['unities'] = Unities::getOptions();
|
||||
$data['taxes_options'] = Taxes::getOptions();
|
||||
$data['categories'] = PriceListValueCategories::getOptions();
|
||||
|
||||
return view('Admin.Shop.PriceListValues.create', $data);
|
||||
}
|
||||
|
||||
@@ -36,18 +36,21 @@ class PriceListValueController extends Controller
|
||||
$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);
|
||||
}
|
||||
|
||||
@@ -59,14 +62,14 @@ class PriceListValueController extends Controller
|
||||
public function getPrice($id)
|
||||
{
|
||||
$data['generic'] = PriceListValues::getFull($id);
|
||||
|
||||
return view('Admin.Shop.PriceListValues.partials.table-prices', $data);
|
||||
}
|
||||
|
||||
public function addPrice($index)
|
||||
{
|
||||
$data['index'] = $index;
|
||||
|
||||
return view('Admin.Shop.PriceListValues.partials.row_price', $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Datatables\Shop\ProducersDataTable;
|
||||
use App\Repositories\Shop\Producers;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Datatables\Shop\ProducersDataTable;
|
||||
|
||||
use App\Models\Shop\Producer;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ProducerController extends Controller
|
||||
{
|
||||
@@ -20,6 +17,7 @@ class ProducerController extends Controller
|
||||
public function create()
|
||||
{
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Shop.Producers.create', $data);
|
||||
}
|
||||
|
||||
@@ -27,6 +25,7 @@ class ProducerController extends Controller
|
||||
{
|
||||
$data = $request->all();
|
||||
Producers::storeFull($data);
|
||||
|
||||
return redirect()->route('Admin.Shop.Producers.index');
|
||||
}
|
||||
|
||||
@@ -39,6 +38,7 @@ class ProducerController extends Controller
|
||||
{
|
||||
$data['producer'] = Producers::getFull($id);
|
||||
$data['tags_list'] = TagGroups::getTreeTags();
|
||||
|
||||
return view('Admin.Shop.Producers.edit', $data);
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ class ProducerController extends Controller
|
||||
$id = $id ? $id : $request->input('id');
|
||||
$data['images'] = Producers::getImages($id);
|
||||
$data['can_edit'] = $can_edit;
|
||||
|
||||
return view('components.uploader.mini-gallery-items', $data);
|
||||
}
|
||||
|
||||
@@ -59,6 +60,7 @@ class ProducerController extends Controller
|
||||
{
|
||||
$id = $request->input('id');
|
||||
$index = $request->input('index');
|
||||
|
||||
return Producers::deleteImage($id, $index);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use App\Datatables\Shop\SaleChannelsDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\SaleChannels;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class SaleChannelController extends Controller
|
||||
{
|
||||
@@ -23,18 +22,21 @@ class SaleChannelController extends Controller
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
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\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use App\Repositories\Shop\Tags;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TagController extends Controller
|
||||
{
|
||||
@@ -20,18 +19,21 @@ class TagController extends Controller
|
||||
{
|
||||
$data = [];
|
||||
$data['tag_groups'] = TagGroups::getOptions();
|
||||
|
||||
return view('Admin.Shop.Tags.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Tags::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.Tags.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Tags::get($id);
|
||||
|
||||
return view('Admin.Shop.Tags.view', $data);
|
||||
}
|
||||
|
||||
@@ -39,6 +41,7 @@ class TagController extends Controller
|
||||
{
|
||||
$data = Tags::get($id);
|
||||
$data['tag_groups'] = TagGroups::getOptions();
|
||||
|
||||
return view('Admin.Shop.Tags.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
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;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\ArticleNatures;
|
||||
use App\Repositories\Shop\TagGroups;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TagGroupController extends Controller
|
||||
{
|
||||
@@ -19,18 +18,21 @@ class TagGroupController extends Controller
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -38,6 +40,7 @@ class TagGroupController extends Controller
|
||||
{
|
||||
$data = TagGroups::get($id);
|
||||
$data['article_families'] = ArticleNatures::getOptions();
|
||||
|
||||
return view('Admin.Shop.TagGroups.edit', $data);
|
||||
}
|
||||
|
||||
@@ -49,7 +52,7 @@ class TagGroupController extends Controller
|
||||
public function toggleVisible(Request $request)
|
||||
{
|
||||
$data = TagGroups::toggleVisible($request->input('id'), ($request->input('visible') == 'true') ? 1 : 0);
|
||||
|
||||
return response()->json(['error' => 0]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Datatables\Shop\PriceListsDataTable;
|
||||
use App\Datatables\Shop\TariffsDataTable;
|
||||
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;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TariffController extends Controller
|
||||
{
|
||||
public function autocomplete(Request $request, $str = false)
|
||||
{
|
||||
$str = $str ? $str : $request->input('q');
|
||||
|
||||
return response()->json(Tariffs::autocomplete($str));
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ class TariffController extends Controller
|
||||
public function show($id)
|
||||
{
|
||||
$data['tariff'] = Tariffs::getFull($id);
|
||||
|
||||
return view('Admin.Shop.Tariffs.view', $data);
|
||||
}
|
||||
|
||||
@@ -57,6 +58,7 @@ class TariffController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Tariffs::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.Tariffs.index');
|
||||
}
|
||||
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
|
||||
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\TariffUnities;
|
||||
use App\Datatables\Shop\TariffUnitiesDataTable;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\TariffUnities;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TariffUnityController extends Controller
|
||||
{
|
||||
@@ -25,18 +22,21 @@ class TariffUnityController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = TariffUnities::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.TariffUnities.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = TariffUnities::get($id);
|
||||
|
||||
return view('Admin.Shop.TariffUnities.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data['tariff_unity'] = TariffUnities::get($id)->toArray();
|
||||
|
||||
return view('Admin.Shop.TariffUnities.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Taxes;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TaxController extends Controller
|
||||
{
|
||||
@@ -22,18 +21,21 @@ class TaxController extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ret = Taxes::store($request->all());
|
||||
|
||||
return redirect()->route('Admin.Shop.Taxes.index');
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
$data = Taxes::get($id);
|
||||
|
||||
return view('Admin.Shop.Taxes.view', $data);
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$data = Taxes::get($id);
|
||||
|
||||
return view('Admin.Shop.Taxes.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
|
||||
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;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UnityController extends Controller
|
||||
{
|
||||
@@ -30,18 +27,21 @@ class UnityController extends Controller
|
||||
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['unity'] = Unities::get($id)->toArray();
|
||||
|
||||
return view('Admin.Shop.Unities.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
|
||||
namespace App\Http\Controllers\Admin\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Datatables\Shop\VariationsDataTable;
|
||||
use App\Repositories\Shop\Packages;
|
||||
use App\Repositories\Shop\Unities;
|
||||
use App\Repositories\Shop\Variations;
|
||||
|
||||
use App\Datatables\Shop\VariationsDataTable;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class VariationController extends Controller
|
||||
{
|
||||
public function autocomplete(Request $request, $str = false)
|
||||
{
|
||||
$str = $str ? $str : $request->input('q');
|
||||
|
||||
return response()->json(Variations::autocomplete($str));
|
||||
}
|
||||
|
||||
@@ -27,6 +26,7 @@ class VariationController extends Controller
|
||||
{
|
||||
$data['packages'] = Packages::getOptions();
|
||||
$data['unities'] = Unities::getOptions();
|
||||
|
||||
return view('Admin.Shop.Variations.create', $data);
|
||||
}
|
||||
|
||||
@@ -35,18 +35,21 @@ class VariationController extends Controller
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers\Shop;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Categories;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
@@ -37,8 +37,10 @@ class LoginController extends Controller
|
||||
|
||||
if ($this->guard()->attempt($credentials, $request->get('remember'))) {
|
||||
$request->session()->regenerate();
|
||||
|
||||
return (back()->getTargetUrl() == route('Shop.login')) ? redirect()->intended(route('home')) : back();
|
||||
}
|
||||
|
||||
return back()->withInput($request->only('email', 'remember'));
|
||||
}
|
||||
|
||||
@@ -47,6 +49,7 @@ class LoginController extends Controller
|
||||
$sessionKey = $this->guard()->getName();
|
||||
$this->guard()->logout();
|
||||
$request->session()->forget($sessionKey);
|
||||
|
||||
return redirect()->route('home');
|
||||
}
|
||||
|
||||
|
||||
@@ -3,22 +3,14 @@
|
||||
namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use App\Repositories\Shop\CustomerAddresses;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use Illuminate\Foundation\Auth\EmailVerificationRequest;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Redirector;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Sebastienheyd\Boilerplate\Rules\Password;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Repositories\Shop\CustomerAddresses;
|
||||
|
||||
use App\Models\Shop\Customer;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
@@ -55,6 +47,7 @@ class RegisterController extends Controller
|
||||
{
|
||||
$user = Customers::create($data);
|
||||
CustomerAddresses::add($user->id, $data);
|
||||
|
||||
return $user;
|
||||
}
|
||||
|
||||
@@ -70,12 +63,14 @@ class RegisterController extends Controller
|
||||
public function emailVerifyRequest(EmailVerificationRequest $request)
|
||||
{
|
||||
$request->fulfill();
|
||||
|
||||
return redirect(route(config('boilerplate.app.redirectTo', 'boilerplate.dashboard')));
|
||||
}
|
||||
|
||||
public function emailSendVerification(Request $request)
|
||||
{
|
||||
$request->user()->sendEmailVerificationNotification();
|
||||
|
||||
return back()->with('message', 'Verification link sent!');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
namespace App\Http\Controllers\Shop\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
use App\Rules\Password as PasswordRules;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user