Skip to content

Commit

Permalink
Added fillable property to model, unique key to migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Saiful Alam committed May 20, 2019
1 parent 9bbd3c7 commit f55cd3a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function up()
Schema::create(config('role_manager.database.permission_table'), function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('title');
$table->string('title')->nullable();
$table->timestamps();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function up()
{
Schema::create(config('role_manager.database.role_table'), function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('name')->unique();
$table->string('status')->default('active');
$table->timestamps();
});
Expand Down
3 changes: 3 additions & 0 deletions src/Models/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

class Permission extends Model
{

protected $fillable = ['name', 'title'];

public function __construct()
{
$this->setTable(config('role_manager.database.permission_table'));
Expand Down
2 changes: 2 additions & 0 deletions src/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

class Role extends Model
{

protected $fillable = ['name', 'status'];
public function __construct()
{
$this->setTable(config('role_manager.database.role_table'));
Expand Down

0 comments on commit f55cd3a

Please sign in to comment.