Комментарии:
Very nice thank you
ОтветитьThanks for tutorials 🙏
ОтветитьGreat video, very didactic the comparing of different possible solutions to the same problem
ОтветитьYou come across as a harsh tutor 😅 but this review made me feel better about my skills
Ответитьwhat i haven't noticed any of your students do is select only what fields are needed for listing
if you dont need a certain field dont use select(*), since a description db column might have 3k characters, and you only needed that field on your details page
This is a great video!
ОтветитьHow can I use web's guard and api's guard both in laravel project?
ОтветитьFirst of all, I want to thank you for all the content that you share with the community. I have a question about the best way to version an API. How is the best structure to maintain different versions of an API. If you separate the Controllers and Resources into different folders, yo will have repetead code.
ОтветитьIf i was to have a user dashboard which is only accessible through a login, and i want the user to be able to display all their customers, add, edit and delete customers, would i put all these in the web route? or just put the 'display all' customers in the Api route and the rest in web?
ОтветитьAd 25..serch..?
ОтветитьHello, can I send you a code I wrote and give me your opinion on it
Thank you ❤️❤️
The way you teach is very spectacular.
ОтветитьHello, could I join the junior developer community program?
ОтветитьIncredible content, thank you!
Its hard to find API content on brazilian courses
Hi poli, How to make a Website and API REST with the same Controllers? It is possible I'm totally confused, and how to create both are same Controllers, plz help
ОтветитьReally helpful thanks
Ответитьgreat tips!! :D
ОтветитьNo one got the /api/v1 properly right IMHO. What I would do is close to your favorite implementation but instead of modifying the global prefix for the api routes from api to api/v1 I'd still introduce a route group wrapping the Route::apiResource(...).
The reasoning is simple: What are you going to do when you have to implement api v2? Create a custom apiv2.php route file and load it in your Route-SP? I hope you see where I'm going with this.
You‘re a rock star in tech world
ОтветитьSome of the methods discussed here was not in the documentation. As a beginner in Laravel, should I buy premium courses just to unlock these secret methods?
ОтветитьHi,
Where did your students take this course? How can I register for this?
Thanks
Good video
ОтветитьWouldt be a better practice to keep the resource the dummiest as possible, and condition him with something like $this->when(Arr::exists($this, 'description'), $this->description ?? '') and then you just pick the data you want in the list and in the view?
Seems like a better approach to give the resource the logic to only work with we give to him (and it be his only concern, even ignoring the existance of the request), and control our business logic in a better place like controller.
I don't even know php and Lavarel, but these reviews and notes are really usefull! I'm interessed in starting learning the language based on your review videos!
ОтветитьI normally do this: Books::select([specific columns only])->with('authors:id,name')->get(); or better use query builder with LEFT JOIN (faster than eloquent).
ОтветитьThank u very nice examples one can leqrn from each something
ОтветитьI didn't know about the apiResource
ОтветитьRoute::resource for me is a no go. You are using a resource to then use only two methods. That only makes things harder IMO. You lose control of the naming and you don't see the whole picture when scanning the route file.
Ответитьapiresource this is something new which i have learn today thank you. will apply it in my next project
Ответитьit's awesome code, thanks for your efforts, keep doing that
ОтветитьAwesome ! Can you make a video about how to make filter searching by the shortest way?
Example :
if ($request->cid != null) {
$equ->where('category_id', $request->cid);
}
if ($request->mid != null) {
$equ->where('model_id', $request->mid);
}
$result = $equ->paginate(15);
return response()->json($result);
}
web.php or api.php it is not about route path (or right naming), it is about middlewares for request , obviously you didn't explain it to your students, and don't explain it in video.
sad.
Hi guys, i keep seeing the statement “new Resource($book)”. Is there a way to avoid the “new” statement and use Dependency Injection in some way?
ОтветитьThis is great! Really useful. Perhaps a video before showing the task, so people can try and follow along as well? Then an example of how you'd do it?
Ответитьgreat video, Changing RouteServiceProvider just to add v1 can break other API code because it will change all routes in api file to use v1
ОтветитьIs correct to create api through WEB instead API route file?
And what are the differences
Sir,Make a video on shipping api used in laravel any project such as ecommerce etc.
ОтветитьIf you are shown and evaluated different ways of solving the problem, you can learn even more. Really a good idea.
ОтветитьHello, I tried using the API routes before (api.php), it works fine in my local development, But when I tried hosting it to cpanel, I got the Unauthorized or Unauthenticated error, I don't remember what it was exactly. All routes with middlware auth, cannot seem to be access. All routes response are Unauthenticated if I recall. Can't find any solution for that, so I moved all my API routes to Web routes instead and added a prefix of 'api'
ОтветитьGreat teacher && Great explanation... Useful as always
Many thanks.
From my recent experience when writing the list you only want to explicitly load the columns you need to save some memory usage as it can quickly add up with large lists, especially if you aren't using server-side pagination.
You can also save additional memory usage and database traffic by using LEFT JOIN authors and SELECT GROUP_CONCAT on authors' name if all you need is a comma separated list of their names, something like this:
Books::select('id', 'name', 'price', 'cover', DB::raw('GROUP_CONCAT(CONCAT_WS(" ", authors.first_name, authors.last_name)) SEPARATOR ", " AS author_name')
->get()
Thanks, for this tip
ОтветитьGracias, genial el video!!
ОтветитьNice video as usual. Thank you for sharing your knowledge!
ОтветитьGreat video, thank's
Ответить