refactoring of admin datatables

This commit is contained in:
Ludovic CANDELLIER
2023-08-29 22:56:37 +02:00
parent 01f9c9ae7c
commit d750cdced7
15 changed files with 147 additions and 20 deletions

View File

@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Admin\Shop;
use App\Datatables\Shop\ArticlesDataTable;
use App\Datatables\Admin\Shop\ArticlesDataTable;
use App\Repositories\Shop\ArticleNatures;
use App\Repositories\Shop\Articles;
use App\Repositories\Shop\Categories;

View File

@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Admin\Shop;
use App\Datatables\Shop\ArticleNaturesDataTable;
use App\Datatables\Admin\Shop\ArticleNaturesDataTable;
use App\Repositories\Shop\ArticleNatures;
use Illuminate\Http\Request;

View File

@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Admin\Shop;
use App\Datatables\Shop\DeliveriesDataTable;
use App\Datatables\Admin\Shop\DeliveriesDataTable;
use App\Repositories\Shop\Deliveries;
use App\Repositories\Shop\SaleChannels;
use Illuminate\Http\Request;
@@ -11,14 +11,14 @@ class DeliveryController extends Controller
{
public function index(DeliveriesDataTable $dataTable)
{
$data = [];
return $dataTable->render('Admin.Shop.Deliveries.list', $data);
return $dataTable->render('Admin.Shop.Deliveries.list');
}
public function create()
{
$data['sale_channels'] = SaleChannels::getOptions();
$data = [
'sale_channels' => SaleChannels::getOptions(),
];
return view('Admin.Shop.Deliveries.create', $data);
}
@@ -32,15 +32,19 @@ class DeliveryController extends Controller
public function show($id)
{
$data['delivery'] = Deliveries::get($id);
$data = [
'delivery' => Deliveries::get($id),
];
return view('Admin.Shop.Deliveries.view', $data);
}
public function edit($id)
{
$data['delivery'] = Deliveries::get($id)->toArray();
$data['sale_channels'] = SaleChannels::getOptions();
$data = [
'delivery' => Deliveries::get($id)->toArray(),
'sale_channels' => SaleChannels::getOptions(),
];
return view('Admin.Shop.Deliveries.edit', $data);
}

View File

@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Admin\Shop;
use App\Datatables\Shop\InvoicesDataTable;
use App\Datatables\Admin\Shop\InvoicesDataTable;
use App\Http\Controllers\Controller;
use App\Repositories\Shop\Invoices;
use Illuminate\Http\Request;

View File

@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Admin\Shop;
use App\Datatables\Shop\OffersDataTable;
use App\Datatables\Admin\Shop\OffersDataTable;
use App\Http\Controllers\Controller;
use App\Repositories\Shop\ArticleNatures;
use App\Repositories\Shop\Articles;

View File

@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Admin\Shop;
use App\Datatables\Shop\OrdersDataTable;
use App\Datatables\Admin\Shop\OrdersDataTable;
use App\Http\Controllers\Controller;
use App\Repositories\Shop\Orders;
use App\Repositories\Shop\OrderMails;

View File

@@ -2,7 +2,7 @@
namespace App\Http\Controllers\Admin\Shop;
use App\Datatables\Shop\SaleChannelsDataTable;
use App\Datatables\Admin\Shop\SaleChannelsDataTable;
use App\Http\Controllers\Controller;
use App\Repositories\Shop\SaleChannels;
use Illuminate\Http\Request;