Тёмный

Laravel 8 tutorial - Mutator 

Code Step By Step
Подписаться 315 тыс.
Просмотров 15 тыс.
50% 1

In this laravel 8 video tutorial, we learn what is Mutator and how we can use the Mutators function in Laravel in a simple way. This video is made by anil Sidhu in the English language.
steps of video
What is Mutator
Make Controller
Make Model
Make a Mutator function
Laravel 9 tutorial
Interview Question in Mutator
Laravel 9 latest playlist • Laravel 9 tutorial

Опубликовано:

 

16 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@codestepbystep
@codestepbystep 2 года назад
Please support me by subscribe, like and comment :) thank you
@mahnazrafiaislam
@mahnazrafiaislam 3 года назад
This is the answer of the question- public function setNameAttribute($value) { if(substr($value,0,3)=='Mr.'){ $this->attributes['name']=$value; } else{ $this->attributes['name']="Mr. ".$value; } }
@FarhanKhan-on9dc
@FarhanKhan-on9dc 2 года назад
it can be shortened to public function setNameAttribute($value) { if(!substr($value,0,3)=='Mr.'){ $this->attributes['name']="Mr. ".$value; } }
@fleckenfurz77
@fleckenfurz77 2 года назад
@@FarhanKhan-on9dc It can be even shortened to a one liner.. public function setNameAttribute($value) { $this->attributes['name'] = substr($value, 0, 3) == 'Mr.' ? $value : 'Mr. ' . $value; }
@ashokbishwas
@ashokbishwas Год назад
you are the great. You are legend. God bless you.
@saikumarkandikonda431
@saikumarkandikonda431 3 года назад
Hi bro, here is answer for the question. Please correct me if I am wrong public function SetNameAttribute($value){ if(substr($value,0,3)=='Mr.'){ echo "mr already exists for this value"; } else{ $this->attributes['name']="Mr.".$value; } } }
@AbhishekSharma-eo1xe
@AbhishekSharma-eo1xe 4 года назад
We can check in setNameAttribute() function if name already have Mr. in string then don't add Mr. else add Mr. with name
@anisurrahman6634
@anisurrahman6634 3 года назад
We can sue substr() for checking. ex: substr("Mr John", 0, 2)=="Mr";
@enrollgeofficial9317
@enrollgeofficial9317 4 года назад
Sir, Please Make an Video on react native app intro courosel 🙏, I watched all your react videos
@syedrizvi7455
@syedrizvi7455 3 года назад
We can apply if else condition in the function
@ajdeveloper3438
@ajdeveloper3438 3 года назад
we will use PHP substr();
@vishal5545
@vishal5545 3 года назад
Hi, How can I get more than one value in mutator, for exp. I have to combine first name and last name and after that want to save the same in db. Pls reply
@MuhammadArif-op1cn
@MuhammadArif-op1cn 3 года назад
Answer to the Q. public function setNameAttribute($value){ if(strncmp($value, "Mr.", 2)== 0){ $this->attributes['name'] = $value; } else{ $this->attributes['name'] = 'Mr. '.$value; } }
Далее
Laravel 8 tutorial - One to One Relation
9:41
Просмотров 28 тыс.
Как мы играем в игры 😂
00:20
Просмотров 188 тыс.
Добрая весть 😂
00:21
Просмотров 398 тыс.
Laravel 8 tutorial - Multiple Database Connection
10:50
Laravel 8 tutorial - Accessors
6:58
Просмотров 15 тыс.
Laravel 8 tutorial in Hindi - One to One Relation
11:31
Laravel 8 tutorial - What is middleware
9:28
Просмотров 67 тыс.
Laravel 8 tutorial - Query Builder
11:28
Просмотров 34 тыс.
Laravel Telescope | Awesome Debugging Tool #1
9:42
Просмотров 13 тыс.