What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To build a working Laravel app, prepare PHP, Composer, the Laravel installer, and a JavaScript runtime, then create and run a project, add a route and feature, and choose how to deploy it. This tutorial follows the current Laravel 13.x installation documentation; check the official docs for the version you install, since requirements and commands can change.

What you need before starting

Laravel’s installation documentation lists PHP, Composer, and the Laravel installer as prerequisites. For frontend assets, you also need Node and NPM or Bun. Follow the setup instructions for your operating system in the Laravel 13.x installation documentation before creating a project.

Laravel describes a web framework as “a structure and starting point for creating your application,” so you can focus on your app while the framework handles common groundwork. The exact PHP and other version requirements are version-specific; consult the linked installation page rather than assuming requirements from an older tutorial still apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do I create and run a Laravel app?

Create the project

Once the prerequisites are installed, open a terminal in the parent directory where you want the project and run:

laravel new example-app

The installer creates a project directory named example-app. Its prompts and available choices may depend on your Laravel installer version.

Install frontend dependencies and start development

Move into the new directory, compile the frontend assets, and start Laravel’s development environment using the commands shown in the installation guide:

cd example-app
npm install && npm run build
composer run dev

Keep the development process running while you work. Open the local address printed by the command in your browser. If the page does not load, check that the command completed successfully and that you are using the address it reports.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Where do routes and app code live?

Laravel’s directory structure separates core application code, route definitions, and database work. The directory structure documentation describes these key locations:

  • app: core application code, including the classes you use to organize app behavior.
  • routes/web.php: the default file for web routes. These routes receive the web middleware group, which provides session state, CSRF protection, and cookie encryption.
  • routes/console.php: the default file for console routes.
  • database: migrations, model factories, and seeders.

A route connects a request path to behavior. A small route can use a closure; as behavior grows, a controller can keep request handling more organized. Laravel’s routing documentation covers both approaches.

Build a small feature: a task list

A task list is a useful first feature because it exercises the basic parts of an app: a page, a route, stored records, and a user action. Build it incrementally so you can verify each layer before moving to the next.

1. Decide what the first version does

Keep the initial scope small: show tasks and let a user add one. Write down the information each task needs, such as its text and whether it is complete. This gives you a clear model for the records you will store.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

2. Add a route and page

Start by defining the page’s URL in routes/web.php and returning a view or delegating to a controller. Use the route to display a simple task-list page before adding storage. For the exact syntax and view conventions in your installed version, use the Laravel routing documentation.

3. Persist tasks with a migration and model

Use a database migration to describe the task table and an Eloquent model to work with task records. Laravel’s database directory is where migrations and related database files belong. Follow the current migration and Eloquent documentation for commands and code that match your database and Laravel version.

4. Accept and validate a task

When the form submits a new task, validate the incoming value before saving it. Validation rules should reflect the constraints you chose for the task text; do not rely on browser-side checks alone. See Laravel’s validation documentation for request validation patterns.

5. Verify the complete flow

Run the app, submit a task, and confirm it appears in the list after the page reloads. Then try an invalid or empty submission and check that it is rejected appropriately. Laravel’s testing tools can automate these checks; use the testing documentation to add tests once the basic flow works.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When should I add authentication?

Add authentication when tasks should belong to individual users or when access to the app should be restricted. Laravel starter kits provide routes, controllers, and views for registration and authentication, using Laravel Fortify. They offer a scaffold rather than a complete product-specific access policy: decide which pages and records each authenticated user may access, and enforce that in your app. See the starter kits documentation for the current options and setup.

What should I consider before deployment?

Deployment means moving the app from a local development environment to infrastructure where users can reach it. Laravel’s deployment documentation identifies Laravel Cloud as a managed deployment platform and Forge as a service for installing and managing server tools such as Nginx, MySQL, Redis, and Memcached. These descriptions do not establish a cost or feature comparison; evaluate current deployment requirements and details directly in the deployment documentation.

Before launch, make sure the production environment is configured for your app, its database is available, and its secrets are not exposed in source control. Then deploy, open the public site, and exercise the main task-list flow. Treat deployment as a separate step from the local development command: a development server is for building and checking your app, not a production hosting plan.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.