Closed d0004 closed 1 month ago
@d0004 I typically add a code field to the page. Then I set my home page with a code (e.g. 'HOME').
Then I make a HomeController with a route with your localization middleware to get the locale on the route. In the HomeController you can just query the page with the code 'HOME'. Something like (untested ;-)):
class HomeController extends Controller
{
public function index()
{
$page = Page::code('HOME')->firstOrFail();
return view('your_page_view', ['page' => $page]);
}
}
I hope this helps!
I need to create home page using TranslatablePageResource with url like /en or /ru How i can do it? I already tried to create my own SlugField without required flag but when I save page with empty slug, it is generated automatically. Maybe there are other more correct ways to create home page? Because in example project home page is just standard Laravel welcome page.