<span style="font-weight: 400;">The ones acquainted with the world of coding might be aware of the sores it can give you. Continuously laying them out one by one can be very tiring as well as complicated. It is times like these when you can make use of effective </span><a href="https://vividreal.com/introduction-to-php-frameworks/"><span style="font-weight: 400;">PHP frameworks</span></a><span style="font-weight: 400;">. </span>

<span style="font-weight: 400;">Laravel is one such framework that helps web developers in creating remarkable web designs using PHP. What makes it stand apart from other similar frameworks is that its compatibility and convenience to use. It also has a number of available features that will help one in developing a rapid web application. </span>

<span style="font-weight: 400;">In this article, we will guide you through the steps in which you can set up your Laravel Application. Sit back and get ready for this beginner’s guide. </span>

<span style="color: #00ccff;"><b>Laravel: Beginners Note</b></span>

<span style="font-weight: 400;">Ever since its initial launch in 2011, Laravel experienced exponential growth. By the year 2015 Laravel became one of the most noted PHP frameworks on GitHub and evolved to be the go-to-go at the global level. The fact that Laravel is focused on the end-user firstly denotes its level of simplicity and clarity on getting the required work accomplished. Brands, as well as individuals, use it to build several projects.</span>

<span style="color: #00ccff;"><b>Steps to set up Laravel</b></span>

<span style="font-weight: 400;">First things first, Laravel is a framework that requires certain system requirements. It is recommended to use the Laravel Homestead virtual machine as your local development environment. In case you are not using Homestead, just make sure that your server possesses the following requirements: </span><span style="font-weight: 400;">PHP &gt;= 7.3, Fileinfo PHP Extension, Tokenizer PHP Extension, PDO PHP Extension, XML PHP Extension, JSON PHP Extension, Ctype PHP Extension, Mbstring PHP Extension, OpenSSL PHP Extension, BCMath PHP Extension. Now let’s look at the steps in installing and setting up Laravel.</span>

<span style="color: #00ccff;"><b>Step 1</b></span>

<span style="font-weight: 400;">Laravel uses a composer to manage its dependencies. Therefore before you install Laravel to your system make sure you have a composer installed in it. You can download the composer from the link given below and then install it on your system. </span><span style="font-weight: 400;"> </span>

<a href="https://getcomposer.org/download/"><span style="font-weight: 400;">Download Composer</span></a>

<span style="color: #00ccff;"><span style="font-weight: 400;"> </span><b>Step 2</b></span>

<span style="font-weight: 400;">Once the composer gets installed, try and check its installation by typing the Composer command in the command prompt.</span>

<img class=" wp-image-9708 aligncenter" src="http://localhost/vividreal/wp-content/uploads/2020/12/pasted-image-0-1-300x192.png" alt="" width="700" height="448" />

<span style="color: #00ccff;"><b>Step 3</b></span>

<span style="font-weight: 400;">Create a new directory somewhere on your computer for the Laravel project that you are going to create. Then, move on to the path where you created the new directory and type the command given below in order to install Laravel. </span>
<pre><span style="font-weight: 400;">composer create-project laravel/laravel –-prefer-dist</span></pre>
<span style="color: #00ccff;"><b>Step 4</b></span>

<span style="font-weight: 400;">You can also install the Laravel framework directly with the develop branch in which the latest frameworks are included. The command to install the complete framework is given below.</span>
<pre><span style="font-weight: 400;">composer create-project laravel/laravel test dev-develop</span></pre>
<span style="color: #00ccff;"><b>Step 5</b></span>

<span style="font-weight: 400;">This command will enable the installation of Laravel in the current directory. By executing the command given below you can start the Laravel services in your system. </span>
<pre><span style="font-weight: 400;">php artisan serve</span></pre>
<span style="color: #00ccff;"><b>Step 6</b></span>

<span style="font-weight: 400;">Once you are done executing the given command you will get to see this window -</span>

<img class=" wp-image-9709 aligncenter" src="https://vividreal.com/wp-content/uploads/2020/12/image-2-300x150.png" alt="" width="700" height="350" />

<span style="color: #00ccff;"><b>Step 7</b></span>

<span style="font-weight: 400;">Now copy the URL given in grey underline ( from the above screenshot ) and open that URL in your browser. </span>

<img class="wp-image-9713 aligncenter" src="http://localhost/vividreal/wp-content/uploads/2021/01/laravel-img-3-300x171.jpg" alt="" width="586" height="334" />

<span style="font-weight: 400;">If this screen is displayed, the installation of laravel has been completed on your system.</span>

<span style="font-weight: 400;">Always keep in mind that Laravel has to be served out of the root of the “web directory” that has been configured for your web server. Never attempt to serve the application out of any subdirectory of “web directory”. Doing this could cause serious issues and could even expose sensitive contents that are in your application. </span>

<span style="color: #00ccff;"><b>Important Steps in Doing Laravel Project </b></span>

<span style="font-weight: 400;">Once you have downloaded and installed the application, let’s get started with a project. If you haven’t created your 1st project during the installation segment, you can create one by executing this command. </span>
<pre><span style="font-weight: 400;">laravel new todo </span></pre>
<span style="color: #00ccff;"><b>1. Database Configuration</b></span>

<span style="font-weight: 400;">A </span><a href="https://vividreal.com/what-are-database-management-systems/"><span style="font-weight: 400;">database</span></a><span style="font-weight: 400;"> is required for our application. Therefore it is best if you can configure the database before attempting anything. You can avail of 4 databases that Laravel supports. They are </span><span style="font-weight: 400;">MySQL, Postgres, SQLite, SQL Server. You can use the .env file to save different credentials and data. </span>

<span style="font-weight: 400;">Laravel has a default .env file at the root where you will find a set of codes. </span>
<pre><span style="font-weight: 400;">DB_CONNECTION=mysql</span></pre>
<pre><span style="font-weight: 400;">DB_HOST=127.0.0.1</span></pre>
<pre><span style="font-weight: 400;">DB_PORT=3306</span></pre>
<pre><span style="font-weight: 400;">DB_DATABASE=homestead</span></pre>
<pre><span style="font-weight: 400;">DB_USERNAME=homestead</span></pre>
<pre><span style="font-weight: 400;">DB_PASSWORD=secret</span></pre>
<span style="font-weight: 400;">What you need to do is replace the above commands with a single one. </span>
<pre><span style="font-weight: 400;">DB_CONNECTION=sqlite</span></pre>
<span style="font-weight: 400;">Now create a file - database.sqlite in your directory</span>

<span style="color: #00ccff;"><b>2. Authentication</b></span>

<span style="font-weight: 400;">Laravel provides authentication scaffolding, and that means everything that is related to authentication, for example, forget the password, user login registration, two-factor authentication, etc. These things will be pre-built according to your needs and are called Laravel Jetstream. The command to install Jetstream is -</span>
<pre><span style="font-weight: 400;">composer require laravel/jetstream</span></pre>
<span style="color: #00ccff;"><b>3. Migrations </b></span>

<span style="font-weight: 400;">Laravel is best in providing you with great ways in designing tables, database schema, tables and to migrate it over different systems. In Laravel, one can conveniently rebuild database structures by using the migration files on production or some other system. For that, you have to execute the given command. </span>
<pre><span style="font-weight: 400;">php artisan make:migration create_tasks_table --create=tasks</span></pre>
<span style="font-weight: 400;">By doing this, you will find your new migration in - database/migration folder. Try adding columns to the tasks table editing the new one. </span>
<pre><span style="font-weight: 400;">public function up()</span></pre>
<pre><span style="font-weight: 400;">  {</span></pre>
<pre><span style="font-weight: 400;">  </span> <span style="font-weight: 400;">  Schema::create('tasks', function (Blueprint $table) {</span></pre>
<pre><span style="font-weight: 400;">  $table-&gt;bigIncrements('id');</span></pre>
<pre><span style="font-weight: 400;">  $table-&gt;string('description');</span></pre>
<pre><span style="font-weight: 400;">  $table-&gt;integer('user_id')-&gt;unsigned()-&gt;index();</span></pre>
<pre><span style="font-weight: 400;">  $table-&gt;timestamps();</span></pre>
<pre><span style="font-weight: 400;">  </span> <span style="font-weight: 400;">  });</span></pre>
<span style="font-weight: 400;">The migrate command will now update the changes that you’ve made to the database. </span>

<span style="color: #00ccff;"><b>4. Controllers </b></span>

<span style="font-weight: 400;">These are used in directing the traffic between models and views. They group multiple request handling logic into one class. They receive a logic-based request which is redirected or return the respective data. The given command creates a controller for tasks.</span>
<pre><span style="font-weight: 400;"> </span><span style="font-weight: 400;">php artisan make:controller TasksController</span></pre>
<span style="font-weight: 400;">This creates a Task Controller. You can locate them in app/Http/Controllers directory.</span>

<span style="color: #00ccff;"><b>Endnote</b></span>

<span style="font-weight: 400;">For beginners and ones without any further experience on web framework might have a slight starting trouble with it. But once you start using it, you are going to love it and probably become addicted to Laravel as it always aims at developing its creative sphere. The word ‘Web Artisan’ is used by Laravel to point out the hidden creativity in a developer’s mind. </span>

<span style="font-weight: 400;">The competition, as well as hype to be on the top of business, is in an accelerating motion these days. Therefore, compromises can never suffice in the case of quality. If you wish to give a mind-blowing face to your website, we can help you </span><a href="https://vividreal.com/web-design/"><span style="font-weight: 400;">craft a stunning website</span></a><span style="font-weight: 400;">.</span>