Chapter Ep 07 - Autoloading, Namespaces, and Models We can also use: public static function find(int $id): ?array { return Arr::first(static::all(), fn($job) => $job['id'] === $id) ?? abort(404, 'Job not found'); } } To get error message! Excellent course!!! 👍🙏
@keithpickard70369 ай бұрын
This series arrived at the perfect time. Thanks for the releases thus far.
@jonathanperera52635 ай бұрын
The explanation on Models was all-encompassing! While I already had a little idea of what models were, this explanation laid a solid-concrete foundation in my mind. This tutor is Top-Tier! Thank You from Sri Lanka! By the way, I'm a huge ZZ Top fan as well!
@sale76804 ай бұрын
I think u r really clarify the concept of working laravel and how the folder distinguished , how code may be better So thank u 🙏
@PayamJianTV5 ай бұрын
Thanks to this amazing series, I learn a lot. At 12:45 of the video, the code "return $job" is missing.
@mahmoudfouda75623 ай бұрын
Thank U
@mhballa586619 күн бұрын
Thank you, I was bewildered when it did not work. but how come it worked for him without adding the return statement.
@unisonrul11719 ай бұрын
This is amazing
@sale76804 ай бұрын
Amazing❤❤❤
@funkyjammaclipsАй бұрын
changing return to $job = breaks the code and wont display any jobs instead i get the error. "App\Models\Job::find(): Return value must be of type array, none returned" when trying to display the existing jobs. When checking a job id that doesnt exist i do get the 404 page. edit: further in the video I can see you fixed this error with "return $job;" but nowhere was this ever mentioned I just happen to notice it at the end.
@edorourke92237 ай бұрын
At around 12:40, you edit the "first" method, but you do not initially include a return. And you don't mention it. Later in the vid, it's there, but initially, I left it out and got an error. I guess, at worst, it's probably a good lesson in troubleshooting. Just pointing it out in case you didn't see it.
@yogiarismet10256 ай бұрын
Damn, I overlooked it too. I've been stuck for a while there trying to find the error. After checking this comment of yours, I finally able to move forward. Thanks for pointing that out.
@linuxforarabs28816 ай бұрын
Thank you for pointing that. It is shown on 13:35. However, I'm did not figure out why Job class was created in model not in a controller :(
@renatofrota6 ай бұрын
@@linuxforarabs2881 MVC architecture. Model is related to the data and the "business rules". Further in the course it will likely be converted to a more complete class that specifies the format of data stored in the database for a "Job" entity instead of having an array of jobs in the class itself.
@hiiamyaqub830127 күн бұрын
Hi sir can you make Laravel advance project series any project you make
@mohamedaminedammak23198 ай бұрын
at 10:13 we're passing $id to find that accept an int but $id is a string is it automatically converted or what?
@abdomahmoud87697 ай бұрын
The id that comes from the url is a string and we said we need an int but there is no error. I think if we enabled the strict mode it will throw an error
@mohamedaminedammak23197 ай бұрын
@@abdomahmoud8769 thank you 🤝
@renatofrota6 ай бұрын
@@abdomahmoud8769 if you are going to use strict types you will need to convert the string that came from URL to an int (e.g.: casting) when passing it as parameter to the find() function.
@udayworldwide3 ай бұрын
PHP is loosely typed language. Getting anything from url is a string no matter whether enclosed in quotes or not.
@programmer62846 ай бұрын
hello anyone experience with anchor tag VALUE changing into job/jobs but the href is jobs when access route to job/{id}
@khanra178 ай бұрын
Tooo much over eddited audio. Please keep distance from the mic. The audio is so much annoying and fake(boosted lower frequencies), why don't you sound like in real life?