#Inertia.post posts, but then refreshes the full page..

1 messages · Page 1 of 1 (latest)

vital pike
#

By refreshing you mean a full page refresh? What's happening in the network tab on devtools?
If it is doing a full page refresh it's probably asset related, as Inertia does a full page refresh after the form is submitted when the assets have changed, see https://inertiajs.com/asset-versioning

sour palm
#

let me check 👀

#

the refresh happens so quick it empties the network tab

#

this happens just before the refresh

vital pike
#

Yeah, then it's doing a full page refresh, otherwise you'd only see XHR requests

sour palm
#

the reason i knew it was doing a full page refresh is, because i have this in my web.php ```
return Redirect::to('/wizard')->with('message', $e->getMessage());

it shows the message and then the page refreshes and the message is gone
#

maybe if i show you what happens on post ->

Route::post('/wizard', function(Request $request) {
    try{
        start_install($request->all()['settings']);
        setEnv('CMS_INSTALLED', 'true');
        return redirect('/');
    }catch(Exception | Error $e){
        return Redirect::to('/wizard')->with('message', $e->getMessage());
    }
});

the start_install function is on my helpers.php file

if( ! function_exists('start_install')){
  function start_install($data){
    setEnv("DB_CONNECTION", 'mysql');
    setEnv("DB_HOST", $data['host']);
    setEnv("DB_PORT", $data['port']);
    setEnv("DB_DATABASE", $data['database']);
    setEnv("DB_USERNAME", $data['username']);
    setEnv("DB_PASSWORD", $data['password']);
    setEnv("CMS_SERVERNAME", $data['general']['server_name']);
    return Artisan::call('migrate');
  }
}

so the try catch is for the Artisan::call, to return any error messages (works flawless) but yet it keeps refreshing

#

oh my lord

#

im editing the .env file, so it keeps restarting the server