Pls continue the tutorial to building project .. thanks so much
@Bitfumes Жыл бұрын
Yes we will work on a project
@msi109711 ай бұрын
what extension di you use?
@thierryyolepiot9951 Жыл бұрын
When trying the mutator (protected function password from 4:27, i.e protected function password(): Attribute { return Attribute::make( set: fn ($value) => bcrypt($value) ); } it doesn't work. But when I used instead: public function setPasswordAttribute($value) { $this->attributes['password'] = bcrypt($value); } it worked fine. Please, check on this and if you have time, please explain why the protected password function (mutator) did not work and why instead the public function setPasswordAttribute worked
@thierryyolepiot9951 Жыл бұрын
The same problem happens with the accessor... Please help!!! I might have missed something
@mustafahassan9383 Жыл бұрын
I think its because the version you have . This is new Syntax introduced in Laravel 9 and above
@paulcalebayibaemiotokolo Жыл бұрын
@@thierryyolepiot9951 ask chatgpt
@MoHaridy98 Жыл бұрын
you should import "use Illuminate\Database\Eloquent\Casts\Attribute;"
@jungkyuuut_tv Жыл бұрын
just import this on your usermodel woahla~! use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model;
@justinemanalo7079 ай бұрын
Good day, im using the latest version of laravel, and it seems to be encrypted once you use sa user class. theres this array included protected $casts = [ 'email_verified_at' => 'datetime', 'password' => 'hashed', ]; im just new to laravel development. and your tutorial helped me a lot, thank you so much
@gromhellscream55819 ай бұрын
Very helpful!
@lasithadulshan7357 Жыл бұрын
Thank you
@Bitfumes Жыл бұрын
You're welcome
@sicelomgobhozi4602 Жыл бұрын
Thank you for this tutorial.
@aguud11 ай бұрын
you are awesome
@gsm-jw5qf Жыл бұрын
my password auto encrypted when I comment this function " protected function password (): Attribute" from the User.php file. but only first two methods raw SQL work when I used this method then password is not encrypted automatically.
@RaefetOuafiqo Жыл бұрын
did you know why this is happening ?
@charbelsawma8519 Жыл бұрын
I’m not sure if this is because of an update in Laravel, but when you open the User.php model, under protected $casts, there is ‘password’ => ‘hashed’ and this automatically encrypted the password without doing anything
@RaefetOuafiqo Жыл бұрын
@@charbelsawma8519 yep using User class encrypts the password by default, i tried to reverse the operation by making the set method to not hash the pass and it worked
@gsm-jw5qf Жыл бұрын
still not found the solution. Maybe laravel change their system. @@RaefetOuafiqo
@jungkyuuut_tv Жыл бұрын
paste this to your User model thanks me later use Illuminate\Database\Eloquent\Casts\Attribute; use Illuminate\Database\Eloquent\Model;