Inheritance: extends App\Foundation\Enums\Enum
Exemplo n.º 1
0
 public function store(FrontUserRequest $request)
 {
     $user = new User();
     $user->email = $request->get('email');
     $user->first_name = $request->get('first_name');
     $user->last_name = $request->get('last_name');
     $user->locale = $request->get('locale', 'nl');
     $user->role = UserRole::MEMBER();
     $user->status = UserStatus::ACTIVE();
     $user->save();
     $eventDescription = $this->getEventDescriptionFor('created', $user);
     activity($eventDescription);
     flash()->success(strip_tags($eventDescription) . '. ' . fragment('back.members.passwordMailSent'));
     event(new UserCreatedThroughBack($user));
     return redirect()->action('Back\\MembersController@index');
 }
Exemplo n.º 2
0
<?php

use App\Services\Auth\Front\Enums\UserRole;
use App\Services\Auth\Front\Enums\UserStatus;
use App\Services\Auth\Front\User;
$factory->define(User::class, function () {
    $person = faker()->person();
    return ['first_name' => $person['firstName'], 'last_name' => $person['lastName'], 'email' => $person['email'], 'password' => app()->environment('local') ? strtolower($person['firstName']) : faker()->password, 'locale' => 'nl', 'role' => UserRole::MEMBER(), 'status' => UserStatus::ACTIVE(), 'address' => faker()->address, 'postal' => faker()->postcode, 'city' => faker()->city, 'country' => faker()->country, 'telephone' => faker()->phoneNumber];
});
Exemplo n.º 3
0
 public function setRoleAttribute(UserRole $role)
 {
     $this->attributes['role'] = $role->getValue();
 }