-
0 votesanswersviews
如果没有使用默认的Laravel auth,如何使用Laravel护照
我正在使用laravel 5.4而不使用默认的Auth进行用户身份验证 . 我创建了一个自定义用户表,并将其与具有所有自定义中间件等的自定义Auth系统一起使用 . 因此,我没有在初始设置中运行命令 php artisan make:auth 或 php aritsan migrate . 我如何将项目与Laravel / Passport集成以进行API身份验证?如果不使用默认身份验证,我如何... -
0 votesanswersviews
无法通过laravel迁移创建外键
我的Laravel迁移有问题:( 当我正在运行php artisan migrate时,它会在外键上停止 . 第一次迁移 /** * Run the migrations. * * @return void */ public function up() { Schema::enableForeignKeyConstraints(); Schema::create('fic... -
0 votesanswersviews
如何在Laravel迁移中创建自引用关系(外键)?
我从一个基于Laravel 5.2构建的自学项目开始,我发现了我的第一个问题:迁移中的自引用 . 这就是文件 2016_08_02_024942_create_navigation_table.php 的样子(我已删除评论,因为这篇文章没有太长时间): use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Sch... -
2 votesanswersviews
Laravel迁移 - 如何将`id`字段更改为主要字段并稍后自动递增
我的表'sales_order_details'将 id 字段作为整数'int(10)',默认值为 0 . 我需要将其更改为迁移中的主要自动增量键 . 我试着用以下方式: public function up() { Schema::table('sales_order_details', function (Blueprint $table){ $t... -
1 votesanswersviews
在Laravel数据库迁移命令中;无法创建一个BOTH唯一且大小超过191的列 . 怎么解决?
First ;根据this 我编辑: app\Providers\AppServiceProvider.php public function boot() { Schema::defaultStringLength(191); } Second ;我发了 php artisan make:migration create_users Third ;我实现了生成的类: <?php ... -
2 votesanswersviews
无法将外键约束添加到数据透视表
我正在尝试使用外键创建数据透视表,这是我在Laravel中进行的迁移: public function up() { Schema::create('player_position', function (Blueprint $table) { $table->integer('player_id')->unsigned()->index(); ... -
3 votesanswersviews
Laravel 5.2 php artisan migrate:回滚错误
我使用Laravel 5.2并通过运行创建了数据库表 php artisan make:migration create_categories_table --create=categories 和 php artisan make:migration create_posts_table --create=posts 然后我运行 php artisan migrate ,并在数据库中创建表 ... -
1 votesanswersviews
Laravel迁移,hasColumn方法失败
我正在使用laravel 5.2版本和PHP 7.1 . 我正在尝试从我的laravel项目中迁移文件,其中我有代码来检查列的存在,如下所示 - if (!Schema::hasColumn('table1', 'column1')) { // Add column1 } 我知道代码非常好,并且在设置相同的代码时已经多次使用了 . 但是现在我在单独的机器上尝试这个并且失败并出现错误 - ...