No matter how experienced, it's better to be naive and keep relearning. Appreciate your time.
@brianochieng59042 жыл бұрын
Thanks Povilas "Cruddy by Design" - Adam Wathan - Laracon US 2017 is the one of the best recommendations you'v shared besides your amazing Knowledge.
@rolanddecasa44383 жыл бұрын
Finally a video for naming schemes in laravel. thank you for this sir. Big help to us!
@poplach3 жыл бұрын
First I thought this video is reuploaded, since too many deja-vu happened - I've already seen you talking about naming and recommending Adam Wathan's video about CRUDs. But no - you have a new mic on the video so it is new. As to the topic - I believe it is one of the most important stuff to have everything organized, and more videos you make about that - the better it is for everyone following you and watching your videos. Thanks for that link to Adam Wathans video, I've seen it like 5 months ago and his way of seeing things and programming (yes, since then I've done his Test Driven Laravel) it totally changed the way I'm doing stuff now. Like even for simple projects I'm making as many Controllers as needed sticking to CRUD methods only. All that makes my code very clean and readable. Like a huge library where every book has its own shelve and everybody knows where to find it.
@IlPandax3 жыл бұрын
Great video that all Laravel developer should watch and remember.
@NiKaabir3 жыл бұрын
One of the most helpful channels for laravel developers.. Plz upload some videos for beginners and cover all the topics from the ground up...
@jijogj3 жыл бұрын
Thank you. Im a developer from India. Recently started using laravel and lumen. Your videos are very informative.
@prykris3 жыл бұрын
I'm truly amazed how big proportion of his audience originates from south asia, mostly india. Why is that?
@LaravelDaily3 жыл бұрын
@@prykris Very big country, a lot of developers from there. In comparison, Latvia is a much smaller country. So that proportion is natural, I think :)
@madrise0072 жыл бұрын
finally found this video, thanks Sir, great video
@jefflroberts3 жыл бұрын
I just wanted to mention that sometimes in a large project, naming your view index.blade.php, show.blade.php, as so on can make it challenging to find files using ctrl-p in vs code. We have a pretty big system with lots of sub-modules and many views within each of those modules. When you press ctrl-p and start typing "show" you get a lot of results and it is not easy to find the show.blade.php view you are looking for. If I were creating this system again I would definitely consider adding the entity as a prefix to the action name of the blade files. I'd be curious to how others have addressed this as well. Thanks for a great video as always Povilas!
@LaravelDaily3 жыл бұрын
Valid point, but in such case I rarely type "show" in search, more like "article show" which finds exactly what I need.
@jefflroberts3 жыл бұрын
@@LaravelDaily That is true. I may need to just modify my search behavior some. The issue I was reminded of is that we have lots and lots of reports in this system (project) and I named the folder the templates were in the same as the report title and I named the main template for each report "report.blade.php" as well as there are some partials in each folder named something like "footer.blade.php" or "header.blade.php" and it has become somewhat of an issue to manager.
@BishalAdhikarii Жыл бұрын
modularize them project!
@SebastianMares3 жыл бұрын
How do you deal with things that are not related to a specific model, such as user registration or login? What about something like adding a PDF download option for a book? Would you do a separate controller just for that with the show method returning the PDF or would you handle it in the same controller as for the books?
@Moles6663 жыл бұрын
Hi Povilas, Could you please create a video about caching? Memcached and Redis?
@LaravelDaily3 жыл бұрын
Maybe sometime in the future. Added to the (already huge) to-do list.
@msdeav3 жыл бұрын
@@LaravelDaily waiting for this...
@TioJobs3 жыл бұрын
Awesome video! Thanks Povilas from Brazil.
@ashikmehermobin99263 жыл бұрын
All in one place ❤️
@thandohlophe9263 жыл бұрын
wow!!!! this just elevated my coding logic!!!
@evolveint2 жыл бұрын
Wonderful, but can you explain your recommendation with news model. I think it's a individual case
@bobbyiliev_3 жыл бұрын
This is awesome! I think that the same video but for Livewire would be very beneficial too!
@tirsolecointere3 жыл бұрын
Thanks for the video! Is there any convention or recommended way for naming permissions?
@prykris3 жыл бұрын
Hi Povilas, great video however I'm taking the privilege of being one of the first to comment and ask you a question about controllers. What should I do if I have two controllers that revolve around same model, but is under different path designed to be used by selected set of users, say admins. For this example, is following approach good practice - take User model and have UserController under User namespace for user and have new controller with same name under Admin namespace for admins. Love from Latvia!
@LaravelDaily3 жыл бұрын
I recently asked the same thing to my Twitter audience, read the replies please :) twitter.com/PovilasKorop/status/1361306825187086338 Love back from Lithuania!
@nlangerdev3 жыл бұрын
Personally I use plural for controllers and singular for models. That way when I read something like new Order it makes more sense to me than new Orders. So OrdersController & Order Model
@8085676402202 жыл бұрын
Thank you
@BelFaRo20083 жыл бұрын
It's even more complicated... plural of "Buch" is "Bücher" As you mentioned: Never use any other language than english in your code ;)
@LaravelDaily3 жыл бұрын
Oh right, irregular noun, my German from high school is dying from no practice since then :)
@ricko133 жыл бұрын
Such a helpful video! thank you
@mackynyxz3 жыл бұрын
Thanks for this. this is helpful!
@codewithtee3 жыл бұрын
Watching this gives me pleasure
@alila38833 жыл бұрын
I have a problem with table naming that has two words Ex. order_items In my case, I have a Product model and an Order model so I want to name the right practice name : is it order_items or item_orders? Thank Mr. Povilas
@LaravelDaily3 жыл бұрын
Personal preference, whatever is more clear for yourself.
Nice vid as always. Do you have a video snippet how to make a proper testing approach with laravel specially with just API testing also how to run the testing faster.
@LaravelDaily3 жыл бұрын
Nothing specifically about that. Run testing faster needs debugging, where exactly it's slow for you - database migrations, API requests, etc. Can be many reasons.
For creating migration with existing tables you can do, php artisan make: migration AddUserIdToCompanies
@dndhndn3 жыл бұрын
how about the URLs prefix for a resource? is it using plural or singular?
@omartarek64413 жыл бұрын
Thank you for the video!
@debjit213 жыл бұрын
As always very good content.
@antt00233 жыл бұрын
Helpful thanks.
@meetdave76593 жыл бұрын
Please help me find out the Best Formattor for Laravel Development in VS Code in 2021.
@mcflybigfoot49723 жыл бұрын
Migration table names are guessed by: TableGuesser (\Illuminate\Database\Console\Migrations\TableGuesser) It defines the patterns for for this behaviors: const CREATE_PATTERNS = [ '/^create_(\w+)_table$/', '/^create_(\w+)$/', ]; const CHANGE_PATTERNS = [ '/_(to|from|in)_(\w+)_table$/', '/_(to|from|in)_(\w+)$/', ]; The table names come from the "(\w+)" match.
@Akosiyawin3 жыл бұрын
This is what I'm looking for
@kennedymwenda33573 жыл бұрын
Say something about "SingleActionController" Dries Vints create of blade-ui-kit prefers that over Resources controllers. Reason: Easy code reading & maintainability
@LaravelDaily3 жыл бұрын
I'm not a big fan of them, but that's personal reference. I don't like 100 Controllers in my code base, I prefer 10-20.
@CodingBirdsOnline3 жыл бұрын
Loved This ❤️
@nikitasmirnovs61133 жыл бұрын
What about suffixes for Interfaces?
@Skylence_3 жыл бұрын
In a company how can it best be applied? I'd assume you can set up a wiki with best practices and what will be accepted and not as commits? And everybody is kind of required to set up linters on their ide's or you make a general company linter configuration for one or more ide's, everybody should uses the same ide? Magento code is tough with naming conventions and best practices, especially with xml tags, some tag names matter, others not at all but then you name it anyway so now it looks like it matters.
@LaravelDaily3 жыл бұрын
1. Identical IDE configs 2. Some Code checking of every commit, on a staging server or before deployment, with tools like CodeSniffer, etc 3. Code reviews from the team Not sure about Magento, thought, haven't worked with it.
@marczello81623 жыл бұрын
Laravel is some strange with this. In example in /App/Http/ Laravel create folders Controllers, Requests, Rules (plural) etc, but we also have folder Middleware (singular)
@masahiroyasuda86083 жыл бұрын
Nice video👍
@Akosiyawin3 жыл бұрын
Should I use resource file even if I'm using only two methods on it
@madrise0072 жыл бұрын
sir, how to name route URL ? is it good if it contains a capital case (ex : laravel.test/UserDashboard), or should it use "-" (ex : laravel.test/user-dashboard) to separate long slug names? Thanks
@LaravelDaily2 жыл бұрын
It's your personal preference
@madrise0072 жыл бұрын
@@LaravelDaily How about your preference sir? Do you use hyphens or capital cases? Thanks
@LaravelDaily2 жыл бұрын
Hyphens.
@madrise0072 жыл бұрын
@@LaravelDaily Thank you so much Sir
@Skylence_3 жыл бұрын
I wonder how far you could actually go with emoji's in programming from a fresh laravel installation 😅 just for fun. Would i be able to use 🐇 as controller and model? 🐇Controller 🐰 = Model
@LaravelDaily3 жыл бұрын
Sure! github.com/spatie/emoji
@Skylence_3 жыл бұрын
@@LaravelDaily i mean can the controller or model actually use the classname "😄🐰🐇". Would MySQL also accept table names as emoji's too? I assume not.
@LaravelDaily3 жыл бұрын
@@Skylence_ Nah, unfortunately MySQL doesn't have that level of sense of humor.
@Skylence_3 жыл бұрын
@@LaravelDaily i'm gonna try in the weekend with laravel and vue as SPA 😄 i bet Javascript should be capable to deal with emoji's. Like not in values but actually function names and perhaps vue routes. 🤔
@computer23able3 жыл бұрын
my teacher told : BooksController plural - singular model usermodel - db plural : users
@Tomas-js4wt3 жыл бұрын
I noticed you are not using "declare (strict_types = 1);". Don’t you need it or don’t like it for any reason? Isn’t that necessary when working with Laravel at all?
@MrL223 жыл бұрын
I do find it quite annoying at times as you get Models like "Country" but the table is assumed to be "countys" unless you set $table = 'countries'.
@cutiex73573 жыл бұрын
DAMN you have the most useful videos EVERRRRR
@Fazz3213 жыл бұрын
I was taught to make all names for db entities singular in university, I'll stick to that.
@nikitasmirnovs61133 жыл бұрын
you set $table property in every model manually?
@Fazz3213 жыл бұрын
@@nikitasmirnovs6113 well, yep, but this is the only downside, and it's not like I can miss it.
@ritomukherjee83893 жыл бұрын
Hi, expert I have a laravel project for one of my client, in 5.4.36,& I want to upgrade it to at least laravel 7.x. Please help me out, on how can it be done the most esiet but scalable way. FYI it is an e-commerce project
@LaravelDaily3 жыл бұрын
Try laravelshift.com and then you would have to do manual work on top. There's no *easy* way.
@ritomukherjee83893 жыл бұрын
@@LaravelDaily ok thanks a ton
@bewildstudio3 жыл бұрын
But what about naming tests?))
@LaravelDaily3 жыл бұрын
With tests, the rule is this: name them however you want, as soon as you write them at all :)
@Shez-dc3fn3 жыл бұрын
can we not just use one case everywhere? that way you wont hae to think. for ex. model, controller, resources, seeders, factories etc
@JeremyStreich3 жыл бұрын
Book is a bad example, because for other nouns the controller is plural when created by "php artisan make:model Thing -c"
@khuongnguyen88643 жыл бұрын
Please save me about websocket laravel php thanks very much
@konakonaxiong76212 жыл бұрын
If the table name is books, then the table of its reviews should be books_ Reviews or book_ What about reviews? Which is more reasonable?
@LaravelDaily2 жыл бұрын
Your personal preference
@konakonaxiong76212 жыл бұрын
@@LaravelDaily I think I prefer book_reviews
@JohnnyBigodes3 жыл бұрын
Plural for Buch is Bücher... NEVER EVER WRITE SOURCE CODE IN ANOTHER LANGUAGE THAN ENGLISH... Thanks
@shaungbhone83683 жыл бұрын
Are you German?
@LaravelDaily3 жыл бұрын
No, Lithuanian
@nejuspesnejsi3 жыл бұрын
Cool videos. Thanks!!! Just cut the crap. It took you 58 seconds to start saying anything. Unless you're one of these people who are aiming for 10 minutes videos no matter what. Then .... .