Skip to content

Commit f55cd3a

Browse files
author
Saiful Alam
committed
Added fillable property to model, unique key to migrations
1 parent 9bbd3c7 commit f55cd3a

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

database/migrations/2019_05_15_000000_create_permissions_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function up()
1616
Schema::create(config('role_manager.database.permission_table'), function (Blueprint $table) {
1717
$table->increments('id');
1818
$table->string('name');
19-
$table->string('title');
19+
$table->string('title')->nullable();
2020
$table->timestamps();
2121
});
2222
}

database/migrations/2019_05_15_000000_create_roles_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function up()
1515
{
1616
Schema::create(config('role_manager.database.role_table'), function (Blueprint $table) {
1717
$table->increments('id');
18-
$table->string('name');
18+
$table->string('name')->unique();
1919
$table->string('status')->default('active');
2020
$table->timestamps();
2121
});

src/Models/Permission.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
class Permission extends Model
1414
{
15+
16+
protected $fillable = ['name', 'title'];
17+
1518
public function __construct()
1619
{
1720
$this->setTable(config('role_manager.database.permission_table'));

src/Models/Role.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
class Role extends Model
1313
{
14+
15+
protected $fillable = ['name', 'status'];
1416
public function __construct()
1517
{
1618
$this->setTable(config('role_manager.database.role_table'));

0 commit comments

Comments
 (0)