for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
use App\Model\Role;
use App\Model\User;
class CreateRolesRightsUsers
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.
{
public function run()
Role::create([
'name' => 'admin',
'description' => 'Администратор',
]);
'name' => 'user',
'description' => 'Пользователь',
$user = new User();
$user->email = '[email protected]';
$user->full_name = 'Администратор';
$user->password = password_hash('qwerty', PASSWORD_DEFAULT, ['cost' => 13]);
$user->role_id = User::ROLE_ADMIN;
$user->status = User::STATUS_ACTIVE;
$user->save();
$user->full_name = 'Пользователь';
$user->role_id = User::ROLE_USER;
}
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.