Creare un micro servizio in Laravel API centrico che gestisca un CRUD completo e con la lista di elementi paginati
Table of Contents
- PostgreSQL
- php8.2
- composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"
- Laravel10
composer global require laravel/installer
- Laravel Passport -> provides a full OAuth2 server implementation
composer require laravel/passport php artisan passport:install
- optional Laravel Valet -> blazing fast Laravel development environment that uses roughly 7 MB of RAM
composer global require laravel/valet valet install cd ~/Sites valet park
- optional Laravel Telescope -> Telescope provides insight into the requests coming into your application and more.
composer require laravel/telescope php artisan telescope:install
- optional Laravel Horizon -> dashboard Redis queues
composer require laravel/horizon php artisan horizon:install
-
Clone the repo
git clone https://github.com/matte97p/CRUD.git
-
Install packages
composer install
-
Create DB and upload DB Backup
sudo -u postgres psql CREATE DATABASE wefox; CREATE USER mario with PASSWORD 'rossi'; GRANT ALL PRIVILEGES ON DATABASE wefox to mario; php artisan migrate php artisan vendor:publish --tag=passport-migrations php artisan vendor:publish --tag=telescope-migrations
-
Create and start the web server for https://mypath.test/
valet link mypath valet secure mypath
-
Start the web server for http://localhost:8000/.
php artisan serve
PSR 12 DOCS This section of the standard comprises what should be considered the standard coding elements that are required to ensure a high level of technical interoperability between shared PHP code.