Creating comments (relationships) | Laravel 10 Tutorial #18

  Рет қаралды 11,015

Yelo Code

Yelo Code

Күн бұрын

Пікірлер: 17
@kouzokiodin3623
@kouzokiodin3623 5 ай бұрын
Thank you so much teacher
@dawghouse1111
@dawghouse1111 Жыл бұрын
Question about the controller function store parameter (tutorial 10 near video time frame 10:08). The "Idea" $idea (not $idea)parameter, is that the model name if not where is it coming from and do you need it. I been following your vides to learn Laravel 10 and I was little confused about the need for the "Idea" parameter. I tried running the function ($idea) like and it seems to work so what is the purpose to "Idea" parameter?
@yelocode
@yelocode Жыл бұрын
Thanks for watching. Your are correct, that is the model class type Those are called type hints in PHP, you are basically telling php what type of class this function accepts. In php these are optional so your code will still work without it in this case. In has at least 2 main benefits in this case: 1 - it helps your IDE or code editor know what the $idea type is, so you can get auto suggestions. 2 - It also lets laravel know, what model should be used for route model binding if you use a different name than idea in your route web.php file.
@ほうおういんきょうま-h5o
@ほうおういんきょうま-h5o 8 ай бұрын
good day! where ever you are. Just a question, what does the ($idea) that you always use on codes like $idea->comments, etc. represent? Is it a variable for the model? If so, where can I find it?
@Traveler-Tan
@Traveler-Tan 7 ай бұрын
not completely sure but i think it's from the foreach at the very beginning of dashboard.blade.php where we render all ideas, since its @include('shared.idea-card'), the idea-card has access to $idea while comments-box is included on the idea-card so comment-box has access to it too, this might be wrong but that's how how i understood it
@ほうおういんきょうま-h5o
@ほうおういんきょうま-h5o 7 ай бұрын
@@Traveler-Tan woah tnx for the clarification
@siavash100200
@siavash100200 Жыл бұрын
I did exactly what you learned and idea show and edit page working but when I go back to dashboard ( home page ) it can't load comments and get something like this error " $idea->comments or $idea->id are undefined variables"
@yelocode
@yelocode Жыл бұрын
Thanks for watching. Are you using a different variable name than $idea in your project? I would check "dashboard.blade.php" as well as "idea-card.blade.php" to see if you are using the variable name $idea or something else. The entire code for this episode is also on github, you can compare your code with it to see what may be the issue. github.com/yelocode/ideas/tree/2bfd88f556c8582fe4afbc745ac6b70789856c48
@shenanigans1231
@shenanigans1231 3 ай бұрын
I had the same issue, forgot to use Idea $idea as inputs in the store function in the CommentController. Without that "use App\Models\Idea" wasn't working and resulted in undefined variables error.
@LoneTaha
@LoneTaha 8 ай бұрын
perfect
@potatosmile_s_v
@potatosmile_s_v Жыл бұрын
is it possible to access your code, I need to see some sort of code pls, Thanksss
@yelocode
@yelocode Жыл бұрын
Thanks for watching, Can find the code here : github.com/yelocode/ideas/commit/2bfd88f556c8582fe4afbc745ac6b70789856c48
@SiFu_Max
@SiFu_Max 11 ай бұрын
How I can display the Name of the User who commented?
@Kai-xc7qu
@Kai-xc7qu 8 ай бұрын
Russia
@ChernayaReka
@ChernayaReka 7 ай бұрын
MЫ, РУССКИЕ, НЕ ОБМАНЫВАЕМ ДХУГ-ДХУГА
@Kai-xc7qu
@Kai-xc7qu 7 ай бұрын
@@ChernayaReka не бро, неважно какая нация все друг друга обманывают
@ChernayaReka
@ChernayaReka 7 ай бұрын
@@Kai-xc7qu да это цитата из Брата 2, спокуха
What is $fillable & $guarded | Laravel 10 Tutorial #19
9:13
Yelo Code
Рет қаралды 7 М.
Laravel Eloquent: Deeper Relationships with One Query
10:37
Laravel Daily
Рет қаралды 144 М.
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 3,7 МЛН
Lamborghini vs Smoke 😱
00:38
Topper Guild
Рет қаралды 48 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН
DigiByte Community Chat #17 Taproot feat. GTO90
47:20
DigiByte Global Community
Рет қаралды 8
Emails & Mail Trap testing | Laravel 10 Tutorial #29
16:17
Yelo Code
Рет қаралды 6 М.
Laravel Security: Top 7 Mistakes Developers Make
11:16
Laravel Daily
Рет қаралды 86 М.
From Blank to Blog With Laravel in 10 Minutes
12:21
Laracasts
Рет қаралды 13 М.
Laravel First Impressions From A JavaScript Dev
21:08
adamdotdev
Рет қаралды 139 М.
Why Don't We Have A Laravel For JavaScript?
12:36
Theo - t3․gg
Рет қаралды 110 М.
I build a TODO list app with Laravel in 17 minutes.
17:58
Josh Cirre
Рет қаралды 6 М.
How to Add Comment & Reply System in Laravel Using Commentify
19:43
Web Tech Knowledge
Рет қаралды 7 М.
Laravel Reverb : Getting started
30:26
Code with Burt
Рет қаралды 11 М.
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 3,7 МЛН