Creating users table in Laravel












0














I have some trouble with the laravel's users table. I already deleted those default table long time ago. And now I am trying to use Auth but I can't register. because there is no table in the database. But also i can't create table with php artisan migrate. because I already deleted those migration tables. So I want create those tables once more. But I couldn't find the default files.



And make:auth is doesn't bring the table... I need to recreate it by myself. I remember there two diffrent tables back then one is users and reset password? Do anyone know where can I get thoese tables again?










share|improve this question


















  • 1




    I suppose you can use the default ones found in the public git to replace the ones you've deleted. While it may not solve your problem completely, it's a good starting point.
    – Andrei
    Nov 12 '18 at 7:14










  • Do you need to create default users table?
    – Oleg Nurutdinov
    Nov 12 '18 at 7:14
















0














I have some trouble with the laravel's users table. I already deleted those default table long time ago. And now I am trying to use Auth but I can't register. because there is no table in the database. But also i can't create table with php artisan migrate. because I already deleted those migration tables. So I want create those tables once more. But I couldn't find the default files.



And make:auth is doesn't bring the table... I need to recreate it by myself. I remember there two diffrent tables back then one is users and reset password? Do anyone know where can I get thoese tables again?










share|improve this question


















  • 1




    I suppose you can use the default ones found in the public git to replace the ones you've deleted. While it may not solve your problem completely, it's a good starting point.
    – Andrei
    Nov 12 '18 at 7:14










  • Do you need to create default users table?
    – Oleg Nurutdinov
    Nov 12 '18 at 7:14














0












0








0







I have some trouble with the laravel's users table. I already deleted those default table long time ago. And now I am trying to use Auth but I can't register. because there is no table in the database. But also i can't create table with php artisan migrate. because I already deleted those migration tables. So I want create those tables once more. But I couldn't find the default files.



And make:auth is doesn't bring the table... I need to recreate it by myself. I remember there two diffrent tables back then one is users and reset password? Do anyone know where can I get thoese tables again?










share|improve this question













I have some trouble with the laravel's users table. I already deleted those default table long time ago. And now I am trying to use Auth but I can't register. because there is no table in the database. But also i can't create table with php artisan migrate. because I already deleted those migration tables. So I want create those tables once more. But I couldn't find the default files.



And make:auth is doesn't bring the table... I need to recreate it by myself. I remember there two diffrent tables back then one is users and reset password? Do anyone know where can I get thoese tables again?







php laravel authentication






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 12 '18 at 7:04









Snickers

349111




349111








  • 1




    I suppose you can use the default ones found in the public git to replace the ones you've deleted. While it may not solve your problem completely, it's a good starting point.
    – Andrei
    Nov 12 '18 at 7:14










  • Do you need to create default users table?
    – Oleg Nurutdinov
    Nov 12 '18 at 7:14














  • 1




    I suppose you can use the default ones found in the public git to replace the ones you've deleted. While it may not solve your problem completely, it's a good starting point.
    – Andrei
    Nov 12 '18 at 7:14










  • Do you need to create default users table?
    – Oleg Nurutdinov
    Nov 12 '18 at 7:14








1




1




I suppose you can use the default ones found in the public git to replace the ones you've deleted. While it may not solve your problem completely, it's a good starting point.
– Andrei
Nov 12 '18 at 7:14




I suppose you can use the default ones found in the public git to replace the ones you've deleted. While it may not solve your problem completely, it's a good starting point.
– Andrei
Nov 12 '18 at 7:14












Do you need to create default users table?
– Oleg Nurutdinov
Nov 12 '18 at 7:14




Do you need to create default users table?
– Oleg Nurutdinov
Nov 12 '18 at 7:14












3 Answers
3






active

oldest

votes


















3














Just run these commands



php artisan make:migration create_users_table
php artisan make:migration create_password_resets_table


In your migration create_users_table



public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}


In your migration create_password_resets_table



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


after that run



php artisan migrate:refresh


PS: This will reset your database
Or just run



php artisan migrate


EDIT: If facing error 1071 Specified key was too long; max key length is 767 bytes



In your AppServiceProvider.php add this



use IlluminateSupportFacadesSchema; //this

public function boot()
{
Schema::defaultStringLength(191); //this
}





share|improve this answer























  • Thank you mate, this is what I want! I check your answer!
    – Snickers
    Nov 12 '18 at 7:16










  • but it's giving me this error: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) when I try to migrate
    – Snickers
    Nov 12 '18 at 7:21










  • edit your AppServiceProvider.php use IlluminateSupportFacadesSchema; public function boot() { Schema::defaultStringLength(191); }
    – Suraj Tiwari
    Nov 12 '18 at 7:22












  • and edit my AppSeriveProvider.php to what?
    – Snickers
    Nov 12 '18 at 7:24










  • Edited answer please check
    – Suraj Tiwari
    Nov 12 '18 at 7:26



















2














You can retrieve those deleted migrations from laravel repository :
https://github.com/laravel/laravel/tree/master/database/migrations



2014_10_12_000000_create_users_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}


2014_10_12_100000_create_password_resets_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}





share|improve this answer



















  • 1




    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Nico Haase
    Nov 12 '18 at 9:02










  • @NicoHaase Thanks for the tip. I updated my answer.
    – AmirhosseinDZ
    Nov 12 '18 at 9:15






  • 1




    Please add some explanation to that code such that others can learn from it
    – Nico Haase
    Nov 12 '18 at 9:19










  • @NicoHaase I think this is clear for one who know laravel, but if I can, sure I will add some explanation.
    – AmirhosseinDZ
    Nov 12 '18 at 9:23



















0














You should run below command:



php artisan make:auth


then run below command



php artisan migrate





share|improve this answer





















  • did you read the question? make auth doesn't bring the users and reset password table
    – Snickers
    Nov 12 '18 at 7:11












  • @Snickers: Please check migration folder you have any users migration file
    – Saurabh Dhariwal
    Nov 12 '18 at 7:11










  • no there isn't. because I delete those long time ago. and make:auth doesn't bring those.
    – Snickers
    Nov 12 '18 at 7:12










  • @Snickers You need to install new fresh version of the laravel and copy the user migration file from new version and past in your current version then you can perform the above command , it will works...
    – Saurabh Dhariwal
    Nov 12 '18 at 7:15













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53257296%2fcreating-users-table-in-laravel%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














Just run these commands



php artisan make:migration create_users_table
php artisan make:migration create_password_resets_table


In your migration create_users_table



public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}


In your migration create_password_resets_table



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


after that run



php artisan migrate:refresh


PS: This will reset your database
Or just run



php artisan migrate


EDIT: If facing error 1071 Specified key was too long; max key length is 767 bytes



In your AppServiceProvider.php add this



use IlluminateSupportFacadesSchema; //this

public function boot()
{
Schema::defaultStringLength(191); //this
}





share|improve this answer























  • Thank you mate, this is what I want! I check your answer!
    – Snickers
    Nov 12 '18 at 7:16










  • but it's giving me this error: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) when I try to migrate
    – Snickers
    Nov 12 '18 at 7:21










  • edit your AppServiceProvider.php use IlluminateSupportFacadesSchema; public function boot() { Schema::defaultStringLength(191); }
    – Suraj Tiwari
    Nov 12 '18 at 7:22












  • and edit my AppSeriveProvider.php to what?
    – Snickers
    Nov 12 '18 at 7:24










  • Edited answer please check
    – Suraj Tiwari
    Nov 12 '18 at 7:26
















3














Just run these commands



php artisan make:migration create_users_table
php artisan make:migration create_password_resets_table


In your migration create_users_table



public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}


In your migration create_password_resets_table



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


after that run



php artisan migrate:refresh


PS: This will reset your database
Or just run



php artisan migrate


EDIT: If facing error 1071 Specified key was too long; max key length is 767 bytes



In your AppServiceProvider.php add this



use IlluminateSupportFacadesSchema; //this

public function boot()
{
Schema::defaultStringLength(191); //this
}





share|improve this answer























  • Thank you mate, this is what I want! I check your answer!
    – Snickers
    Nov 12 '18 at 7:16










  • but it's giving me this error: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) when I try to migrate
    – Snickers
    Nov 12 '18 at 7:21










  • edit your AppServiceProvider.php use IlluminateSupportFacadesSchema; public function boot() { Schema::defaultStringLength(191); }
    – Suraj Tiwari
    Nov 12 '18 at 7:22












  • and edit my AppSeriveProvider.php to what?
    – Snickers
    Nov 12 '18 at 7:24










  • Edited answer please check
    – Suraj Tiwari
    Nov 12 '18 at 7:26














3












3








3






Just run these commands



php artisan make:migration create_users_table
php artisan make:migration create_password_resets_table


In your migration create_users_table



public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}


In your migration create_password_resets_table



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


after that run



php artisan migrate:refresh


PS: This will reset your database
Or just run



php artisan migrate


EDIT: If facing error 1071 Specified key was too long; max key length is 767 bytes



In your AppServiceProvider.php add this



use IlluminateSupportFacadesSchema; //this

public function boot()
{
Schema::defaultStringLength(191); //this
}





share|improve this answer














Just run these commands



php artisan make:migration create_users_table
php artisan make:migration create_password_resets_table


In your migration create_users_table



public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}


In your migration create_password_resets_table



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


after that run



php artisan migrate:refresh


PS: This will reset your database
Or just run



php artisan migrate


EDIT: If facing error 1071 Specified key was too long; max key length is 767 bytes



In your AppServiceProvider.php add this



use IlluminateSupportFacadesSchema; //this

public function boot()
{
Schema::defaultStringLength(191); //this
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 '18 at 7:25

























answered Nov 12 '18 at 7:15









Suraj Tiwari

1017




1017












  • Thank you mate, this is what I want! I check your answer!
    – Snickers
    Nov 12 '18 at 7:16










  • but it's giving me this error: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) when I try to migrate
    – Snickers
    Nov 12 '18 at 7:21










  • edit your AppServiceProvider.php use IlluminateSupportFacadesSchema; public function boot() { Schema::defaultStringLength(191); }
    – Suraj Tiwari
    Nov 12 '18 at 7:22












  • and edit my AppSeriveProvider.php to what?
    – Snickers
    Nov 12 '18 at 7:24










  • Edited answer please check
    – Suraj Tiwari
    Nov 12 '18 at 7:26


















  • Thank you mate, this is what I want! I check your answer!
    – Snickers
    Nov 12 '18 at 7:16










  • but it's giving me this error: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) when I try to migrate
    – Snickers
    Nov 12 '18 at 7:21










  • edit your AppServiceProvider.php use IlluminateSupportFacadesSchema; public function boot() { Schema::defaultStringLength(191); }
    – Suraj Tiwari
    Nov 12 '18 at 7:22












  • and edit my AppSeriveProvider.php to what?
    – Snickers
    Nov 12 '18 at 7:24










  • Edited answer please check
    – Suraj Tiwari
    Nov 12 '18 at 7:26
















Thank you mate, this is what I want! I check your answer!
– Snickers
Nov 12 '18 at 7:16




Thank you mate, this is what I want! I check your answer!
– Snickers
Nov 12 '18 at 7:16












but it's giving me this error: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) when I try to migrate
– Snickers
Nov 12 '18 at 7:21




but it's giving me this error: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) when I try to migrate
– Snickers
Nov 12 '18 at 7:21












edit your AppServiceProvider.php use IlluminateSupportFacadesSchema; public function boot() { Schema::defaultStringLength(191); }
– Suraj Tiwari
Nov 12 '18 at 7:22






edit your AppServiceProvider.php use IlluminateSupportFacadesSchema; public function boot() { Schema::defaultStringLength(191); }
– Suraj Tiwari
Nov 12 '18 at 7:22














and edit my AppSeriveProvider.php to what?
– Snickers
Nov 12 '18 at 7:24




and edit my AppSeriveProvider.php to what?
– Snickers
Nov 12 '18 at 7:24












Edited answer please check
– Suraj Tiwari
Nov 12 '18 at 7:26




Edited answer please check
– Suraj Tiwari
Nov 12 '18 at 7:26













2














You can retrieve those deleted migrations from laravel repository :
https://github.com/laravel/laravel/tree/master/database/migrations



2014_10_12_000000_create_users_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}


2014_10_12_100000_create_password_resets_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}





share|improve this answer



















  • 1




    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Nico Haase
    Nov 12 '18 at 9:02










  • @NicoHaase Thanks for the tip. I updated my answer.
    – AmirhosseinDZ
    Nov 12 '18 at 9:15






  • 1




    Please add some explanation to that code such that others can learn from it
    – Nico Haase
    Nov 12 '18 at 9:19










  • @NicoHaase I think this is clear for one who know laravel, but if I can, sure I will add some explanation.
    – AmirhosseinDZ
    Nov 12 '18 at 9:23
















2














You can retrieve those deleted migrations from laravel repository :
https://github.com/laravel/laravel/tree/master/database/migrations



2014_10_12_000000_create_users_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}


2014_10_12_100000_create_password_resets_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}





share|improve this answer



















  • 1




    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Nico Haase
    Nov 12 '18 at 9:02










  • @NicoHaase Thanks for the tip. I updated my answer.
    – AmirhosseinDZ
    Nov 12 '18 at 9:15






  • 1




    Please add some explanation to that code such that others can learn from it
    – Nico Haase
    Nov 12 '18 at 9:19










  • @NicoHaase I think this is clear for one who know laravel, but if I can, sure I will add some explanation.
    – AmirhosseinDZ
    Nov 12 '18 at 9:23














2












2








2






You can retrieve those deleted migrations from laravel repository :
https://github.com/laravel/laravel/tree/master/database/migrations



2014_10_12_000000_create_users_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}


2014_10_12_100000_create_password_resets_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}





share|improve this answer














You can retrieve those deleted migrations from laravel repository :
https://github.com/laravel/laravel/tree/master/database/migrations



2014_10_12_000000_create_users_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}


2014_10_12_100000_create_password_resets_table.php :



<?php
use IlluminateSupportFacadesSchema;
use IlluminateDatabaseSchemaBlueprint;
use IlluminateDatabaseMigrationsMigration;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 12 '18 at 9:15

























answered Nov 12 '18 at 7:14









AmirhosseinDZ

30319




30319








  • 1




    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Nico Haase
    Nov 12 '18 at 9:02










  • @NicoHaase Thanks for the tip. I updated my answer.
    – AmirhosseinDZ
    Nov 12 '18 at 9:15






  • 1




    Please add some explanation to that code such that others can learn from it
    – Nico Haase
    Nov 12 '18 at 9:19










  • @NicoHaase I think this is clear for one who know laravel, but if I can, sure I will add some explanation.
    – AmirhosseinDZ
    Nov 12 '18 at 9:23














  • 1




    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Nico Haase
    Nov 12 '18 at 9:02










  • @NicoHaase Thanks for the tip. I updated my answer.
    – AmirhosseinDZ
    Nov 12 '18 at 9:15






  • 1




    Please add some explanation to that code such that others can learn from it
    – Nico Haase
    Nov 12 '18 at 9:19










  • @NicoHaase I think this is clear for one who know laravel, but if I can, sure I will add some explanation.
    – AmirhosseinDZ
    Nov 12 '18 at 9:23








1




1




While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
– Nico Haase
Nov 12 '18 at 9:02




While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
– Nico Haase
Nov 12 '18 at 9:02












@NicoHaase Thanks for the tip. I updated my answer.
– AmirhosseinDZ
Nov 12 '18 at 9:15




@NicoHaase Thanks for the tip. I updated my answer.
– AmirhosseinDZ
Nov 12 '18 at 9:15




1




1




Please add some explanation to that code such that others can learn from it
– Nico Haase
Nov 12 '18 at 9:19




Please add some explanation to that code such that others can learn from it
– Nico Haase
Nov 12 '18 at 9:19












@NicoHaase I think this is clear for one who know laravel, but if I can, sure I will add some explanation.
– AmirhosseinDZ
Nov 12 '18 at 9:23




@NicoHaase I think this is clear for one who know laravel, but if I can, sure I will add some explanation.
– AmirhosseinDZ
Nov 12 '18 at 9:23











0














You should run below command:



php artisan make:auth


then run below command



php artisan migrate





share|improve this answer





















  • did you read the question? make auth doesn't bring the users and reset password table
    – Snickers
    Nov 12 '18 at 7:11












  • @Snickers: Please check migration folder you have any users migration file
    – Saurabh Dhariwal
    Nov 12 '18 at 7:11










  • no there isn't. because I delete those long time ago. and make:auth doesn't bring those.
    – Snickers
    Nov 12 '18 at 7:12










  • @Snickers You need to install new fresh version of the laravel and copy the user migration file from new version and past in your current version then you can perform the above command , it will works...
    – Saurabh Dhariwal
    Nov 12 '18 at 7:15


















0














You should run below command:



php artisan make:auth


then run below command



php artisan migrate





share|improve this answer





















  • did you read the question? make auth doesn't bring the users and reset password table
    – Snickers
    Nov 12 '18 at 7:11












  • @Snickers: Please check migration folder you have any users migration file
    – Saurabh Dhariwal
    Nov 12 '18 at 7:11










  • no there isn't. because I delete those long time ago. and make:auth doesn't bring those.
    – Snickers
    Nov 12 '18 at 7:12










  • @Snickers You need to install new fresh version of the laravel and copy the user migration file from new version and past in your current version then you can perform the above command , it will works...
    – Saurabh Dhariwal
    Nov 12 '18 at 7:15
















0












0








0






You should run below command:



php artisan make:auth


then run below command



php artisan migrate





share|improve this answer












You should run below command:



php artisan make:auth


then run below command



php artisan migrate






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 12 '18 at 7:09









Saurabh Dhariwal

1,164113




1,164113












  • did you read the question? make auth doesn't bring the users and reset password table
    – Snickers
    Nov 12 '18 at 7:11












  • @Snickers: Please check migration folder you have any users migration file
    – Saurabh Dhariwal
    Nov 12 '18 at 7:11










  • no there isn't. because I delete those long time ago. and make:auth doesn't bring those.
    – Snickers
    Nov 12 '18 at 7:12










  • @Snickers You need to install new fresh version of the laravel and copy the user migration file from new version and past in your current version then you can perform the above command , it will works...
    – Saurabh Dhariwal
    Nov 12 '18 at 7:15




















  • did you read the question? make auth doesn't bring the users and reset password table
    – Snickers
    Nov 12 '18 at 7:11












  • @Snickers: Please check migration folder you have any users migration file
    – Saurabh Dhariwal
    Nov 12 '18 at 7:11










  • no there isn't. because I delete those long time ago. and make:auth doesn't bring those.
    – Snickers
    Nov 12 '18 at 7:12










  • @Snickers You need to install new fresh version of the laravel and copy the user migration file from new version and past in your current version then you can perform the above command , it will works...
    – Saurabh Dhariwal
    Nov 12 '18 at 7:15


















did you read the question? make auth doesn't bring the users and reset password table
– Snickers
Nov 12 '18 at 7:11






did you read the question? make auth doesn't bring the users and reset password table
– Snickers
Nov 12 '18 at 7:11














@Snickers: Please check migration folder you have any users migration file
– Saurabh Dhariwal
Nov 12 '18 at 7:11




@Snickers: Please check migration folder you have any users migration file
– Saurabh Dhariwal
Nov 12 '18 at 7:11












no there isn't. because I delete those long time ago. and make:auth doesn't bring those.
– Snickers
Nov 12 '18 at 7:12




no there isn't. because I delete those long time ago. and make:auth doesn't bring those.
– Snickers
Nov 12 '18 at 7:12












@Snickers You need to install new fresh version of the laravel and copy the user migration file from new version and past in your current version then you can perform the above command , it will works...
– Saurabh Dhariwal
Nov 12 '18 at 7:15






@Snickers You need to install new fresh version of the laravel and copy the user migration file from new version and past in your current version then you can perform the above command , it will works...
– Saurabh Dhariwal
Nov 12 '18 at 7:15




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53257296%2fcreating-users-table-in-laravel%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Full-time equivalent

さくらももこ

13 indicted, 8 arrested in Calif. drug cartel investigation