for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use Illuminate\Database\Seeder;
class ClearDataSeeder 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.
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
$adminGroupId = DB::table('groups')->where('name', 'Admin')->first()->id;
$adminUserId = DB::table('users')->where('email', '[email protected]')->first()->id;
$permissions = DB::table('permissions')->whereIn('model', ['users', 'permissions', 'groups']);
DB::table('groups_permissions')->whereIn('permission_id', $permissions->pluck('id'))->delete();
DB::table('users_groups')->where('user_id', $adminUserId)->where('group_id', $adminGroupId)->delete();
DB::table('users')->where('email', '[email protected]')->delete();
DB::table('groups')->where('name', 'Admin')->delete();
$permissions->delete();
}
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.