app/Containers/Authorization/Data/Seeders/AuthorizationDefaultUsersSeeder_3.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
        $user = Apiato::call('User@CreateUserByCredentialsTask', [
            'admin@admin.com',
            'admin',
            $isClient = false,
            'admin',
            'Super Admin',
        ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['admin']));
        Apiato::call('Farmer@CreateFarmerTask', [[
            'user_id'                   => $user->id,
            'name'                      => 'admin',
            'story'                     => 'my story',
            'children'                  => 0,
            'birthday'                  => '1980-08-25',
            'photo_id'                  => null,
            'main_occupation'           => 'something',
            'side_occupation'           => 'something else',
            'spouse_name'               => 'no idea',
            'spouse_birthday'           => '1980-08-25',
            'spouse_main_occupation'    => 'something',
            'spouse_side_occupation'    => 'something else',
            'family_income_idr'         => 20000,
            'address'                   => 'somewhere',
            'gender_id'                 => 2,
            'import_id'                 => null,
            'project_id'                => 1,
        ]]);
        $user = Apiato::call('User@CreateUserByCredentialsTask', [
            'stefan.haas@openforests.com',
            'openforests',
            $isClient = false,
            'stefan',
            'Stefan Haas',
        ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['admin']));
        Apiato::call('Farmer@CreateFarmerTask', [[
            'user_id'                   => $user->id,
            'name'                      => 'Stefan',
            'story'                     => 'my story',
            'children'                  => 0,
            'birthday'                  => '1980-08-25',
            'photo_id'                  => null,
            'main_occupation'           => 'something',
            'side_occupation'           => 'something else',
            'spouse_name'               => 'no idea',
            'spouse_birthday'           => '1980-08-25',
            'spouse_main_occupation'    => 'something',
            'spouse_side_occupation'    => 'something else',
            'family_income_idr'         => 20000,
            'address'                   => 'somewhere',
            'gender_id'                 => 2,
            'import_id'                 => null,
            'project_id'                => 1,
        ]]);
        $user = Apiato::call('User@CreateUserByCredentialsTask', [
            'felix.hinze@openforests.com',
            'openforests',
            $isClient = false,
            'felix',
            'Felix Hinze',
        ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['admin']));
        Apiato::call('Farmer@CreateFarmerTask', [[
            'user_id'                   => $user->id,
            'name'                      => 'Felix',
            'story'                     => 'my story',
            'children'                  => 0,
            'birthday'                  => '1980-08-25',
            'photo_id'                  => null,
            'main_occupation'           => 'something',
            'side_occupation'           => 'something else',
            'spouse_name'               => 'no idea',
            'spouse_birthday'           => '1980-08-25',
            'spouse_main_occupation'    => 'something',
            'spouse_side_occupation'    => 'something else',
            'family_income_idr'         => 20000,
            'address'                   => 'somewhere',
            'gender_id'                 => 2,
            'import_id'                 => null,
            'project_id'                => 1,
        ]]);
        $user = Apiato::call('User@CreateUserByCredentialsTask', [
            'gerrit.balindt@b-lack.io',
            'openforests',
            $isClient = false,
            'gerrit',
            'Gerrit Balindt',
        ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['admin']));
        Apiato::call('Farmer@CreateFarmerTask', [[
            'user_id'                   => $user->id,
            'name'                      => 'Gerrit',
            'story'                     => 'my story',
            'children'                  => 0,
            'birthday'                  => '1980-08-25',
            'photo_id'                  => null,
            'main_occupation'           => 'something',
            'side_occupation'           => 'something else',
            'spouse_name'               => 'no idea',
            'spouse_birthday'           => '1980-08-25',
            'spouse_main_occupation'    => 'something',
            'spouse_side_occupation'    => 'something else',
            'family_income_idr'         => 20000,
            'address'                   => 'somewhere',
            'gender_id'                 => 2,
            'import_id'                 => null,
            'project_id'                => 1,
        ]]);
        $user = Apiato::call('User@CreateUserByCredentialsTask', [
            'sebastian.weckend@openforests.com',
            'openforests',
            $isClient = false,
            'spokk',
            'Sebastian Weckend',
        ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['admin']));
        Apiato::call('Farmer@CreateFarmerTask', [[
            'user_id'                   => $user->id,
            'name'                      => 'Spokk',
            'story'                     => 'my story',
            'children'                  => 0,
            'birthday'                  => '1980-08-25',
            'photo_id'                  => null,
            'main_occupation'           => 'something',
            'side_occupation'           => 'something else',
            'spouse_name'               => 'no idea',
            'spouse_birthday'           => '1980-08-25',
            'spouse_main_occupation'    => 'something',
            'spouse_side_occupation'    => 'something else',
            'family_income_idr'         => 20000,
            'address'                   => 'somewhere',
            'gender_id'                 => 2,
            'import_id'                 => null,
            'project_id'                => 1,
        ]]);
        $user = Apiato::call('User@CreateUserByCredentialsTask', [
            'gerrit.balindt@gruenecho.de',
            'openforests',
            $isClient = true,
            'farmer',
            'Test Farmer',
        ])->assignRole(Apiato::call('Authorization@FindRoleTask', ['farmer']));
        Apiato::call('Farmer@CreateFarmerTask', [[
            'user_id'                   => $user->id,
            'name'                      => 'Test Farmer',
            'story'                     => 'my story',
            'children'                  => 0,
            'birthday'                  => '1980-08-25',
            'photo_id'                  => null,
            'main_occupation'           => 'something',
            'side_occupation'           => 'something else',
            'spouse_name'               => 'no idea',
            'spouse_birthday'           => '1980-08-25',
            'spouse_main_occupation'    => 'something',
            'spouse_side_occupation'    => 'something else',
            'family_income_idr'         => 20000,
            'address'                   => 'somewhere',
            'gender_id'                 => 2,
            'import_id'                 => null,
            'project_id'                => 1,
        ]]);
    }
public function run ( ) { $ user = Apiato :: call ( 'User@CreateUserByCredentialsTask' , [ 'admin@admin.com' , 'admin' , $ isClient = false , 'admin' , 'Super Admin' , ] ) -> assignRole ( Apiato :: call ( 'Authorization@FindRoleTask' , [ 'admin' ] ) ) ; Apiato :: call ( 'Farmer@CreateFarmerTask' , [ [ 'user_id' => $ user -> id , 'name' => 'admin' , 'story' => 'my story' , 'children' => 0 , 'birthday' => '1980-08-25' , 'photo_id' => null , 'main_occupation' => 'something' , 'side_occupation' => 'something else' , 'spouse_name' => 'no idea' , 'spouse_birthday' => '1980-08-25' , 'spouse_main_occupation' => 'something' , 'spouse_side_occupation' => 'something else' , 'family_income_idr' => 20000 , 'address' => 'somewhere' , 'gender_id' => 2 , 'import_id' => null , 'project_id' => 1 , ] ] ) ; $ user = Apiato :: call ( 'User@CreateUserByCredentialsTask' , [ 'stefan.haas@openforests.com' , 'openforests' , $ isClient = false , 'stefan' , 'Stefan Haas' , ] ) -> assignRole ( Apiato :: call ( 'Authorization@FindRoleTask' , [ 'admin' ] ) ) ; Apiato :: call ( 'Farmer@CreateFarmerTask' , [ [ 'user_id' => $ user -> id , 'name' => 'Stefan' , 'story' => 'my story' , 'children' => 0 , 'birthday' => '1980-08-25' , 'photo_id' => null , 'main_occupation' => 'something' , 'side_occupation' => 'something else' , 'spouse_name' => 'no idea' , 'spouse_birthday' => '1980-08-25' , 'spouse_main_occupation' => 'something' , 'spouse_side_occupation' => 'something else' , 'family_income_idr' => 20000 , 'address' => 'somewhere' , 'gender_id' => 2 , 'import_id' => null , 'project_id' => 1 , ] ] ) ; $ user = Apiato :: call ( 'User@CreateUserByCredentialsTask' , [ 'felix.hinze@openforests.com' , 'openforests' , $ isClient = false , 'felix' , 'Felix Hinze' , ] ) -> assignRole ( Apiato :: call ( 'Authorization@FindRoleTask' , [ 'admin' ] ) ) ; Apiato :: call ( 'Farmer@CreateFarmerTask' , [ [ 'user_id' => $ user -> id , 'name' => 'Felix' , 'story' => 'my story' , 'children' => 0 , 'birthday' => '1980-08-25' , 'photo_id' => null , 'main_occupation' => 'something' , 'side_occupation' => 'something else' , 'spouse_name' => 'no idea' , 'spouse_birthday' => '1980-08-25' , 'spouse_main_occupation' => 'something' , 'spouse_side_occupation' => 'something else' , 'family_income_idr' => 20000 , 'address' => 'somewhere' , 'gender_id' => 2 , 'import_id' => null , 'project_id' => 1 , ] ] ) ; $ user = Apiato :: call ( 'User@CreateUserByCredentialsTask' , [ 'gerrit.balindt@b-lack.io' , 'openforests' , $ isClient = false , 'gerrit' , 'Gerrit Balindt' , ] ) -> assignRole ( Apiato :: call ( 'Authorization@FindRoleTask' , [ 'admin' ] ) ) ; Apiato :: call ( 'Farmer@CreateFarmerTask' , [ [ 'user_id' => $ user -> id , 'name' => 'Gerrit' , 'story' => 'my story' , 'children' => 0 , 'birthday' => '1980-08-25' , 'photo_id' => null , 'main_occupation' => 'something' , 'side_occupation' => 'something else' , 'spouse_name' => 'no idea' , 'spouse_birthday' => '1980-08-25' , 'spouse_main_occupation' => 'something' , 'spouse_side_occupation' => 'something else' , 'family_income_idr' => 20000 , 'address' => 'somewhere' , 'gender_id' => 2 , 'import_id' => null , 'project_id' => 1 , ] ] ) ; $ user = Apiato :: call ( 'User@CreateUserByCredentialsTask' , [ 'sebastian.weckend@openforests.com' , 'openforests' , $ isClient = false , 'spokk' , 'Sebastian Weckend' , ] ) -> assignRole ( Apiato :: call ( 'Authorization@FindRoleTask' , [ 'admin' ] ) ) ; Apiato :: call ( 'Farmer@CreateFarmerTask' , [ [ 'user_id' => $ user -> id , 'name' => 'Spokk' , 'story' => 'my story' , 'children' => 0 , 'birthday' => '1980-08-25' , 'photo_id' => null , 'main_occupation' => 'something' , 'side_occupation' => 'something else' , 'spouse_name' => 'no idea' , 'spouse_birthday' => '1980-08-25' , 'spouse_main_occupation' => 'something' , 'spouse_side_occupation' => 'something else' , 'family_income_idr' => 20000 , 'address' => 'somewhere' , 'gender_id' => 2 , 'import_id' => null , 'project_id' => 1 , ] ] ) ; $ user = Apiato :: call ( 'User@CreateUserByCredentialsTask' , [ 'gerrit.balindt@gruenecho.de' , 'openforests' , $ isClient = true , 'farmer' , 'Test Farmer' , ] ) -> assignRole ( Apiato :: call ( 'Authorization@FindRoleTask' , [ 'farmer' ] ) ) ; Apiato :: call ( 'Farmer@CreateFarmerTask' , [ [ 'user_id' => $ user -> id , 'name' => 'Test Farmer' , 'story' => 'my story' , 'children' => 0 , 'birthday' => '1980-08-25' , 'photo_id' => null , 'main_occupation' => 'something' , 'side_occupation' => 'something else' , 'spouse_name' => 'no idea' , 'spouse_birthday' => '1980-08-25' , 'spouse_main_occupation' => 'something' , 'spouse_side_occupation' => 'something else' , 'family_income_idr' => 20000 , 'address' => 'somewhere' , 'gender_id' => 2 , 'import_id' => null , 'project_id' => 1 , ] ] ) ; }
Run the database seeds.
Run the database seeds .
// Default Users (with their roles) --------------------------------------------- //create farmer //create farmer //create farmer //create farmer //create farmer // farmer test account //create farmer