Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a fairly stock install of the Laravel, jetstream inertia js setup as shown here https://jetstream.laravel.com/2.x/installation.html using command php artisan jetstream:install inertia --teams

I want to show the dashboard to non logged in users. I am using a route without the auth:sanctum', 'verified' middleware, and trying to get the controller to set up the data that the inertia stack needs to fire up when the user IS logged in:

public function getPageDashboard(){
     return Inertia::render('Dashboard', [
        'user' => Auth::user()
     ]);
}

but I'm getting a lot of errors from the front end. "Error in render: "Error: Ziggy error: 'team' parameter is required for route 'teams.show'.""

Basically sanctum? jetstream? inertia? ziggy? sets up a lot of stuff somewhere in the middleware that I have not figured out.

Any ideas on my approach here?

Edit: Here is the web route file:

<?php

use IlluminateFoundationApplication;
use IlluminateSupportFacadesRoute;
use InertiaInertia;

use AppHttpControllersViewController;


/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/dashboard', [ViewController::class, 'getPageDashboard'])->name('dashboard');



question from:https://stackoverflow.com/questions/65909061/laravel-jetstream-inertia-non-authorised-route

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
801 views
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...