feat: New design and optimization
This commit is contained in:
@@ -4,6 +4,9 @@ namespace App\Http\Controllers\Client;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Carousel;
|
||||
use App\Models\Faq;
|
||||
use App\Models\Product;
|
||||
use App\Models\Testimonial;
|
||||
use Illuminate\Http\Request;
|
||||
use Inertia\Inertia;
|
||||
use Storage;
|
||||
@@ -13,6 +16,7 @@ class HomeController extends Controller
|
||||
public function home()
|
||||
{
|
||||
$carousel = Carousel::all();
|
||||
$testimonail = Testimonial::all();
|
||||
|
||||
|
||||
$response = [
|
||||
@@ -21,6 +25,14 @@ class HomeController extends Controller
|
||||
"alt" => $item->alt,
|
||||
"image_url" => $item->image_url ? asset(Storage::url($item->image_url)) : null,
|
||||
];
|
||||
}),
|
||||
"testimonial" => $testimonail->map(function ($item) {
|
||||
return [
|
||||
"name" => $item->name,
|
||||
"location" => $item->location,
|
||||
"image" => $item->image ? asset(Storage::url($item->image)) : null,
|
||||
"description" => $item->description
|
||||
];
|
||||
})
|
||||
];
|
||||
return Inertia::render('welcome', ['data' => $response]);
|
||||
@@ -28,12 +40,39 @@ class HomeController extends Controller
|
||||
}
|
||||
public function product()
|
||||
{
|
||||
return Inertia::render('product');
|
||||
$product = Product::all();
|
||||
$productResponse = $product->map(function ($item) {
|
||||
return [
|
||||
"id" => $item->id,
|
||||
"title" => $item->title,
|
||||
"type" => $item->type,
|
||||
"image_url" => $item->image_url ? asset(Storage::url($item->image_url)) : null,
|
||||
];
|
||||
});
|
||||
return Inertia::render('product', ['product' => $productResponse]);
|
||||
}
|
||||
public function art()
|
||||
{
|
||||
return Inertia::render('art');
|
||||
}
|
||||
|
||||
public function bespoke()
|
||||
{
|
||||
$product = Product::where("type", "bespoke")->get();
|
||||
$productResponse = $product->map(function ($item) {
|
||||
return [
|
||||
"id" => $item->id,
|
||||
"title" => $item->title,
|
||||
"type" => $item->type,
|
||||
"image_url" => $item->image_url ? asset(Storage::url($item->image_url)) : null,
|
||||
];
|
||||
})->values();
|
||||
return Inertia::render("bespoke", ["product" => $productResponse]);
|
||||
}
|
||||
public function gallery()
|
||||
{
|
||||
return Inertia::render("gallery");
|
||||
}
|
||||
public function contact()
|
||||
{
|
||||
return Inertia::render('contact');
|
||||
|
||||
Reference in New Issue
Block a user