Hello!
I just installed Tablar on a fresh laravel 10.x project. This project was empty except my Model classes. Looks like all default behaivour is working (login redirect, register, etc..)
Anyway, I want work with a public page, then created a "test.blade.php" with the example snippet in my views directory.
@extends('tablar::page')
@section('content')
<!-- Page header -->
<div class="page-header d-print-none">
<div class="container-xl">
<div class="row g-2 align-items-center">
<div class="col">
<h2 class="page-title">
Empty page
</h2>
</div>
</div>
</div>
</div>
<!-- Page body -->
<div class="page-body">
<div class="container-xl">
@if(config('tablar','display_alert'))
@include('tablar::common.alert')
@endif
<!-- Page Content goes here -->
</div>
</div>
@endsection
I have my HomeController with the next content:
use Illuminate\Http\Request;
class HomeController extends Controller
{
public function __construct()
{
/*
$this
->middleware('auth')
->except(['index']);
*/
}
public function index()
{
return view('test');
}
}
And my web.php file with this content:
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\HomeController;
Auth::routes();
Route::get('/',
[HomeController::class, 'index']
);
Route::get('/home',
[HomeController::class, 'index']
);
When I try enter on my homeController route I get this error:
Attempt to read property "name" on null
this error point in the "@endsection" line on my test.blade.php
I am missing some to config to use this page? When I sign in the app with a user, the template works fine. Maybe it's at the time loading my username on the navbar or something. Can I use this tablar to add some public pages?