PHP - Laravel - インストール - AlmaLinux 9.5 スタータキット - インストール


 クラウディア


1. 概要
2. スタータキットインストール
3. プロジェクト作成
4. npm インストール

1. 概要

 「laravel」スタータキットをインストールします。  本ページは、下記のサイトを参考にさせていただきました。
12.x スターターキット Laravel

2. スタータキットインストール

 「Laravel」のプロジェクトを所有するユーザで。

composer global require laravel/installer
 下記のメッセージが表示され、すぐに終わります。

Changed current directory to /path/.composer
./composer.json has been created
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Lock file operations: 29 installs, 0 updates, 0 removals
  - Locking carbonphp/carbon-doctrine-types (3.2.0)
  - Locking doctrine/inflector (2.0.10)
  - Locking illuminate/collections (v12.8.1)

・・・	略	・・・

  - Locking symfony/translation (v7.2.4)
  - Locking symfony/translation-contracts (v3.5.1)
  - Locking voku/portable-ascii (2.0.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 29 installs, 0 updates, 0 removals
  - Downloading doctrine/inflector (2.0.10)
  - Downloading illuminate/macroable (v12.8.1)
  - Downloading psr/simple-cache (3.0.0)

・・・	略	・・・

  - Downloading symfony/finder (v7.2.2)
  - Downloading illuminate/filesystem (v12.8.1)
  - Downloading laravel/installer (v5.14.2)
  - Installing doctrine/inflector (2.0.10): Extracting archive
  - Installing illuminate/macroable (v12.8.1): Extracting archive
  - Installing psr/simple-cache (3.0.0): Extracting archive

・・・	略	・・・

  - Installing symfony/finder (v7.2.2): Extracting archive
  - Installing illuminate/filesystem (v12.8.1): Extracting archive
  - Installing laravel/installer (v5.14.2): Extracting archive
17 package suggestions were added by new dependencies, use 'composer suggest' to see details.
Generating autoload files
18 packages you are using are looking for funding.
Use the 'composer fund' command to find out more!
No security vulnerability advisories found.
Using version ^5.14 for laravel/installer
 カレントディレクトリがどこにあっても。

~/.composer
 配下へインストールされます。

3. プロジェクト作成

 プロジェクトを作成するディレクトリへ移動して。  プロジェクト名を「project」としてインストールします。

laravel new project
 下記のメッセージが表示されます。  端末の文字をコピペするとこうなっちゃうのですが、「qkxk」等は、罫線のような表示になっています。  事情あって、ここでは、「Vue」を選択して、Enter

   _                               _
  | |                             | |
  | |     __ _ _ __ __ ___   _____| |
  | |    / _` |  __/ _` \ \ / / _ \ |
  | |___| (_| | | | (_| |\ V /  __/ |
  |______\__,_|_|  \__,_| \_/ \___|_|


 l Which starter kit would you like to install? qqqqqqqqqqqqqqqqk
 x ? ● None                                                     x
 x   ○ React                                                    x
 x   ○ Vue                                                      x
 x   ○ Livewire                                                 x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
 ここいら、当然、作成するサイトによって異なるわけですが、とりあえず、わたしが選んだ方法で。  Enter

 l Which starter kit would you like to install? qqqqqqqqqqqqqqqqk
 x Vue                                                          x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

 l Which authentication provider do you prefer? qqqqqqqqqqqqqqqqk
 x ? ● Laravel's built-in authentication                        x
 x   ○ WorkOS (Requires WorkOS account)                         x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj
 Enter

l Which authentication provider do you prefer? qqqqqqqqqqqqqqqqk
 x Laravel's built-in authentication                            x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

 l Which testing framework do you prefer? qqqqqqqqqqqqqqqqqqqqqqk
 x ? ● Pest                                                     x
 x   ○ PHPUnit                                                  x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

 l Which testing framework do you prefer? qqqqqqqqqqqqqqqqqqqqqqk
 x Pest                                                         x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

Creating a "laravel/vue-starter-kit" project at "./project"
Installing laravel/vue-starter-kit (dev-main a9943872d336c33c7b4c349af873c5996c33db52)
  - Downloading laravel/vue-starter-kit (dev-main a994387)
  - Installing laravel/vue-starter-kit (dev-main a994387): Extracting archive
Created project in /var/www/project
> @php -r "file_exists('.env') || copy('.env.example', '.env');"
Loading composer repositories with package information
Updating dependencies
Lock file operations: 112 installs, 0 updates, 0 removals
  - Locking brick/math (0.12.3)
  - Locking carbonphp/carbon-doctrine-types (3.2.0)
  - Locking dflydev/dot-access-data (v3.0.3)

・・・	略	・・・

  - Locking vlucas/phpdotenv (v5.6.1)
  - Locking voku/portable-ascii (2.0.3)
  - Locking webmozart/assert (1.11.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 112 installs, 0 updates, 0 removals
  - Downloading doctrine/lexer (3.0.1)
  - Downloading webmozart/assert (1.11.0)
  - Downloading dragonmantank/cron-expression (v3.4.0)

・・・	略	・・・

  - Downloading myclabs/deep-copy (1.13.0)
  - Downloading phpunit/phpunit (11.5.17)
  - Downloading tightenco/ziggy (v2.5.2)
  - Installing doctrine/inflector (2.0.10): Extracting archive
  - Installing doctrine/lexer (3.0.1): Extracting archive
  - Installing symfony/polyfill-ctype (v1.31.0): Extracting archive

・・・	略	・・・

  - Installing myclabs/deep-copy (1.13.0): Extracting archive
  - Installing phpunit/phpunit (11.5.17): Extracting archive
  - Installing tightenco/ziggy (v2.5.2): Extracting archive
52 package suggestions were added by new dependencies, use 'composer suggest' to see details.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   INFO  Discovering packages.

  inertiajs/inertia-laravel ................................................................................ DONE
  laravel/pail ............................................................................................. DONE
  laravel/sail ............................................................................................. DONE
  laravel/tinker ........................................................................................... DONE
  nesbot/carbon ............................................................................................ DONE
  nunomaduro/collision ..................................................................................... DONE
  nunomaduro/termwind ...................................................................................... DONE
  tightenco/ziggy .......................................................................................... DONE

80 packages you are using are looking for funding.
Use the 'composer fund' command to find out more!
> @php artisan vendor:publish --tag=laravel-assets --ansi --force

   INFO  No publishable resources for tag [laravel-assets].

No security vulnerability advisories found.
> @php artisan key:generate --ansi

   INFO  Application key set successfully.

> @php -r "file_exists('database/database.sqlite') || touch('database/database.sqlite');"
> @php artisan migrate --graceful --ansi

   INFO  Preparing database.

  Creating migration table ......................................................................... 82.22ms DONE

   INFO  Running migrations.

  0001_01_01_000000_create_users_table ............................................................. 92.54ms DONE
  0001_01_01_000001_create_cache_table ............................................................ 168.56ms DONE
  0001_01_01_000002_create_jobs_table .............................................................. 56.04ms DONE

> @php -r "file_exists('.env') || copy('.env.example', '.env');"

   INFO  Application key set successfully.

./composer.json has been updated
Using version ^3.8 for pestphp/pest
Using version ^3.1 for pestphp/pest-plugin-laravel
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies
Lock file operations: 14 installs, 1 update, 0 removals
  - Locking brianium/paratest (v7.8.3)
  - Locking doctrine/deprecations (1.1.5)
  - Locking fidry/cpu-core-counter (1.2.0)

・・・	略	・・・

  - Locking phpdocumentor/reflection-docblock (5.6.2)
  - Locking phpdocumentor/type-resolver (1.10.0)
  - Locking phpstan/phpdoc-parser (2.1.0)
  - Downgrading phpunit/phpunit (11.5.17 => 11.5.15)
  - Locking ta-tikoma/phpunit-architecture-test (0.8.4)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 14 installs, 1 update, 0 removals
  - Downloading pestphp/pest-plugin (v3.0.0)
  - Downloading phpunit/phpunit (11.5.15)
  - Downloading jean85/pretty-package-versions (2.1.1)

・・・	略	・・・

  - Downloading pestphp/pest-plugin-mutate (v3.0.5)
  - Downloading pestphp/pest (v3.8.1)
  - Downloading pestphp/pest-plugin-laravel (v3.1.0)
  - Installing pestphp/pest-plugin (v3.0.0): Extracting archive
  - Downgrading phpunit/phpunit (11.5.17 => 11.5.15): Extracting archive
  - Installing jean85/pretty-package-versions (2.1.1): Extracting archive
  - Installing fidry/cpu-core-counter (1.2.0): Extracting archive
  - Installing brianium/paratest (v7.8.3): Extracting archive

・・・	略	・・・

  - Installing pestphp/pest-plugin-mutate (v3.0.5): Extracting archive
  - Installing pestphp/pest (v3.8.1): Extracting archive
  - Installing pestphp/pest-plugin-laravel (v3.1.0): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   INFO  Discovering packages.

  inertiajs/inertia-laravel ................................................................................ DONE
  laravel/pail ............................................................................................. DONE

・・・	略	・・・

  nunomaduro/termwind ...................................................................................... DONE
  pestphp/pest-plugin-laravel .............................................................................. DONE
  tightenco/ziggy .......................................................................................... DONE

87 packages you are using are looking for funding.
Use the 'composer fund' command to find out more!
> @php artisan vendor:publish --tag=laravel-assets --ansi --force

   INFO  No publishable resources for tag [laravel-assets].

No security vulnerability advisories found.
 「No」を選択して、Enter

 l Would you like to run npm install and npm run build? qqqqqqqqk
 x ● Yes / ○ No                                                 x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

 l Would you like to run npm install and npm run build? qqqqqqqqk
 x No                                                           x
 mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

   INFO  Application ready in [project]. You can start your local development using:

? cd project
? npm install && npm run build
? composer run dev

  New to Laravel? Check out our documentation. Build something amazing!

4. npm インストール

 プロジェクトのディレクトリへ移動して。

cd project
 「npm」のインストール。

npm install && npm run build

npm warn deprecated lodash.isequal@4.5.0: This package is deprecated. Use require('node:util').isDeepStrictEqual instead.

added 288 packages, and audited 289 packages in 24s

76 packages are looking for funding
  run 'npm fund' for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run 'npm audit' for details.
npm notice
npm notice New major version of npm available! 10.9.2 -> 11.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
npm notice To update run: npm install -g npm@11.3.0
npm notice

> build
> vite build

vite v6.2.0 building for production...
? 2415 modules transformed.
public/build/manifest.json                                                         8.84 kB x gzip:  0.96 kB
public/build/assets/app-C5M6dxcd.css                                              72.14 kB x gzip: 12.94 kB
public/build/assets/TextLink.vue_vue_type_script_setup_true_lang-BdrTdHxO.js       0.52 kB x gzip:  0.35 kB

・・・	略	・・・

public/build/assets/Welcome-BQjK8dB3.js                                           47.56 kB x gzip:  8.80 kB
public/build/assets/AppLayout.vue_vue_type_script_setup_true_lang-8U4Py2_e.js    107.62 kB x gzip: 29.93 kB
public/build/assets/app-gJhYva6L.js                                              243.05 kB x gzip: 86.65 kB
? built in 19.23s
 終わったら。

composer run dev

> Composer\Config::disableProcessTimeout
> npx concurrently -c "#93c5fd,#c4b5fd,#fb7185,#fdba74" "php artisan serve" "php artisan queue:listen --tries=1" "php artisan pail --timeout=0" "npm run dev" --names=server,queue,logs,vite
[queue]
[queue]    INFO  Processing jobs from the [default] queue.
[queue]
[logs]
[logs]    INFO  Tailing application logs.                        Press Ctrl+C to exit
[logs]                                                Use -v|-vv to show more details
[vite]
[vite] > dev
[vite] > vite
[vite]
[server]
[server]    INFO  Server running on [http://127.0.0.1:8000].
[server]
[server]   Press Ctrl+C to stop the server
[server]
[vite]
[vite]   VITE v6.2.0  ready in 964 ms
[vite]
[vite]   ?  Local:   http://localhost:5173/
[vite]   ?  Network: use --host to expose
[vite]
[vite]   LARAVEL v12.8.1  plugin v1.2.0
[vite]
[vite]   ?  APP_URL: http://localhost</code></pre>
 これ、試験で動作しているだけのような・・・。  Ctrl+C で終了します。

AbemaTV 無料体験
マイニングベース
Amazonギフトカード
ネットオークションの相場、統計、価格比較といえばオークファン
損保との違い