Basic Configuration of laravel, laravel installation,create Login Registration in laravel

Basic Configuration of laravel, laravel installation,create Login Registration in laravel

We will be building a laravel registration and login system.We also explain how to configure laravel. and how to intall laravel.

step1.

Installing Laravel

first download composer to intall laravel from Click here to download Composer and install laravel.or
you can also create a empty folder and Navigate to it using the command line and execute the following.

composer create-project laravel/laravel ./ --prefer-dist

please check the folder is empty if the folder is not empty it show error message.

step2:

Configuring the Database

after download laravel create basic configuration in laravel.here we are use mysql database so go to app/config/database.php and change the database name and password, password.

The Models

Now create Model in app/models/User.php but user model already created. so we dont need to create model.


use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;

class User extends Eloquent implements UserInterface, RemindableInterface {
    
    

	use UserTrait, RemindableTrait;

	
	protected $table = 'users';

	
	protected $hidden = array('password', 'remember_token');
     
}



step4:

Creating Migrations

create migrations in laravel. The migrations are used to create databse table.so create user table using migrations.Execute the following command in your terminal to create a migration file.
or right click your directory and click on use as composer.

php artisan migrate:make --create="users" CreateUsersTable

Here users is a table name.

step5: Now go to app->database->migrations->2015_01_07_111243_CreateUsersTable.php
2015_01_07_111243_CreateUsersTable.php open file and insert the folling code.


use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration {

	
	public function up()
	{
		Schema::create('users', function(Blueprint $table)
		{
			$table->increments('id');
            $table->string('first_name');
            $table->string('last_name');
            $table->string('email');
            $table->string('password');
            $table->string('remember_token')->nullable();
			$table->timestamps();
		});
	}

	
	public function down()
	{
		Schema::drop('users');
	}

}



step5:Now run migrate the user table useing

php artisan migrate

Now check the user table is created in your database.

Now your laravel Application is fullly configured.

Next Step to Create User Login And Registration

Share Button

About admin

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Author: pramod kumar kumawat Mob: 9269727062
Free WordPress Themes - Download High-quality Templates