2025-10-17 14:27:16 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Back;
|
|
|
|
|
|
|
|
|
|
use App\Enums\Contact\ContactFormType;
|
|
|
|
|
use App\Models\ContactCount;
|
|
|
|
|
use Inertia\Inertia;
|
|
|
|
|
use Uwil\LaravelBackend\Resources\CommonResource;
|
|
|
|
|
use Uwil\LaravelCommon\Controllers\Controller;
|
|
|
|
|
|
|
|
|
|
class ContactController extends Controller
|
|
|
|
|
{
|
2025-12-01 15:55:32 +01:00
|
|
|
private $modelName = "contact-counts";
|
|
|
|
|
|
2025-10-17 14:27:16 +02:00
|
|
|
public function index(): \Inertia\Response
|
|
|
|
|
{
|
|
|
|
|
$query = ContactCount::query();
|
|
|
|
|
$contactCountModels = $this->paginate($query);
|
|
|
|
|
$formTypeEnum = ContactFormType::toArray();
|
|
|
|
|
return Inertia::render('ContactCount/Index', [
|
|
|
|
|
'contactCountModels' => CommonResource::collection($contactCountModels),
|
|
|
|
|
'contactFormType' => $formTypeEnum,
|
2025-12-01 15:55:32 +01:00
|
|
|
'modelName' => $this->modelName
|
2025-10-17 14:27:16 +02:00
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|