Implement Product and ProductCategory Resources: Created new Filament resources for managing products and product categories, including pages for listing, creating, and editing. Added schemas for forms and tables, integrated translation support, and established relationships between products and categories. Enhanced the navigation structure to include product and service links in the frontend menu, improving overall site organization and user experience.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Product;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ProductController extends Controller
|
||||
{
|
||||
public function show($slug)
|
||||
{
|
||||
$product = Product::where('slug', $slug)
|
||||
->where('is_active', true)
|
||||
->with('category')
|
||||
->firstOrFail();
|
||||
|
||||
if ($product->view_template && view()->exists($product->view_template)) {
|
||||
return view($product->view_template, compact('product'));
|
||||
}
|
||||
|
||||
return view('front.products.show', compact('product'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user