selection des produits porteurs par range
This commit is contained in:
parent
8d842fde09
commit
4f9539ff2a
1 changed files with 3 additions and 2 deletions
|
|
@ -3,14 +3,15 @@
|
|||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Product;
|
||||
use App\Models\Range;
|
||||
|
||||
class ProduitsController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$products = Product::all();
|
||||
$ranges = Range::with('products')->orderBy('id')->get();
|
||||
if (view()->exists('front.basic.produits-porteurs')) {
|
||||
return view('front.basic.produits-porteurs', compact('products'));
|
||||
return view('front.basic.produits-porteurs', compact('ranges'));
|
||||
}
|
||||
return redirect()->route('home');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue