skip to Main Content

I’ve followed the tutorial in the Livewire 3, but it only works after starting the server with php artisan serve. I’d live to run it like a regular site with MAMP, because I have a shared hosting and I don’t have access to the terminal. When I try without artisan serve it can’t locate the file http://localhost:8888/livewire/update.

2

Answers


  1. Laravel must be run with the root path.
    Run it with http://***/.
    Remove laravel_counter/public.

    The reason why it is said many times not to use XAMPP or MAMP is because they do not have the necessary settings for Laravel.
    You need to learn about web servers before using Laravel.

    Login or Signup to reply.
  2. in AppServiceProvider boot function, add this code:

    Livewire::setUpdateRoute(function ($handle) {
        return Route::post('/your_directory/public/livewire/update', $handle);
    });
    
    Livewire::setScriptRoute(function ($handle) {
        return config('app.debug') 
            ? Route::get('/your_directory/public/livewire/livewire.js', $handle)
            : Route::get('/your_directory/public/livewire/livewire.min.js', $handle);
    });
    

    replace your_directory with the name of your folder

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search