for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Seeder;
use Carbon\Carbon;
class RbacTableSeeder extends Seeder
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
private $managerModel;
public function __construct()
$guard = config('admin.guard');
$provider = config("auth.guards.{$guard}.provider");
$managerModelName = config("auth.providers.{$provider}.model");
$this->managerModel = new $managerModelName();
}
/**
* Run the database seeds.
*
* @return void
*/
public function run()
$this->insertManager();
$database = file_get_contents(__DIR__ . '/' . 'rbac.sql');
$prefix = env('DB_PREFIX', '');
$database = str_replace('sco_', $prefix, $database);
DB::connection()->getPdo()->exec($database);
private function insertManager()
$managerTable = $this->managerModel->getTable();
if ($managerTable != 'users') {
DB::table($managerTable)->insert([
'id' => 1,
'name' => 'admin',
'email' => '[email protected]',
'password' => bcrypt('123456'),
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
]);
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.