48 lines
981 B
PHP
48 lines
981 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Client;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Carousel;
|
|
use Illuminate\Http\Request;
|
|
use Inertia\Inertia;
|
|
use Storage;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
public function home()
|
|
{
|
|
$carousel = Carousel::all();
|
|
|
|
|
|
$response = [
|
|
"carousel" => $carousel->map(function ($item) {
|
|
return [
|
|
"alt" => $item->alt,
|
|
"image_url" => $item->image_url ? asset(Storage::url($item->image_url)) : null,
|
|
];
|
|
})
|
|
];
|
|
return Inertia::render('welcome', ['data' => $response]);
|
|
|
|
}
|
|
public function product()
|
|
{
|
|
return Inertia::render('product');
|
|
}
|
|
public function art()
|
|
{
|
|
return Inertia::render('art');
|
|
}
|
|
public function contact()
|
|
{
|
|
return Inertia::render('contact');
|
|
}
|
|
|
|
public function faq()
|
|
{
|
|
return Inertia::render('faq');
|
|
}
|
|
|
|
}
|