Laravelο
Laravel is a web application framework with expressive, elegant syntax. Weβve already laid the foundation β freeing you to create without sweating the small things.
Note
For this guide you should be familiar with the basic concepts of
Licenseο
All relevant legal information can be found here
Prerequisitesο
Weβre using PHP version 8.5:
[isabell@stardust ~]$ uberspace tools version show php
Using 'PHP' version: '8.5'
[isabell@stardust ~]$
Your web domain needs to be set up:
[isabell@stardust ~]$ uberspace web domain list
isabell.uber.space
[isabell@stardust ~]$
Installationο
cd to your user dir, then install the Laravel installer via Composer. Finally, create a new project using the installer and choose your starter kit <https://laravel.com/docs/13.x/starter-kits>.
[isabell@stardust ~]$ cd /var/www/virtual/$USER/
[isabell@stardust isabell]$ composer global require "laravel/installer"
[isabell@stardust isabell]$ laravel new my_project
Use the arrow keys to select your desired starter kit. In this example, weβll proceed without a starter kit. Confirm with Enter.
β Which starter kit would you like to install? βββββββββββββββββ
β None β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Next, choose your testing framework. Weβll use Pest and confirm with Enter.
β Which testing framework do you prefer? βββββββββββββββββββββββ
β Pest β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Now youβll be asked about Laravel Boost, which we donβt need for this guide. Select βNoβ and confirm with Enter.
β Do you want to install Laravel Boost to improve AI assisted coding? β
β No β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Next, select your database. Weβre using MySQL, so select that option. Since we havenβt configured the MySQL credentials yet, select βNoβ when asked to run the default database migrations.
β Which database will your application use? ββββββββββββββββββββ
β MySQL β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Default database updated. Would you like to run the default database migrations? β
β No β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The installer will now create all files for you. Finally, youβll be asked whether to run npm install --ignore-scripts and npm run build. Select βNoβ and confirm. Weβll run these commands later after configuring the database.
Application ready in [my_project]. You can start your local development using:
β cd my_project
β npm install --ignore-scripts && npm run build
β composer run dev
New to Laravel? Check out our documentation. Build something amazing!
[isabell@stardust isabell]$
Change the DocumentRootο
After the installation has finished, remove your unused DocumentRoot and create a new symbolic link to the my_project/public directory.
[isabell@stardust ~]$ cd /var/www/virtual/$USER/
[isabell@stardust isabell]$ rm -f html/nocontent.html; rmdir html
[isabell@stardust isabell]$ ln -s /var/www/virtual/$USER/my_project/public html
[isabell@stardust isabell]$
Configurationο
Set up the databaseο
First figure out your SQL Credentials that uberspace has created for you.
Youβll need your MySQL credentials. Get them with my_print_defaults:
[isabell@stardust ~]$ my_print_defaults client
--default-character-set=utf8mb4
--user=isabell
--password=MySuperSecretPassword
[isabell@stardust ~]$
Youβll need to add this information to the .env file located in the project root directory.
Update the following lines:
APP_NAME=LARAVEL
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=isabell
DB_USERNAME=isabell
DB_PASSWORD=MySuperSecretPassword
Create database tables and build assetsο
The database is still empty. Create the tables defined in the migrations and build the frontend assets:
[isabell@stardust ~]$ cd /var/www/virtual/$USER/my_project
[isabell@stardust my_project]$ php artisan migrate
[isabell@stardust my_project]$ npm install --ignore-scripts && npm run build
When you open your domain, you should now see the Laravel welcome page and are ready to start development.
Tested with Laravel 13, Uberspace 7.17.3, and PHP 8.5
Written by: Felix Wienss <https://github.com/FelixWienss>