#Retrieving data using a controller and display it in the frontend.

1 messages · Page 1 of 1 (latest)

past pine
#

What should be my approach.
So I have this controller where it will all the user data I formatted it.

I know to use fetch but what is the Inertia way?

I can do something like this easily

    useEffect(()=>{
        console.log("hey hey");
        fetch('view-all-admins')
        .then((res)=>res.text())
        .then((text)=>{
            console.log(text);
        })
    })
#

Route::get('/view-all-admins',[SuperAdminTaskController::class, 'viewAllAdmins'] )->name('superAdmin.viewAllAdmins');
kindred plinth
#

That's basically against how Inertia works

past pine
kindred plinth
#

You'd render the page with props, yes. But not use fetch to get those users.

#

You'd also want to use pagination probably