Readouble

Laravel 8.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 or 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.

なぜ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をできるだけ簡単に使い始められるようにしたいと思っています。自分のコンピューター上でLaravelプロジェクトを開発して実行するためのさまざまな選択肢があります。後でこうしたオプションを検討することもできますが、LaravelはDockerを利用する、Laravelプロジェクトを実行できる組み込みソルーションであるSailを提供しています。We want it to be as easy as possible to get started with Laravel. There are a variety of options for developing and running a Laravel project on your own computer. 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 computer'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 personal computer. 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">Tip!! すでにDockerのエキスパートですか?ご心配なく!Laravelが提供するdocker-compose.ymlファイルを使用して、Sailに関するすべてをカスタマイズできます。{tip} 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. The Laravel application's directory will be created within the directory you execute the command from.

プロジェクトを作成したら、アプリケーションディレクトリに移動して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

Sailのupコマンドをはじめて実行すると、Sailのアプリケーションコンテナがマシン上に構築されます。これには数分かかるでしょう。心配ありません。これ以降のSailの開始・起動は、はるかに高速になります。The first time you run the Sail up command, Sail's application containers will be built on your machine. This could take several minutes. Don't worry, subsequent attempts to start Sail will be much faster.

アプリケーションの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">Tip!! Laravel Sailの詳細は、完全なドキュメントで確認してください。{tip} 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">Tip!! WSL2をインストールして有効にした後、DockerデスクトップがWSL2バックエンドを使用するように構成されていることを確認する必要があります。{tip} 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. The Laravel application's directory will be created within the directory you execute the command from.

プロジェクトを作成したら、アプリケーションディレクトリに移動して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

Sailのupコマンドをはじめて実行すると、Sailのアプリケーションコンテナがマシン上に構築されます。これには数分かかるでしょう。心配ありません。これ以降のSailの開始・起動は、はるかに高速になります。The first time you run the Sail up command, Sail's application containers will be built on your machine. This could take several minutes. Don't worry, subsequent attempts to start Sail will be much faster.

アプリケーションの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">Tip!! Laravel Sailの詳細は、完全なドキュメントで確認してください。{tip} 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. The Laravel application's directory will be created within the directory you execute the command from.

プロジェクトを作成したら、アプリケーションディレクトリへ移動して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

Sailのupコマンドをはじめて実行すると、Sailのアプリケーションコンテナがマシン上に構築されます。これには数分かかるでしょう。心配ありません。これ以降のSailの開始・起動は、はるかに高速になります。The first time you run the Sail up command, Sail's application containers will be built on your machine. This could take several minutes. Don't worry, subsequent attempts to start Sail will be much faster.

アプリケーションの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">Tip!! Laravel Sailの詳細は、完全なドキュメントで確認してください。{tip} 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ファイルで設定するサービスを選択することができます。利用可能なサービスは、mysqlpgsqlmariadbredismemcachedmeilisearchminioseleniummailhogです。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 mailhog:

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

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

ComposerでのインストールInstallation Via Composer

コンピューターにすでにPHPとComposerがインストールされていれば、Composerを直接使用して新しいLaravelプロジェクトを作成できます。アプリケーションを作成したら、Artisan CLIのserveコマンドを使用して、Laravelのローカル開発サーバを起動できます。If your computer already has PHP and Composer installed, you may create a new Laravel project by using Composer directly. After the application has been created, you may start Laravel's local development server using the Artisan CLI's serve command:

composer create-project laravel/laravel:^8.0 example-app

cd example-app

php artisan serve

LaravelインストーラThe Laravel Installer

または、LaravelインストーラをグローバルなComposerのパッケージとしてインストールすることもできます。Or, you may install the Laravel Installer as a global Composer dependency:

composer global require laravel/installer

laravel new example-app

cd example-app

php artisan serve

Composerのシステム全体のvendor/binディレクトリを$PATHに配置して、システムでlaravel実行可能ファイルが見つかるようにしてください。このディレクトリは、オペレーティングシステムに基づいてさまざまな場所に存在します。ただし、一般的には以下の場所にあります。Make sure to place Composer's system-wide vendor bin directory in your $PATH so the laravel executable can be located by your system. This directory exists in different locations based on your operating system; however, some common locations include:

  • macOS: $HOME/.composer/vendor/binmacOS: $HOME/.composer/vendor/bin
  • Windows: %USERPROFILE%\AppData\Roaming\Composer\vendor\binWindows: %USERPROFILE%\AppData\Roaming\Composer\vendor\bin
  • GNU/Linuxディストリビューション: $HOME/.config/composer/vendor/binもしくは$HOME/.composer/vendor/binGNU / Linux Distributions: $HOME/.config/composer/vendor/bin or $HOME/.composer/vendor/bin

便利なように、Laravelインストーラはあなたの新しいプロジェクトのためにGitリポジトリを作成することもできます。Gitリポジトリを作成することを指示するには、新しいプロジェクトを作成するときに--gitフラグを渡します。For convenience, the Laravel installer can also create a Git repository for your new project. To indicate that you want a Git repository to be created, pass the --git flag when creating a new project:

laravel new example-app --git

このコマンドはプロジェクトの新しいGitリポジトリを初期化し、基本的なLaravelのスケルトンを自動的にコミットします。gitフラグは正しくインストールされ、設定したGitを持っていると仮定しています。--branchフラグを使用して最初の分岐名を設定することもできます。This command will initialize a new Git repository for your project and automatically commit the base Laravel skeleton. The git flag assumes you have properly installed and configured Git. You can also use the --branch flag to set the initial branch name:

laravel new example-app --git --branch="main"

--gitフラグを使用する代わりに、--githubフラグを使用してGitリポジトリを作成し、GitHubで対応するプライベートリポジトリを作成することもできます。Instead of using the --git flag, you may also use the --github flag to create a Git repository and also create a corresponding private repository on GitHub:

laravel new example-app --github

作成されたリポジトリはhttps://github.com/<your-account>/example-appで入手できます。githubフラグは、GitHub CLIを正しくインストールし、GitHubで認証されていると仮定しています。さらに、gitがインストールされ、正しく設定されている必要があります。必要に応じて、GitHub CLIがサポートしている追加のフラグを渡せます。The created repository will then be available at https://github.com/<your-account>/example-app. The github flag assumes you have properly installed the GitHub CLI[https://cli.github.com] and are authenticated with GitHub. Additionally, you should have git installed and properly configured. If needed, you can pass additional flags that are supported by the GitHub CLI:

laravel new example-app --github="--public"

--organizationフラグを使用して、特定のGitHubオーガニゼーションの下へリポジトリを作成できます。You may use the --organization flag to create the repository under a specific GitHub organization:

laravel new example-app --github="--public" --organization="laravel"

初期設定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 computer 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">Tip!! .envファイルと環境ベースの設定の詳細については、完全な設定ドキュメントで確認してください。{tip} For more information about the .env file and environment based configuration, check out the full configuration documentation[/docs/{{version}}/configuration#environment-configuration].

ディレクトリ設定Directory Configuration

Laravelは常に、Webサーバで設定する「Webディレクトリ」のルートから提供するべきです。WebディレクトリのサブディレクトリからLaravelアプリケーションを提供しないでください。そうしてしまうと、アプリケーション内に存在する機密ファイルが漏洩する可能性があります。Laravel should always be served out of the root of the "web directory" configured for your web server. You should not attempt to serve a Laravel application out of a subdirectory of the "web directory". Attempting to do so could expose sensitive files that exist within your application.

次のステップ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.

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

Laravelはフルスタックフレームワークとして機能します。「フルスタック」フレームワークとは、Laravelを使用してリクエストをアプリケーションにルーティングし、Bladeテンプレートを介して、もしくはInertia.jsのようなシングルページアプリケーションハイブリッド技術を使用してフロントエンドをレンダーすることを意味します。これは、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 using a single-page application hybrid technology like Inertia.js[https://inertiajs.com]. This is the most common way to use the Laravel framework.

Laravelをこの方法で使用しようと計画している場合は、ルーティングビュー 、またはEloquent ORMに関するドキュメントを確認するのが良いでしょう。さらに、LivewireInertia.jsなどのコミュニティパッケージについて学ぶこともできます。これらのパッケージを使用すると、Laravelをフルスタックフレームワークとして使用しながら、単一ページのJavaScriptアプリケーションによって提供されるUIの利点の多くを享受できます。If this is how you plan to use Laravel, you may want to check out our documentation on 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.js[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をフルスタックフレームワークとして使用する場合は、Laravel Mixを使用してアプリケーションの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 Laravel Mix[/docs/{{version}}/mix].

lightbulb">Tip!! アプリケーションの構築をすぐに始めたい場合は、公式のアプリケーションスターターキットの1つをチェックしてください。{tip} 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">Tip!! LaravelのバックエンドとNext.jsのフロントエンドのスカフォールドから始める必要がありますか?Laravel Breezeは、APIスタックNext.jsフロントエンド実装を提供しているため、すぐに開始できます。{tip} 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!…]形式の挿入削除行の表示形式です。

Pagination和文
ペジネーション
ペギネーション
ページネーション
ページ付け
Scaffold和文
スカフォールド
スキャフォールド
型枠生成
本文フォント

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

コードフォント

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

保存内容リセット

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

ヘッダー項目移動

キーボード操作