Despite what people like to think about PHP, it is still the most dominant server-side language on the web and Laravel is the most popular framewor...
For further actions, you may consider blocking this person and/or reporting abuse
Nice overview :)
Highlights a lot of the key features of Laravel (I learnt a lot here!) and also a lot of the flaws of PHP and ways to work around them (e.g. lack of native enums!).
I think it's worth noting that, when optimising for readability rather than "cleverness", generally it's best to avoid things like "variable variables" as they just confuse things and there's normally a way to write the same thing in a less confusing manner :) Just because one can do things like that, doesn't mean one should!
I think the "variable variables" thing is more like a trick question I've never seen somebody use this kinda thing and if somebody did I'd assume they are overcomplicating something
Yes exactly - treat it as a code smell.
Q12: How do you do soft deletes?
Then goes and explains what are scopes.
Soft delete could be implemented as a scope with a filter like
where deleted = false
:)Wouldn't you just use the SoftDeletes Trait? It seems pointless to use scopes to do soft deletes. Plus the question says how to do Soft Deletes but does not show anything to do with it. That would be a fail in my books and would show the person can't read.
Fair enough - I must admit I don't do Laravel on a daily basis so wasn't aware of the SoftDeletes trait - was just working out from the context of the OP's article that they were implying scopes could be used for soft deletes...
I think the author just messed up the copypasta :)
Anyone who is interested in proper explanation, please refer to laravel.com/docs/6.x/eloquent#soft...
Ah nice thanks for the link
This is great!
'Q12: How do you do soft deletes?' answers about scopes instead.
A 'paste' mistake, it seems. :)
Excellent recap! This clarifies a lot of concepts.
Amazing Article, I am now aware of few new things in Laravel.
Keep Posting!! :-)
Hey Alex, This is a great overview on Laravel Interview Questions (Answered). Awesome, Thank you so much, Alex, for taking the time to write all this. It’s very helpful for us! Thank you.
Amazing article! is really useful!
Hey, there are some solid inquiries. Here are a few additional queries from our list of Best interview question.
Brother, this post is Very useful! Thank you. There were features I actually didn't know yet. I'm gonna try it out right now. ;)