sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.4
sudo apt install php7.4-common php7.4-zip php7.4-bcmath openssl php7.4-json php7.4-mbstring php7.4-xml php7.4-sqlite3
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e0012edf3e80b6978849f5eff0d4b4e4c79ff1609dd1e613307e16318854d24ae64f26d17af3ef0bf7cfb710ca74755a') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
sudo apt-get install nodejs
sudo apt-get install npm
composer global require laravel/installer
export PATH="~/.config/composer/vendor/bin:$PATH"
source ~/.bashrc
laravel new laravel-blog
sudo apt-get install -y curl
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
DB_CONNECTION=sqlite
touch database/database.sqlite
php artisan key:generate
Install and compile assets:
npm install && npm run dev
Run built-in webserver:
php artisan serve
Run database migrations:
php artisan migrate
Run new database migrations:
php artisan migrate:fresh
Clear route cache:
php artisan route:cache
Automatically compile CSS and JS files:
npm run watch
Clear compiled views cache:
php artisan view:clear
Clear app cache:
php artisan cache:clear
Clear config cache:
php artisan config:cache
Open Tinker:
php artisan tinker
Display all users:
User::all();
Create a profile:
$profile = new \App\Profile();
$profile->title = 'This is the title';
$profile->description = 'This is the desc';
$profile->user_id = ;
$profile->save();
Find a user:
$user = App\User::find(1);
php artisan serve
composer require laravel/ui
php artisan ui vue --auth
npm install && npm run dev
touch database/database.sqlite
sudo apt-get install php7.4-sqlite
php artisan migrate
php artisan migrate:fresh
php artisan make:controller ProfileController
php artisan make:model Profile -m
php artisan make:model Post -m
php artisan make:controller PostController
php artisan storage:link
sudo apt-get install php7.4-gd
composer require intervention/image
php artisan make:policy ProfilePolicy -m Profile
php artisan make:controller FollowController
php artisan make:migration creates_profile_user_pivot_table --create profile_user
Installation may have lots of bug with the latest laravel version
composer require laravel/telescope
php artisan telescope:
php artisan migrate
npm install vue2-editor