Member Since 5 Months Ago
4,480 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
Replied to What's The True Benefit Of Using SaveOrFail() Instead Of Save()?
Thanks for your reply! I understand I should use just save() lol.
I understood that case, but this situation could happen??
I think no.
Started a new Conversation What's The True Benefit Of Using SaveOrFail() Instead Of Save()?
I read this thread,https://stackoverflow.com/questions/57494581/laravel-save-vs-saveorfail-real-difference-in-nutshell and some code. path: vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php
/**
* Save the model to the database using transaction.
*
* @param array $options
* @return bool
*
* @throws \Throwable
*/
public function saveOrFail(array $options = [])
{
return $this->getConnection()->transaction(function () use ($options) {
return $this->save($options);
});
}
And I still don't understand when to use saveOrFail().
Quick summary between two methods would be 「saveOrFail() just wraps save() in transaction.」
Usually, save() handles single model (means single record in database), so in this situation transaction means nothing.
Then when should we use saveOrFail()??
Replied to How To Efficiently Know Where One Method Is Tested.
Thanks for your reply! hmm... It can’t be helped.
Started a new Conversation How To Efficiently Know Where One Method Is Tested.
How to know where one method is tested efficiently.
The project I'm joining in is on operation phase.So my task is to update existing codes. In this situation I often want to know where this method is tested.
when I run test like
php artisan test
I want feedbacks like
this method is tested by
project/tests/Feature/...
and project/tests/Unit/...
One solution for this is ... Put dd() within the method
↓
Run php artisan test
then test will stop where this method is tested (and I can know where).
↓
Comment out the test method.
Run php artisan test
↓
Repeat above.
But this seems inefficient. Any ideas? Thanks.