Sep 24, 2015

Laravel 5 Installation On Windows

Laravel Installation Steps :

1. Download composer File from 

2. install the composer where the php.exe file located.

3. In command prompt enter the location of project. D:\xampp\htdocs\projects

 4. type in cmd prompt D:\xampp\htdocs\projects > composer create-project laravel/laravel laravel-demo (laravel-demo is your project name).

5. After creating project you have to run the project http://localhost/projects/laravel-demo/public (All public files must reside in this ex. js, css etc.. )

6. You can create controller via composer through cmd prompt D:\xampp\htdocs\projects\laravel-demo> php artisan make: controller controllerName.(like model also can create via same instead of controller we will put php artisan make:model modelName). Note : You can also create a controller manually and model also.

7. After creating controller and model you should create file for view page or folder at
       i. Ex. : index.blade.php (blade is must while create php file)

8. To include external css and html file you should install
          D:\xampp\htdocs\projects > composer require illuminate/html.

 After installed this you have to include in config /app.php under provider :
       i. Illuminate\Html\HtmlServiceProvider::class,

 and in b. Alias :
       i. 'Html' => Illuminate\Html\HtmlFacade::class, 
      ii. 'Form' => Illuminate\Html\FormFacade::class 

To include css like
         { !! Html::style(‘css/style.css’) !! }
To include Js like
         { !! Html::script(‘js/jquery.js’) !! }

 9. Then update the composer via D:\xampp\htdocs\projects > composer update. 

10. You can create a table via migration file. To create migration file via
        D:\xampp\htdocs\projects >php artisan make:migration table_name

11. After creating migration file that resides in database/migrations.
       To create table
       Schema::create('users', function (Blueprint $table) {
        $table->string('full_name', 100);
        $table->string('username', 100);
        $table->string('password', 100);

12. Before creating table you must change the database name, username, password in .env file.

No comments:

Post a Comment