avatarConnor Leech

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2177

Abstract

n class="hljs-regexp">/ /</span> _<span class="hljs-regexp">/_/</span><span class="hljs-regexp">/ /</span><span class="hljs-regexp">/ /</span><span class="hljs-regexp">/ ./_</span><span class="hljs-regexp">//_</span><span class="hljs-regexp">//</span> <span class="hljs-regexp">/_/</span> Composer version <span class="hljs-number">1.0</span>-dev (d6ae9a0529e1f39c4c7f9b2f29fff019d79cd1fb) <span class="hljs-number">2015</span><span class="hljs-number">-12</span><span class="hljs-number">-22</span> <span class="hljs-number">20</span>:<span class="hljs-number">44</span>:<span class="hljs-number">41</span></pre></div><h2 id="6a8f">Install laravel</h2><p id="53ba">Next we will use the composer package manager to install the laravel installer. It is like installception.</p><figure id="7a5e"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*j2eXtMt4J2oRKXHrG2L5GQ.jpeg"><figcaption></figcaption></figure><p id="759c">Here’s the command to install laravel with composer.</p><div id="6b73"><pre> composer <span class="hljs-meta">global</span> <span class="hljs-meta">require</span> <span class="hljs-string">"laravel/installer"</span></pre></div><p id="2d29">Next we have to add composer to our computer’s PATH. That means we need to make the “laravel” command available on the terminal. If you are using bash add</p><div id="9da8"><pre><span class="hljs-built_in">export</span> PATH=”<span class="hljs-variable">PATH</span>:<span class="hljs-variable">HOME</span>/.composer/vendor/bin”</pre></div><p id="136e">to the <b>~/.bashrc</b> file. You can do this by opening the file in a text editor:</p><div id="d262"><pre><span class="hljs-meta prompt_"> </span><span class="language-bash">sublime ~/.bashrc</span></pre></div><p id="e099">or</p><div id="d7bd"><pre><span class="hljs-meta prompt_"> </span><span class="language-bash">nano ~/.bashrc</span></pre></div><p id="20bd">Then add the “export …” line to the file that opens up. Save your changes, restart terminal and you will be able to run the “laravel” command and see output.</p><div id="2500"><pre> laravel Laravel Installer <span class="hljs-keyword

Options

">version</span> 1.3.1 Usage: <span class="hljs-keyword">command</span> [options] [arguments] <span class="hljs-string">...</span></pre></div><p id="0264">If you have trouble adding to bashrc check out <a href="http://stackoverflow.com/questions/25373188/laravel-installation-how-to-place-the-composer-vendor-bin-directory-in-your">this post</a>. If you are using Oh My ZSH for terminal instead of bash (you would know it) add the line to <b>/.zshrc </b>instead of <b>/.bashrc</b>.</p><h2 id="328f">Create your first Laravel app</h2><p id="fa9d">Laravel new command will create a new project. The command below creates a folder called “laravel-starter” with a new laravel project inside.</p><div id="0c37"><pre><span class="hljs-variable"> </span>laravel new laravel-starter <span class="hljs-variable"> </span>cd laravel-starter <span class="hljs-variable">$ </span>php artisan serve Laravel development server started on <span class="hljs-symbol">http:</span>/<span class="hljs-regexp">/localhost:8000/</span></pre></div><p id="0cc4">Open your web browser to <a href="http://localhost:8000/">http://localhost:8000/</a> and you’ll see…</p><figure id="05c0"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*A1VZe4QejTj9nom_vCHTdw.png"><figcaption></figcaption></figure><p id="cdf3">Congrats! You are running a laravel web app! Stay tuned for more posts about adding functionality to your laravel app.</p><p id="656a"><b>If you liked this tutorial…</b></p><p id="56c1">Check out a few of my most popular posts from 2015:</p><h1 id="ffda">Make a deck of cards with Django</h1><p id="759e">Django is a python a framework for making web applications. This tutorial will get you up and running with the framework.</p><h1 id="8853">Handle all authentication with Node, Angular and Stormpath</h1><p id="190c">Log users in and out with Google’s angular.js framework, server side javascript and the Stormpath user management service (SaaS).</p><h1 id="291a">Ruby On Rails — Introduction for the total n00b</h1><p id="7610">Get started with Ruby On Rails, another web framework! This one is made out of the Ruby programming language (go figure).</p></article></body>

Get started with Laravel — the PHP web framework for 2016

Laravel 5 released early in 2015

Laravel is a relatively new web framework (2011) for running modern PHP applications. The framework borrows the best concepts from Ruby On Rails with a fast runtime. There is a large developer community because it allows us to be productive and make stuff quickly with minimal hassle. This tutorial will take you from zero to web app in a few minutes!

Install composer

The first step is to getting started is to install composer on your system. I’m running OSX. You can read here about how composer saved the PHP programming language. Composer is a package manager for PHP, making it possible to write many reusable modules. Node.js has npm, Ruby has gems, PHP has composer.

There are options on the install instructions for local and global installs. Install composer globally on your machine.

$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer
$ composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
                    /_/
Composer version 1.0-dev (d6ae9a0529e1f39c4c7f9b2f29fff019d79cd1fb) 2015-12-22 20:44:41

Install laravel

Next we will use the composer package manager to install the laravel installer. It is like installception.

Here’s the command to install laravel with composer.

$ composer global require "laravel/installer"

Next we have to add composer to our computer’s PATH. That means we need to make the “laravel” command available on the terminal. If you are using bash add

export PATH=”$PATH:$HOME/.composer/vendor/bin”

to the ~/.bashrc file. You can do this by opening the file in a text editor:

$ sublime ~/.bashrc

or

$ nano ~/.bashrc

Then add the “export …” line to the file that opens up. Save your changes, restart terminal and you will be able to run the “laravel” command and see output.

$ laravel
Laravel Installer version 1.3.1
Usage:
command [options] [arguments]
...

If you have trouble adding to bashrc check out this post. If you are using Oh My ZSH for terminal instead of bash (you would know it) add the line to ~/.zshrc instead of ~/.bashrc.

Create your first Laravel app

Laravel new command will create a new project. The command below creates a folder called “laravel-starter” with a new laravel project inside.

$ laravel new laravel-starter
$ cd laravel-starter
$ php artisan serve
Laravel development server started on http://localhost:8000/

Open your web browser to http://localhost:8000/ and you’ll see…

Congrats! You are running a laravel web app! Stay tuned for more posts about adding functionality to your laravel app.

If you liked this tutorial…

Check out a few of my most popular posts from 2015:

Make a deck of cards with Django

Django is a python a framework for making web applications. This tutorial will get you up and running with the framework.

Handle all authentication with Node, Angular and Stormpath

Log users in and out with Google’s angular.js framework, server side javascript and the Stormpath user management service (SaaS).

Ruby On Rails — Introduction for the total n00b

Get started with Ruby On Rails, another web framework! This one is made out of the Ruby programming language (go figure).

Laravel
PHP
Web Development
Recommended from ReadMedium