Sunday, 10 December 2017

How to remove error when first time php artisan migrate is done.


Step1: composer create-project --prefer-dist laravel/laravel project-name

Step2: cd project-name

Step3: composer require laravel/ui

Step4: php artisan ui bootstrap --auth

Step5: npm install && npm run development

Step6: open the .en file write the database name, username and password as below.
DB_DATABASE=demo2
DB_USERNAME=root
DB_PASSWORD=

Step7: Add below line in app/Providers/AppServiceProvider.php

use Illuminate\Support\Facades\Schema;
and replace boot() with below lines

 public function boot()
    {
        Schema::defaultStringlength(100);
    }

*******************************************************
open below files from /database/migrations
create_users_table.php and create_password_resets_table.php

If you want to change the default email length change and update as below.

The migration of password_resets's up() method would look like this:

Schema::create('password_resets', function (Blueprint $table) {
    $table->string('email');
    $table->string('token');
    $table->timestamp('created_at')->nullable();

    $table->unique([DB::raw('email(50)')]);
});

And for the migration of users:

Schema::create('users', function (Blueprint $table) {
    $table->increments('id');
    $table->string('name');
    $table->string('email');
    $table->string('password');
    $table->rememberToken();
    $table->timestamps();

    $table->index([DB::raw('email(50)')]);
});

Step7: run php artisan migrate

Step8: To to remove public from url.

No comments:

Post a Comment

Machine Learning - Potato Leaf Disease Prediction

Step 1: import numpy as np import pandas as pd import splitfolders import matplotlib.pyplot as plt import tensorflow as tf from tensorflow i...