Readouble

Laravel 9.x インストール

Laravelとの出会いMeet Laravel

Laravelは、表現力豊かでエレガントな構文を備えたWebアプリケーションフレームワークです。Webフレームワークは、アプリケーションを作成するための構造と開始点を提供します。これにより、細部に気を配りながら、すばらしいものの作成に集中できます。Laravel is a web application framework with expressive, elegant syntax. A web framework provides a structure and starting point for creating your application, allowing you to focus on creating something amazing while we sweat the details.

Laravelは、すばらしい開発者エクスペリエンスの提供に努めています。同時に完全な依存注入、表現力豊かなデータベース抽象化レイヤー、キューとジョブのスケジュール、ユニットと統合テストなど、強力な機能もLaravelは提供しています。Laravel strives to provide an amazing developer experience while providing powerful features such as thorough dependency injection, an expressive database abstraction layer, queues and scheduled jobs, unit and integration testing, and more.

PHP Webフレームワークをはじめて使用する場合も、長年の経験を持っている場合でも、Laravelは一緒に成長できるフレームワークです。私たちは皆さんがWeb開発者として最初の一歩を踏み出すのを支援したり、専門知識を次のレベルに引き上げる後押しをしたりしています。あなたが何を作り上げるのか楽しみにしています。Whether you are new to PHP web frameworks or have years of experience, Laravel is a framework that can grow with you. We'll help you take your first steps as a web developer or give you a boost as you take your expertise to the next level. We can't wait to see what you build.

lightbulb Note:Laravelは初めてですか?Laravel Bootcampでは、Laravelのフレームワークを実際に体験しながら、Laravelアプリケーションを構築できます。NoteNew to Laravel? Check out the Laravel Bootcamp[https://bootcamp.laravel.com] for a hands-on tour of the framework while we walk you through building your first Laravel application.

なぜLaravelなのか?Why Laravel?

Webアプリケーションを構築するときに利用できるさまざまなツールとフレームワークがあります。そうした状況でも、Laravelは最新のフルスタックWebアプリケーションを構築するために最良の選択であると私たちは信じています。There are a variety of tools and frameworks available to you when building a web application. However, we believe Laravel is the best choice for building modern, full-stack web applications.

前進するフレームワークA Progressive Framework

私たちはLaravelを「進歩的な」フレームワークと呼んでいます。つまり、Laravelはあなたと一緒に成長するという意味です。もしあなたが、Web開発の最初の一歩を踏み出したばかりの方であれば、Laravelの膨大なドキュメント、ガイド、およびビデオチュートリアルのライブラリが、圧倒されず骨子を学ぶのに役立つでしょう。We like to call Laravel a "progressive" framework. By that, we mean that Laravel grows with you. If you're just taking your first steps into web development, Laravel's vast library of documentation, guides, and video tutorials[https://laracasts.com] will help you learn the ropes without becoming overwhelmed.

開発の上級者でしたら、Laravelの依存注入単体テストキューリアルタイムイベントなど堅牢なツールが役立つでしょう。Laravelは、プロフェッショナルなWebアプリケーションを構築するため調整してあり、エンタープライズにおける作業負荷を処理する準備ができています。If you're a senior developer, Laravel gives you robust tools for dependency injection[/docs/{{version}}/container], unit testing[/docs/{{version}}/testing], queues[/docs/{{version}}/queues], real-time events[/docs/{{version}}/broadcasting], and more. Laravel is fine-tuned for building professional web applications and ready to handle enterprise work loads.

スケーラブルなフレームワークA Scalable Framework

Laravelは素晴らしくスケーラブルです。PHPのスケーリングに適した基本の性質と、Redisなど高速な分散キャッシュシステムに対するLaravelの組み込み済みサポートにより、Laravelを使用した水平スケーリングは簡単です。実際、Laravelアプリケーションは、月あたり数億のリクエストを処理するよう簡単に拡張できます。Laravel is incredibly scalable. Thanks to the scaling-friendly nature of PHP and Laravel's built-in support for fast, distributed cache systems like Redis, horizontal scaling with Laravel is a breeze. In fact, Laravel applications have been easily scaled to handle hundreds of millions of requests per month.

極端なスケーリングが必要ですか? Laravel Vaporのようなプラットフォームを使用すると、AWSの最新のサーバレステクノロジーでほぼ無制限の規模でLaravelアプリケーションを実行できます。Need extreme scaling? Platforms like Laravel Vapor[https://vapor.laravel.com] allow you to run your Laravel application at nearly limitless scale on AWS's latest serverless technology.

コミュニティによるフレームワークA Community Framework

LaravelはPHPエコシステムで最高のパッケージを組み合わせ、もっとも堅牢で開発者に優しいフレームワークとして使用できるように提供しています。さらに、世界中の何千人もの才能ある開発者がフレームワークに貢献しています。多分あなたもLaravelの貢献者になるかもしれませんね。Laravel combines the best packages in the PHP ecosystem to offer the most robust and developer friendly framework available. In addition, thousands of talented developers from around the world have contributed to the framework[https://github.com/laravel/framework]. Who knows, maybe you'll even become a Laravel contributor.

最初のLaravelプロジェクトYour First Laravel Project

最初のLaravelプロジェクトを作成する前に、ローカルマシンにPHPとComposerをインストールしていることを確認してください。macOSで開発している場合、PHPとComposerはHomebrewを使い、インストールできます。さらに、NodeとNPMのインストールもおすすめします。Before creating your first Laravel project, you should ensure that your local machine has PHP and Composer[https://getcomposer.org] installed. If you are developing on macOS, PHP and Composer can be installed via Homebrew[https://brew.sh/]. In addition, we recommend installing Node and NPM[https://nodejs.org].

PHPとComposerをインストールしたら、Composerのcreate-projectコマンドで、Laravelの新規プロジェクトを作成できます。After you have installed PHP and Composer, you may create a new Laravel project via the Composer create-project command:

composer create-project laravel/laravel example-app

または、Composer経由でLaravelインストーラをグローバルインストールすることで、新しいLaravelプロジェクトを作成することもできます。Or, you may create new Laravel projects by globally installing the Laravel installer via Composer:

composer global require laravel/installer

laravel new example-app

プロジェクト作成後、LaravelのArtisan serve CLIコマンドを使用して、Laravelローカル開発サーバを起動します。After the project has been created, start Laravel's local development server using the Laravel's Artisan CLI serve command:

cd example-app

php artisan serve

Artisan開発サーバを起動すると、Webブラウザでhttp://localhost:8000からアプリケーションへアクセスできるようになります。次に、Laravelエコシステムへの次のステップを開始する準備が整いました。もちろん、データベースの設定も必要になります。Once you have started the Artisan development server, your application will be accessible in your web browser at http://localhost:8000. Next, you're ready to start taking your next steps into the Laravel ecosystem[#next-steps]. Of course, you may also want to configure a database[#databases-and-migrations].

lightbulb Note:Laravelアプリケーションを開発する際に、有利なスタートダッシュを切りたければ、スターターキットの1つを使用することを検討してください。Laravelのスターターキットは、新しいLaravelアプリケーションのために、バックエンドとフロントエンド側の認証のスカフォールドを提供します。Note
If you would like a head start when developing your Laravel application, consider using one of our starter kits[/docs/{{version}}/starter-kits]. Laravel's starter kits provide backend and frontend authentication scaffolding for your new Laravel application.

LaravelとDockerLaravel & Docker

皆さんの好みのオペレーティングシステムが何であれ、できるだけ簡単にLaravelを始められるようにしたいと考えています。そのため、ローカルマシンでLaravelプロジェクトを開発・実行するための様々なオプションが用意されています。これらのオプションは後ほど検討していただけますが、LaravelではSailという、Dockerを使用してLaravelプロジェクトを実行する組み込みソリューションを提供しています。We want it to be as easy as possible to get started with Laravel regardless of your preferred operating system. So, there are a variety of options for developing and running a Laravel project on your local machine. While you may wish to explore these options at a later time, Laravel provides Sail[/docs/{{version}}/sail], a built-in solution for running your Laravel project using Docker[https://www.docker.com].

Dockerは、ローカルマシンにインストールしているソフトウェアや構成に干渉しない、小型で軽量の「コンテナ」でアプリケーションとサービスを実行するためのツールです。これはつまり、パーソナルマシン上のWebサーバやデータベースなどの複雑な開発ツールの構成や準備について心配する必要はないことを意味します。開発を開始するには、Docker Desktopをインストールするだけです。Docker is a tool for running applications and services in small, light-weight "containers" which do not interfere with your local machine's installed software or configuration. This means you don't have to worry about configuring or setting up complicated development tools such as web servers and databases on your local machine. To get started, you only need to install Docker Desktop[https://www.docker.com/products/docker-desktop].

Laravel Sailは、LaravelのデフォルトのDocker構成と、操作するための軽量のコマンドラインインターフェイスです。 Sailは、Dockerの経験がなくても、PHP、MySQL、Redisを使用してLaravelアプリケーションを構築するために良い出発点を提供しています。Laravel Sail is a light-weight command-line interface for interacting with Laravel's default Docker configuration. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience.

lightbulb Note:すでにDockerのエキスパートですか?ご心配なく!Laravelが提供するdocker-compose.ymlファイルを使用して、Sailに関するすべてをカスタマイズできます。Note
Already a Docker expert? Don't worry! Everything about Sail can be customized using the docker-compose.yml file included with Laravel.

macOSで始めるGetting Started On macOS

Macで開発していて、Docker Desktopがすでにインストールされているならば、簡単なターミナルコマンドを使用して新しいLaravelプロジェクトを作成できます。たとえば、「example-app」という名前のディレクトリに新しいLaravelアプリケーションを作成するには、ターミナルで以下のコマンドを実行します。If you're developing on a Mac and Docker Desktop[https://www.docker.com/products/docker-desktop] is already installed, you can use a simple terminal command to create a new Laravel project. For example, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal:

curl -s "https://laravel.build/example-app" | bash

もちろん、このURLの"example-app"は好きなように変更できます。ただし、アプリケーション名は英数字とハイフン、アンダーバーだけで構成してください。Laravelアプリケーションのディレクトリは、コマンドを実行したディレクトリ内に作成されます。Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the command from.

Sailのインストールは、Sailのアプリケーションコンテナをローカルマシン上に構築するため、数分かかる場合があります。Sail installation may take several minutes while Sail's application containers are built on your local machine.

プロジェクトを作成したら、アプリケーションディレクトリに移動してLaravel Sailを起動してください。Laravel Sailは、LaravelのデフォルトのDocker構成を操作するためのシンプルなコマンドラインインターフェイスを提供しています。After the project has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration:

cd example-app

./vendor/bin/sail up

アプリケーションのDockerコンテナを開始したら、Webブラウザでアプリケーションのhttp://localhostにアクセスできます。Once the application's Docker containers have been started, you can access the application in your web browser at: http://localhost[http://localhost].

lightbulb Note:Laravel Sailの詳細は、完全なドキュメントで確認してください。Note
To continue learning more about Laravel Sail, review its complete documentation[/docs/{{version}}/sail].

Windowsで始めるGetting Started On Windows

Windowsマシンに新しいLaravelアプリケーションを作成する前に、必ずDocker Desktopをインストールしてください。次に、Windows Subsystem for Linux 2(WSL2)がインストールされ、有効になっていることを確認する必要があります。 WSLを使用すると、Linuxバイナリ実行可能ファイルをWindows 10でネイティブに実行できます。WSL2をインストールして有効にする方法については、Microsoftの開発者環境ドキュメントを参照してください。Before we create a new Laravel application on your Windows machine, make sure to install Docker Desktop[https://www.docker.com/products/docker-desktop]. Next, you should ensure that Windows Subsystem for Linux 2 (WSL2) is installed and enabled. WSL allows you to run Linux binary executables natively on Windows 10. Information on how to install and enable WSL2 can be found within Microsoft's developer environment documentation[https://docs.microsoft.com/en-us/windows/wsl/install-win10].

lightbulb Note:WSL2をインストールして有効にした後、DockerデスクトップがWSL2バックエンドを使用するように構成されていることを確認する必要があります。Note
After installing and enabling WSL2, you should ensure that Docker Desktop is configured to use the WSL2 backend[https://docs.docker.com/docker-for-windows/wsl/].

これで、最初のLaravelプロジェクトを作成する準備が整いました。Windowsターミナルを起動し、WSL2 Linuxオペレーティングシステムの新しいターミナルセッションを開始します。次に、簡単なターミナルコマンドを使用して新しいLaravelプロジェクトを作成してみましょう。たとえば、"example-app"という名前のディレクトリに新しいLaravelアプリケーションを作成するには、ターミナルで以下のコマンドを実行します。Next, you are ready to create your first Laravel project. Launch Windows Terminal[https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab] and begin a new terminal session for your WSL2 Linux operating system. Next, you can use a simple terminal command to create a new Laravel project. For example, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal:

curl -s https://laravel.build/example-app | bash

もちろん、このURLの"example-app"は好きなように変更できます。ただし、アプリケーション名は英数字とハイフン、アンダーバーだけで構成してください。Laravelアプリケーションのディレクトリは、コマンドを実行したディレクトリ内に作成されます。Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the command from.

Sailのインストールは、Sailのアプリケーションコンテナをローカルマシン上に構築するため、数分かかる場合があります。Sail installation may take several minutes while Sail's application containers are built on your local machine.

プロジェクトを作成したら、アプリケーションディレクトリに移動してLaravel Sailを起動してください。Laravel Sailは、LaravelのデフォルトのDocker構成を操作するためのシンプルなコマンドラインインターフェイスを提供しています。After the project has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration:

cd example-app

./vendor/bin/sail up

アプリケーションのDockerコンテナを開始したら、Webブラウザでアプリケーションのhttp://localhostにアクセスできます。Once the application's Docker containers have been started, you can access the application in your web browser at: http://localhost[http://localhost].

lightbulb Note:Laravel Sailの詳細は、完全なドキュメントで確認してください。Note
To continue learning more about Laravel Sail, review its complete documentation[/docs/{{version}}/sail].

WSL2内での開発Developing Within WSL2

もちろん、WSL2インストール内で作成されたLaravelアプリケーションファイルを変更する必要があります。これを実現するには、MicrosoftのVisual Studio Codeエディターとリモート開発用のファーストパーティ拡張機能を使用することをお勧めします。Of course, you will need to be able to modify the Laravel application files that were created within your WSL2 installation. To accomplish this, we recommend using Microsoft's Visual Studio Code[https://code.visualstudio.com] editor and their first-party extension for Remote Development[https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack].

これらのツールをインストールしたら、Windowsターミナルを使用してアプリケーションのルートディレクトリから code .コマンドを実行することで、任意のLaravelプロジェクトを開けます。Once these tools are installed, you may open any Laravel project by executing the code . command from your application's root directory using Windows Terminal.

Linuxで始めるGetting Started On Linux

Linuxで開発しており、Docker Composeがインストール済みの場合は、簡単なターミナルコマンドを使用して新しいLaravelプロジェクトを作成できます。たとえば、"example-app"という名前のディレクトリに新しいLaravelアプリケーションを作成するには、ターミナルで次のコマンドを実行します。If you're developing on Linux and Docker Compose[https://docs.docker.com/compose/install/] is already installed, you can use a simple terminal command to create a new Laravel project. For example, to create a new Laravel application in a directory named "example-app", you may run the following command in your terminal:

curl -s https://laravel.build/example-app | bash

もちろん、このURLの"example-app"は好きなように変更できます。ただし、アプリケーション名は英数字とハイフン、アンダーバーだけで構成してください。Laravelアプリケーションのディレクトリは、コマンドを実行したディレクトリ内に作成されます。Of course, you can change "example-app" in this URL to anything you like - just make sure the application name only contains alpha-numeric characters, dashes, and underscores. The Laravel application's directory will be created within the directory you execute the command from.

Sailのインストールは、Sailのアプリケーションコンテナをローカルマシン上に構築するため、数分かかる場合があります。Sail installation may take several minutes while Sail's application containers are built on your local machine.

プロジェクトを作成したら、アプリケーションディレクトリに移動してLaravel Sailを起動してください。Laravel Sailは、LaravelのデフォルトのDocker構成を操作するためのシンプルなコマンドラインインターフェイスを提供しています。After the project has been created, you can navigate to the application directory and start Laravel Sail. Laravel Sail provides a simple command-line interface for interacting with Laravel's default Docker configuration:

cd example-app

./vendor/bin/sail up

アプリケーションのDockerコンテナを開始したら、Webブラウザでアプリケーションのhttp://localhostにアクセスできます。Once the application's Docker containers have been started, you can access the application in your web browser at: http://localhost[http://localhost].

lightbulb Note:Laravel Sailの詳細は、完全なドキュメントで確認してください。Note
To continue learning more about Laravel Sail, review its complete documentation[/docs/{{version}}/sail].

Sailサービスの選択Choosing Your Sail Services

Sailで新しいLaravelアプリケーションを作成する際に、withというクエリ文字列変数を使って、新しいアプリケーションのdocker-compose.ymlファイルで設定するサービスを選択できます。利用可能なサービスは、mysqlpgsqlmariadbredismemcachedmeilisearchminioseleniummailpitです。When creating a new Laravel application via Sail, you may use the with query string variable to choose which services should be configured in your new application's docker-compose.yml file. Available services include mysql, pgsql, mariadb, redis, memcached, meilisearch, minio, selenium, and mailpit:

curl -s "https://laravel.build/example-app?with=mysql,redis" | bash

設定したいサービスを指定しない場合は、mysqlredismeilisearchmailpitseleniumのデフォルトのスタックが設定されます。If you do not specify which services you would like configured, a default stack of mysql, redis, meilisearch, mailpit, and selenium will be configured.

URLへdevcontainerパラメータを追加し、デフォルトのDevcontainerをインストールするよう、Sailに指示できます。You may instruct Sail to install a default Devcontainer[/docs/{{version}}/sail#using-devcontainers] by adding the devcontainer parameter to the URL:

curl -s "https://laravel.build/example-app?with=mysql,redis&devcontainer" | bash

初期設定Initial Configuration

Laravelフレームワークのすべての設定ファイルは、configディレクトリに格納されています。各オプションにコメントが記述していますので、気兼ねなくファイルに目を通し、利用可能なオプションに馴染んでください。All of the configuration files for the Laravel framework are stored in the config directory. Each option is documented, so feel free to look through the files and get familiar with the options available to you.

Laravelでは、初期の追加設定はほとんど必要ありません。すぐに開発を始められます。しかし、config/app.phpファイルとそのコメントを確認することをお勧めします。このファイルには、timezonelocale など、アプリケーションに応じて更新しておきたいオプションが含まれています。Laravel needs almost no additional configuration out of the box. You are free to get started developing! However, you may wish to review the config/app.php file and its documentation. It contains several options such as timezone and locale that you may wish to change according to your application.

環境ベースの設置Environment Based Configuration

Laravelの設定オプションの値の多くは、アプリケーションがローカルマシンで動作しているか、実働Webサーバで動作しているかにより異なるため、多くの重要な設定値はアプリケーションルートに存在する、.envファイルを用いて定義します。Since many of Laravel's configuration option values may vary depending on whether your application is running on your local machine or on a production web server, many important configuration values are defined using the .env file that exists at the root of your application.

.envファイルは、アプリケーションのソース管理へコミットしてはいけません。なぜなら、アプリケーションを使用する開発者やサーバごとに、異なる環境設定が必要になる可能性があるからです。さらに、侵入者がソースコントロールリポジトリへアクセスした場合、機密情報が漏洩してしまうため、セキュリティリスクにもなります。Your .env file should not be committed to your application's source control, since each developer / server using your application could require a different environment configuration. Furthermore, this would be a security risk in the event an intruder gains access to your source control repository, since any sensitive credentials would get exposed.

lightbulb Note:.envファイルと環境ベースの設定の詳細は、完全な設定ドキュメントをチェックしてください。Note
For more information about the .env file and environment based configuration, check out the full configuration documentation[/docs/{{version}}/configuration#environment-configuration].

データベースとマイグレーションDatabases & Migrations

Laravelアプリケーションを作成したら、データをデータベースへ保存したいと思うことでしょう。アプリケーションの.env設定ファイルはデフォルトで、MySQLデータベースを操作するように指定し、127.0.0.1のデータベースへアクセスするようになっています。macOSで開発しており、MySQL、Postgres、Redisをローカルにインストールする必要がある場合、DBnginを利用すると便利です。Now that you have created your Laravel application, you probably want to store some data in a database. By default, your application's .env configuration file specifies that Laravel will be interacting with a MySQL database and will access the database at 127.0.0.1. If you are developing on macOS and need to install MySQL, Postgres, or Redis locally, you may find it convenient to utilize DBngin[https://dbngin.com/].

ローカルマシンにMySQLやPostgresをインストールしたくない場合は、いつでもSQLiteデータベースを使用できます。SQLiteは小さく、高速で、自己完結型のデータベースエンジンです。使用し始めるには、空のSQLiteファイルを作成することにより、SQLiteデータベースを作成します。通常、このファイルはLaravelアプリケーションのdatabaseディレクトリの中に設置します。If you do not want to install MySQL or Postgres on your local machine, you can always use a SQLite[https://www.sqlite.org/index.html] database. SQLite is a small, fast, self-contained database engine. To get started, create a SQLite database by creating an empty SQLite file. Typically, this file will exist within the database directory of your Laravel application:

touch database/database.sqlite

次に、Laravelがsqliteデータベースドライバを使用するよう、.env設定ファイルを変更します。他のデータベース設定オプションは削除してかまいません。Next, update your .env configuration file to use Laravel's sqlite database driver. You may remove the other database configuration options:

DB_CONNECTION=sqlite # [tl! 追加]
DB_CONNECTION=mysql # [tl! 削除]
DB_HOST=127.0.0.1 # [tl! 削除]
DB_PORT=3306 # [tl! 削除]
DB_DATABASE=laravel # [tl! 削除]
DB_USERNAME=root # [tl! 削除]
DB_PASSWORD= # [tl! 削除]

SQLiteデータベースの設定が終わったら、データベースマイグレーションを実行し、アプリケーションのデータベーステーブルを作成できます。Once you have configured your SQLite database, you may run your application's database migrations[/docs/{{version}}/migrations], which will create your application's database tables:

php artisan migrate

次のステップNext Steps

Laravelプロジェクトを設定し終えて、次に何を学ぶべきか迷っているかもしれません。まず、以下のドキュメントを読み、Laravelの仕組みを理解することを強く推奨いたします。Now that you have created your Laravel project, you may be wondering what to learn next. First, we strongly recommend becoming familiar with how Laravel works by reading the following documentation:

Laravelをどのように使用するかにより、旅の次の行き先も決まります。Laravelを使用するにはさまざまな方法があります。以下では、フレームワークの2つの主要なユースケースについて説明します。How you want to use Laravel will also dictate the next steps on your journey. There are a variety of ways to use Laravel, and we'll explore two primary use cases for the framework below.

lightbulb Note:Laravelは初めてですか?Laravel Bootcampでは、Laravelのフレームワークを実際に体験しながら、Laravelアプリケーションを構築できます。NoteNew to Laravel? Check out the Laravel Bootcamp[https://bootcamp.laravel.com] for a hands-on tour of the framework while we walk you through building your first Laravel application.

LaravelフルスタックフレームワークLaravel The Full Stack Framework

Laravelは、フルスタックフレームワークとして機能させることができます。「フルスタック」フレームワークとは、Laravelを使用して、アプリケーションへのリクエストをルーティングし、BladeテンプレートInertiaなどのシングルページアプリケーションハイブリッド技術でフロントエンドをレンダすることを意味します。これは、Laravelフレームワークの最も一般的な使用方法であり、私たちの意見では、Laravelを使用する最も生産的な方法です。Laravel may serve as a full stack framework. By "full stack" framework we mean that you are going to use Laravel to route requests to your application and render your frontend via Blade templates[/docs/{{version}}/blade] or a single-page application hybrid technology like Inertia[https://inertiajs.com]. This is the most common way to use the Laravel framework, and, in our opinion, the most productive way to use Laravel.

もし、Laravelをどうしようしようかと考えているのであれば、フロントエンド開発ルーティングビューEloquent ORMについてのドキュメントをチェックすると良いかも知れません。さらに、LivewireInertiaといったコミュニティパッケージについても学ぶことに興味があるかもしれません。これらのパッケージにより、Laravelをフルスタックフレームワークとして使用しながら、シングルページのJavaScriptアプリケーションが提供するUIの、利点をたくさん享受できます。If this is how you plan to use Laravel, you may want to check out our documentation on frontend development[/docs/{{version}}/frontend], routing[/docs/{{version}}/routing], views[/docs/{{version}}/views], or the Eloquent ORM[/docs/{{version}}/eloquent]. In addition, you might be interested in learning about community packages like Livewire[https://laravel-livewire.com] and Inertia[https://inertiajs.com]. These packages allow you to use Laravel as a full-stack framework while enjoying many of the UI benefits provided by single-page JavaScript applications.

Laravelをフルスタックフレームワークとして使用している場合、Viteを使用してアプリケーションのCSSとJavaScriptをコンパイルする方法を学ぶのも強く推奨します。If you are using Laravel as a full stack framework, we also strongly encourage you to learn how to compile your application's CSS and JavaScript using Vite[/docs/{{version}}/vite].

lightbulb Note:アプリケーションの構築をすぐに始めたい場合は、公式のアプリケーションスターターキットの1つをチェックしてください。Note
If you want to get a head start building your application, check out one of our official application starter kits[/docs/{{version}}/starter-kits].

Laravel APIバックエンドLaravel The API Backend

Laravelは、JavaScriptシングルページアプリケーションまたはモバイルアプリケーションへのAPIバックエンドとしても機能させることもあります。たとえば、Next.jsアプリケーションのAPIバックエンドとしてLaravelを使用できます。こうした使い方では、Laravelでアプリケーションに認証とデータの保存/取得を提供すると同時に、キュー、メール、通知などのLaravelの強力なサービスを利用できます。Laravel may also serve as an API backend to a JavaScript single-page application or mobile application. For example, you might use Laravel as an API backend for your Next.js[https://nextjs.org] application. In this context, you may use Laravel to provide authentication[/docs/{{version}}/sanctum] and data storage / retrieval for your application, while also taking advantage of Laravel's powerful services such as queues, emails, notifications, and more.

この方法でLaravelの使用を計画している場合は、ルーティングLaravel SanctumEloquent ORMに関するドキュメントを確認することをお勧めします。If this is how you plan to use Laravel, you may want to check out our documentation on routing[/docs/{{version}}/routing], Laravel Sanctum[/docs/{{version}}/sanctum], and the Eloquent ORM[/docs/{{version}}/eloquent].

lightbulb Note:LaravelのバックエンドとNext.jsのフロントエンドのスカフォールドから始める必要がありますか?Laravel Breezeは、APIスタックNext.jsフロントエンド実装を提供しているため、すぐに開始できます。Note
Need a head start scaffolding your Laravel backend and Next.js frontend? Laravel Breeze offers an API stack[/docs/{{version}}/starter-kits#breeze-and-next] as well as a Next.js frontend implementation[https://github.com/laravel/breeze-next] so you can get started in minutes.

章選択

設定

明暗テーマ
light_mode
dark_mode
brightness_auto システム設定に合わせる
テーマ選択
photo_size_select_actual デフォルト
photo_size_select_actual モノクローム(白黒)
photo_size_select_actual Solarized風
photo_size_select_actual GitHub風(青ベース)
photo_size_select_actual Viva(黄緑ベース)
photo_size_select_actual Happy(紫ベース)
photo_size_select_actual Mint(緑ベース)
コードハイライトテーマ選択

明暗テーマごとに、コードハイライトのテーマを指定できます。

テーマ配色確認
スクリーン表示幅
640px
80%
90%
100%

768px以上の幅があるときのドキュメント部分表示幅です。

インデント
無し
1rem
2rem
3rem
原文確認
原文を全行表示
原文を一行ずつ表示
使用しない

※ 段落末のEボタンへカーソルオンで原文をPopupします。

Diff表示形式
色分けのみで区別
行頭の±で区別
削除線と追記で区別

※ [tl!…]形式の挿入削除行の表示形式です。

テストコード表示
両コード表示
Pestのみ表示
PHPUnitのみ表示
和文変換

対象文字列と置換文字列を半角スペースで区切ってください。(最大5組各10文字まで)

本文フォント

総称名以外はCSSと同様に、"〜"でエスケープしてください。

コードフォント

総称名以外はCSSと同様に、"〜"でエスケープしてください。

保存内容リセット

localStrageに保存してある設定項目をすべて削除し、デフォルト状態へ戻します。

ヘッダー項目移動

キーボード操作