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();
|
])->validate();
|
||||||
|
|
||||||
$user = User::create([
|
$user = User::create([
|
||||||
'name' => $input['name'],
|
'name' => mb_strtoupper($input['name'], 'UTF-8'),
|
||||||
'apellidoPaterno' => $input['apellidoPaterno'],
|
'apellidoPaterno' => mb_strtoupper($input['apellidoPaterno'], 'UTF-8'),
|
||||||
'apellidoMaterno' => $input['apellidoMaterno'],
|
'apellidoMaterno' => mb_strtoupper($input['apellidoMaterno'], 'UTF-8'),
|
||||||
'email' => $input['email'],
|
'email' => $input['email'],
|
||||||
'telefono' => $input['telefono'],
|
'telefono' => $input['telefono'],
|
||||||
'direccion' => "",
|
'direccion' => "",
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ class UserController extends Controller
|
|||||||
$passwordTemporal = Str::random(12);
|
$passwordTemporal = Str::random(12);
|
||||||
|
|
||||||
$user = User::create([
|
$user = User::create([
|
||||||
'name' => $request->name,
|
'name' => mb_strtoupper($request->name, 'UTF-8'),
|
||||||
'apellidoPaterno' => $request-> apellidoPaterno,
|
'apellidoPaterno' => mb_strtoupper($request->apellidoPaterno, 'UTF-8'),
|
||||||
'apellidoMaterno' => $request-> apellidoMaterno,
|
'apellidoMaterno' => mb_strtoupper($request->apellidoMaterno, 'UTF-8'),
|
||||||
'email' => $request->email,
|
'email' => $request->email,
|
||||||
'telefono' => $request->telefono ?? null,
|
'telefono' => $request->telefono ?? null,
|
||||||
'direccion' => $request->direccion ?? null,
|
'direccion' => $request->direccion ?? null,
|
||||||
|
|||||||
+27
-5
@@ -3,15 +3,16 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
// use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||||
use Laravel\Sanctum\HasApiTokens;
|
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||||
use Laravel\Jetstream\HasProfilePhoto;
|
|
||||||
use Spatie\Permission\Traits\HasRoles;
|
|
||||||
use Illuminate\Notifications\Notifiable;
|
|
||||||
use Laravel\Fortify\TwoFactorAuthenticatable;
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
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
|
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
|
// public function note() : HasOne
|
||||||
// {
|
// {
|
||||||
|
|||||||
Reference in New Issue
Block a user