Synchro back-office, fix on tariffs

This commit is contained in:
Ludovic CANDELLIER
2021-10-26 21:41:46 +02:00
parent c150be2c3e
commit 86f6ee9a13
45 changed files with 1095 additions and 406 deletions

View File

@@ -6,11 +6,11 @@ use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Repositories\Shop\Categories;
use App\Datatables\Shop\CategoriesDataTable;
use App\Repositories\Shop\Offers;
class CategoryController extends Controller
{
public function index(CategoriesDataTable $dataTable)
public function index()
{
return $dataTable->render('Shop.Categories.list');
}
@@ -22,8 +22,10 @@ class CategoryController extends Controller
public function show($id)
{
$data = Categories::get($id);
return view('Shop.Categories.view', $data);
$data = self::init();
$data['category'] = Categories::getByCategory($id)->toArray();
$data['offers'] = Offers::getByCategory($id)->toArray();
return view('Shop.shelve', $data);
}
public function getTree()

View File

@@ -7,30 +7,19 @@ use App\Http\Controllers\Controller;
use App\Repositories\Shop\Articles;
use App\Repositories\Shop\Categories;
use App\Repositories\Shop\Offers;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
// $this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
$data['categories'] = Categories::getTree();
$data['category'] = Categories::get(15)->toArray();
$data['articles'] = Articles::getByCategory(0)->toArray();
// dump($data);
$data = self::init();
$data['offers'] = Offers::getLast()->toArray();
return view('Shop.home', $data);
}
}