Install Jetstream Livewire 2 on Laravel 8 and XAMPP

There is no single source that gets you to a single clean install. Here is my version of a clean FULLY functional installation. END to END. Hope it helps someone else.

How To Create A New Laravel 8 Project with jetstream/livewire on XAMMP

  1. CMD SHELL:
    laravel new projectname
    (It will create the directory so run from the htdocs directory.)

  2. OPTIONAL:
    In the “App/.env” file check/modify the APP_URL and DB_DATABASE
    I haven’t found the APP_URL to have any affect anywhere yet.
    The migrate command below will update the “App/.env” automatically.

  3. CMD SHELL:
    cd projectname
    composer require laravel/jetstream
    php artisan jetstream:install livewire
    composer require livewire/livewire
    npm install && npm run dev
    php artisan make:migration create_projectname_table (creates a db same name as project and adds user auth tables)
    php artisan migrate
    php artisan vendor:publish --force --tag=livewire:config
    php artisan vendor:publish --force --tag=livewire:assets

  4. Open config/livewire.php and change asset_url parameter from NULL to full app path.
    ‘asset_url’ => ‘http://localhost/helloworld/public’,

  5. Open public/mix-manifest.json and add the FULL app path.
    {
    “/js/app.js”: “/helloworld/public/js/app.js”,
    “/css/app.css”: “/helloworld/public/css/app.css”
    }

  6. When you load your new project in a browser you should open an inspection window to check for any errors. I have no warnings and no errors after following these instructions. You will need to register a new user and check for errors DURING and AFTER login. The Welcome Screen DOES NOT call LIVEWIRE. That happens in the layouts/app.blade.php

2 Likes

Finally, I got the solution from here.
Now all CSS and js are working.
thank you

Can’t you just use: laravel new projectname --jet

You will be prompt for livewire or inertia at that point. After all is installed you cd projectname then run: npm install & npm run dev.

I haven’t used XAMPP in some time now, I moved over to Laragon, which has made switching between PHP versions and MySQL versions simple. works great on windows: https://laragon.org/