Тёмный

Database Transactions - Automatically Rollback If Something Goes Wrong - Laravel 

Laratips
Подписаться 18 тыс.
Просмотров 11 тыс.
50% 1

In this video, we will be looking at how to automatically roll back the database code that has been already executed when something goes wrong. We can make use of database transactions to roll back the changes when something goes wrong. Also there are some things that you need to do when using queues with database transaction. This video will show you in detail about this.
=== Important Links ===
Fonts, extensions I use, and Support Laratips links:
bit.ly/m/laratips
====================== Support ======================
If you want me to continue making this kind of video for free on RU-vid, then you can help me financially by sending a few bucks to my Wise (wise.com/invite/u/ashishd233) account in Nepalese 🇳🇵 currency.
My Wise email: ashish.dhamala2015@gmail.com
If you decide to support me, please send me your Twitter handle in the mail so that I can shout out about you.
====================== Social Media Links ======================
Let's be friends
/ aashish_dhamala
====================== Video Related Links ======================
Database transaction documentation link:
laravel.com/docs/8.x/database...
====================== Other Videos ======================
Laravel Package Development Playlist
• Laravel Package Develo...
Password Validation In Laravel with at least one Letters, Numbers, Upper and Lowercase or Symbols:
• Password Validation In...
Multiple Apis With ForwardsCalls Trait And Code Refactoring Tip - Laravel Hidden Feature:
• Multiple Apis With For...
Laravel Chunking - You Might Be Doing This Wrong - Problem and Solution:
• Laravel Chunking - You...
Laravel Tip - Properly Get Data Between Two Dates
• Laravel Tip - Properly...
Get Data From Multiple Databases In One Project | Laravel Tip
• Get Data From Multiple...
========= Theme and Font Used =========
Theme:
Cobalt2 Theme Official (marketplace.visualstudio.com/...)
Font:
JetBrains Mono (www.jetbrains.com/lp/mono/)
====================== Tech stack ======================
Laravel
PHP
#laravel #php #laraveltip #laratips

Опубликовано:

 

5 фев 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@sanjeetsagar
@sanjeetsagar 2 года назад
Really informative Thanks for sharing.
@mosharrafhossain2962
@mosharrafhossain2962 9 месяцев назад
nice explaination boss
@conan_97
@conan_97 2 года назад
Great, thank you!.
@mayanksgajjar
@mayanksgajjar Год назад
Very informative bro, Keep it up 🤗
@pushpenbanerjee9625
@pushpenbanerjee9625 2 года назад
Great Video Sir
@dhanushj.a420
@dhanushj.a420 6 месяцев назад
Nice tutorial. I'm new subscriber
@hernanmartinezreumann3279
@hernanmartinezreumann3279 2 года назад
Very interesting. Never used DB Transaction, but I will take into account
@ashishakya_
@ashishakya_ 2 года назад
Kudos to your dedication !!! it is awesome
@Laratips
@Laratips 2 года назад
Thanks
@brainyworld2184
@brainyworld2184 2 года назад
Nice content as always. Very informative. My question is even if the mail is not queued can afterCommit still stop the sending of mail if error occurs?
@Laratips
@Laratips 2 года назад
I am mot sure about that. Need to check.
@md.anwarhossain1179
@md.anwarhossain1179 2 года назад
It’s really helpful. Dear, please make a video which are changes in Laravel 9.❤️❤️
@Laratips
@Laratips 2 года назад
Coming up next
@md.anwarhossain1179
@md.anwarhossain1179 2 года назад
@@Laratips thanks dear❤️..we are waiting for it..
@GergelyCsermely
@GergelyCsermely 2 года назад
Thanks
@Laratips
@Laratips 2 года назад
You are welcome
@neerajsinghtangariya2587
@neerajsinghtangariya2587 2 года назад
Thank you I was not aware about transaction with mail part. Can you plz make video on bounce mail and unbounced mail part?
@Laratips
@Laratips 2 года назад
Different mail sending services like mailgun, postmark, etc will have hooks where you can add your application url. And let's say when en email is bounced, they will hit the url that you have specified. And you can easily say the mail as bounced by saving bounced info in the database if this url is hit.
@julienSibille
@julienSibille 2 года назад
Thank you ! How to proceed if some database insertion is performed in an external service class ? Is there a way to "queue" insertion ?
@Laratips
@Laratips 2 года назад
It doesn't matter where the database insertion is happening. As long as it's inside database transaction, it will get rolled back. I would recommend not to write DB::transaction inside service class but in controller always. That way you can be consistent.
@julienSibille
@julienSibille 2 года назад
@@Laratips Ok, but if let's say a Service is responsible for creating roles and permissions, how to proceed ? You send the user transaction to the service inside the DB transaction, and then if permission assignment fails into the service, will the transaction rollback ?
@Laratips
@Laratips 2 года назад
Yes, it will rollback if the service is inside transaction.
@julienSibille
@julienSibille 2 года назад
@@Laratips Ok thank you very much !
@n2dir
@n2dir 2 года назад
After commit is available in Observers too
@Laratips
@Laratips 2 года назад
Yes, its available in everything that can be queued.
Далее
Drive through the color🚗❓
00:13
Просмотров 5 млн
What is a Database Transaction? Be ACID compliant!
9:46
Junior Code Review: Try-Catch and DB Transactions
8:08
MongoDB in 100 Seconds
2:27
Просмотров 1 млн
I've been using Redis wrong this whole time...
20:53
Просмотров 336 тыс.
Microservices with Databases can be challenging...
20:52