getRoles(); foreach ($roles as $role) { // Don't save if already exist if (Role::where('slug', $role->slug)->first() == null) { $role->save(); } } } /** * @return array Roles to seed */ protected function getRoles() { return [ new Role([ 'slug' => 'organisations-admin', 'name' => 'Organisations Administrator', 'description' => 'This role is meant for "organisation administrators", who can basically do anything related to organisations and their members.', ]), ]; } }