This project is created from the examples from on the Livewire website.
This is a Laravel project with Livewire installed. The installation is similar to a new Laravel project.
See Cloning a repository for details on how to create a local copy of this project on your computer.
The project uses Laravel 8, which has a requirement for PHP 8 or higher. Composer is highly recommended installing the dependencies.
From the root of the project run composer install from the command line:
composer install
Create an .env
file from .env.example
cp .env .env
copy .env .env
php artisan key:generate
The Posts
link uses Lorem Ipsum data from a MySQL database or Sqlite database.
For MySql, create a database on your MySql server and add the settings to the .env file:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=YourDatabaseName
DB_USERNAME=YourDatabaseUserName
DB_PASSWORD=YourDatabaseUserPassword
Alternatively create an empty sqlite database and configure Laravel to use Sqlite
touch database/database.sqlite
fsutil file createnew database/database.sqlite 0
Edit the .env file, add sqlite as the DB_CONNECTION and delete all the other DB_* keys.
DB_CONNECTION=sqlite
DB_HOST=127.0.0.1 }
DB_PORT=3306 }
DB_DATABASE=laravel } Delete
DB_USERNAME=root }
DB_PASSWORD= }
The phpunit.xml
file has been configured for Sqlite in memory testing. This requires the pdo_sqlite extension to be
enabled in your php.ini
. If there are any problems enabling the extension remove the following lines, PHPUnit
will then to use the database configured in your .env
file.
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
To make it easy to run all the PHPUnit tests a composer script has been created in composer.json. From the root of the
projects, use composer test
or composer tests
composer test
To use the php web server, run the following artisan command:
php artisan serve
See the message under the serve command for the website name and port, by default it is:
Laravel with Livewire will display, with links to the examples from the Livewire site.
- Posts
See the Livewire site for details or take a look at the source code.
Feel free to leave comments for improvements. At this point this project is still in development, no contributions to the code is required. Feel free to fork or clone or copy for your own use.
The project is open-source software licensed under the MIT license. {"mode":"full","isActive":false}