Synchro back-office, fix on tariffs
This commit is contained in:
@@ -7,7 +7,15 @@ use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
use App\Repositories\Shop\Categories;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
|
||||
public static function init()
|
||||
{
|
||||
$data['categories'] = Categories::getTree();
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user