Modificación de texto por defecto en mayusculas para creación de usuarios
This commit is contained in:
@@ -34,9 +34,9 @@ class CreateNewUser implements CreatesNewUsers
|
||||
])->validate();
|
||||
|
||||
$user = User::create([
|
||||
'name' => $input['name'],
|
||||
'apellidoPaterno' => $input['apellidoPaterno'],
|
||||
'apellidoMaterno' => $input['apellidoMaterno'],
|
||||
'name' => mb_strtoupper($input['name'], 'UTF-8'),
|
||||
'apellidoPaterno' => mb_strtoupper($input['apellidoPaterno'], 'UTF-8'),
|
||||
'apellidoMaterno' => mb_strtoupper($input['apellidoMaterno'], 'UTF-8'),
|
||||
'email' => $input['email'],
|
||||
'telefono' => $input['telefono'],
|
||||
'direccion' => "",
|
||||
|
||||
@@ -43,9 +43,9 @@ class UserController extends Controller
|
||||
$passwordTemporal = Str::random(12);
|
||||
|
||||
$user = User::create([
|
||||
'name' => $request->name,
|
||||
'apellidoPaterno' => $request-> apellidoPaterno,
|
||||
'apellidoMaterno' => $request-> apellidoMaterno,
|
||||
'name' => mb_strtoupper($request->name, 'UTF-8'),
|
||||
'apellidoPaterno' => mb_strtoupper($request->apellidoPaterno, 'UTF-8'),
|
||||
'apellidoMaterno' => mb_strtoupper($request->apellidoMaterno, 'UTF-8'),
|
||||
'email' => $request->email,
|
||||
'telefono' => $request->telefono ?? null,
|
||||
'direccion' => $request->direccion ?? null,
|
||||
|
||||
+27
-5
@@ -3,15 +3,16 @@
|
||||
namespace App\Models;
|
||||
|
||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Laravel\Jetstream\HasProfilePhoto;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Fortify\TwoFactorAuthenticatable;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Fortify\TwoFactorAuthenticatable;
|
||||
use Laravel\Jetstream\HasProfilePhoto;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
@@ -59,6 +60,27 @@ class User extends Authenticatable
|
||||
];
|
||||
}
|
||||
|
||||
protected function name(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
set: fn ($value) => strtoupper($value)
|
||||
);
|
||||
}
|
||||
|
||||
protected function apellidoPaterno(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
set: fn ($value) => strtoupper($value)
|
||||
);
|
||||
}
|
||||
|
||||
protected function apellidoMaterno(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
set: fn ($value) => strtoupper($value)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// public function note() : HasOne
|
||||
// {
|
||||
|
||||
Reference in New Issue
Block a user