Setup
Requirements
Make sure you a have a fresh Laravel 11 project up and running on your browser, without any starter kit. Yes, you can use maryUI with Jetstream/Breeze on your own projects, but let's keep things simple for now and start from the ground.
- Fresh Laravel 11 project up and running.
- No starter kit.
- SQLite database.
laravel new myapp
Install maryUI
Make sure you have selected "Volt" during this install.
composer require robsontenorio/mary php artisan mary:install
Then, start the dev server.
yarn dev # or `npm run dev`
... Check the browser!
We are using Livewire Volt, take a look at:
routes/web.php
resources/views/livewire/users/index.blade.php
.
Improving the example
You have a basic working example, but the data is hardcoded. Let's make it work with a real database and add some new models and relationships.
Creating models has nothing to do with maryUI. So, we have created a command to do it for you and speed things up. After running it, it is important to take a look at the database to see what is going on.
php artisan mary:bootcamp
- Create a new
Country
model. - Create a new
Language
model. - Create a
User
belongs toCountry
relationship. - Create a
User
many-to-manyLanguage
relationship. - Create their respective migrations/factories/seeders.
- Randomly seed the database with users, countries, languages and its relationships.
If you hit the browser again, of course, nothing has changed. On the next topic we will work on that component.