In this little serie, we will learn the basics about Laravel through a little application LinKeeper.
It goal is to keep your links and share them to the world.
So, what we need ?
We have to bring solutions to these definitions :
The purpose here is to discover the basic concepts of Laravel and FilamentPHP.
In this serie, I will use Laravel 11 and FilamentPHP 3.
Let's go and beginning with the very basic : the install
As every Laravel project, we have to launch the laravel install.
If you have the laravel installer it's as easy as type laravel new linkeeper
in your favorite terminal.
If you prefer composer, just use this command instead composer create-project laravel/laravel linkeeper
Follow theses steps, which consisting to keep default choices and click enter three times 😉.
As we have choose sqlite as database there is no more configuration needed, except APP_NAME
, APP_TIMEZONE
if you want.
For more simplicity, I let the language setting with default value. Feel free to change it if you need.
Personnaly, I work on Mac with Herd. I can check http://linkeeper.test on my browser.
Everything seems ok !
If you need to work with https
, it's perfectly possible with Herd in a single click.
Go to Herd settings, choose 'Sites' tab and search for your current url. Here : linkeeper.test
.
Look for the lock and click on it to activate https.
Easy, peasy ! No ?
Now, we have to install FilamentPHP. Sincerely, you don't need me for these steps, you just have to look at the incredible documentation of Laravel and Filament.
But, if you are already here, let's keep forwarding together 🤣
So, just copy / paste the 'Get Started' tutorial :
composer require filament/filament:"^3.2" -W
php artisan filament:install --panels
Let the default choice when Filament ask for id :
And voilà! Filament is installed.
We need an user to start play with Filament.
php artisan make:filament-user
Here too, answer questions for your name, email and password.
Let's go to the link provided to ensure that everything is ok.
Enter your credentials and if everything is ok, you will see something like that :
As you can see in the top left corner the name of the app is "Laravel", let's change this for "LinKeeper".
Open your project in your favorite IDE or if you prefer for this minor change, type nano .env
in your terminal.
You just have to change the APP_NAME
key :
If your name has spaces, you have to use the quote for your name.
ctrl + x to exit, say 'yes' when nano asked you if you want to save your file and confirm the name of the file (.env) by pressing return key.
Your .env
file is now saved, you can reload your page and you will see the name of the app changed in the top left corner.
This is the end of this first part. In the next episode, we'll see how to start playing with Filament and models.
Don't hesitate to comment if you have question or if you see a mistake.
Cet article existe aussi en version française 🇫🇷