content.php

Getting started with Laravel

I work with a lot of different languages and frameworks. Sometimes the hardest part of getting started with a new project is trying to recall the setup steps for a particular language or framework – especially after I’ve been immersed for months in a different one.

I wrote this guide to bootstrap getting a Laravel project off the ground.

  • Install PHP (or Xampp with PHP)
  • Add PHP to your environment variables/Path
  • Install Composer https://getcomposer.org/download
  • Create a new Laravel project using composer
    • composer create-project laravel/laravel yourproject “9.*” –prefer-dist
    • replace 9 with whatever version you’d like to use
    • make sure you are in the correct parent directory where you want your project before executing the command
  • cd into your new project directory
  • Test the Laravel server can be launched and works correctly
    • php artisan serve
    • Ctrl+C shuts down the server
  • Blade and Bootstrap are already installed by default
  • Create a new file under resources/views called app.blade.php. This is where you’ll put your base frontend code. You will extend most of your other views from this page.
  • Add your pages and routes.