Fix on preview mode
This commit is contained in:
@@ -9,7 +9,13 @@ use App\Datatables\Admin\Core\CommentsDataTable;
|
||||
|
||||
class CommentController extends Controller
|
||||
{
|
||||
public function index(CommentsDataTable $dataTable, $model, $model_id)
|
||||
public function index($model, $model_id)
|
||||
{
|
||||
$data['comments'] = Comments::getCommentsByModel($model, $model_id);
|
||||
return view('Admin.Core.Comments.partials.list-comments', $data);
|
||||
}
|
||||
|
||||
public function list(CommentsDataTable $dataTable, $model, $model_id)
|
||||
{
|
||||
$data['model'] = $model;
|
||||
$data['model_id'] = $model_id;
|
||||
|
||||
@@ -5,7 +5,10 @@ namespace App\Http\Controllers\Admin\Shop;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
use App\Repositories\Shop\Articles;
|
||||
use App\Repositories\Shop\Offers;
|
||||
use App\Repositories\Shop\Tariffs;
|
||||
use App\Repositories\Shop\Variations;
|
||||
use App\Datatables\Shop\OffersDataTable;
|
||||
|
||||
class OfferController extends Controller
|
||||
@@ -17,7 +20,10 @@ class OfferController extends Controller
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('Admin.Shop.Offers.create');
|
||||
$data['articles'] = Articles::getOptions();
|
||||
$data['tariffs'] = Tariffs::getOptions();
|
||||
$data['variations'] = Variations::getOptions();
|
||||
return view('Admin.Shop.Offers.create', $data);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
@@ -44,4 +50,22 @@ class OfferController extends Controller
|
||||
{
|
||||
return Offers::destroy($id);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user