Laravel?? ?????? ????? ???? ??? ???? ???? ??? ??????
Laravel? ?????? ????? ??? ?? ??? ??? ??? ???? ??? ???? ???? ? ?????. ???? ?? ?? ??? ???? ????? ??? ?? ??? ??????? ????? ?????. ??? ???? ????? ???? ??????? ??? ??? ????????.
Laravel?? ?????? ????? ????? Eloquent Models?? ???? DB
Facade ?? transaction
??? ??? ? ????. ??? DB
Facade? ???? ????.
<code class="php">use Illuminate\Support\Facades\DB; DB::transaction(function () { DB::table('users')->update(['votes' => 1]); DB::table('posts')->delete(); });</code>
? ???? DB::transaction
?? ?? ? ???? ???? ??? ??????? ??? ?????. ?? ??? ??? ???? Laravel? ???? ??? ?????.
?? ??? ???? ?? ???? ?? transaction
???? ??? ? ????.
<code class="php">use App\Models\User; User::transaction(function () { $user = User::find(1); $user->votes = 1; $user->save(); // Other operations within the transaction });</code>
? ???? ??? ???? ??? ???? ??? ????? ??? ????? ?? ? ? ? ?? ? ? ??????.
Laravel?? ?????? ????? ?????? ?? ??? ??????
Laravel?? ?????? ????? ????? ????? ??? ??? ? ?? ???? ??? ???? ?? ?? ?? ??? ???????. ? ?? ?? ??? ??? ????.
- ??? ??? ?? ?????? : ????? ??? ?? ??? ??? ?? ??? ? ???????. ?? ?? ?? ??? ???? ???? ??? ??? ???? ? ????.
-
??? ?? ?? ?? : Laravel? ?? ???? ?? ??? ????? (? :
READ COMMITTED
,REPEATABLE READ
,SERIALIZABLE
). ?? ????? ??? ??? ?? ??? ??? ??????.<code class="php">DB::beginTransaction(); DB::statement('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE'); // Your transaction code here DB::commit();</code>
- ?? ??? ????? : Laravel? ?? ??? ?? ?? ??? ???? ????. ?? ?? ???
DB::transaction
?? ? ? ??? ?? ???? ??? ? ??????????. -
?? ??? SavePoints? ?????? . ????? ????? ?? ???? ?? SavePoints? ??? ? ????.
<code class="php">DB::beginTransaction(); DB::savepoint('first_operation'); // First operation DB::savepoint('second_operation'); // Second operation DB::rollbackTo('first_operation'); DB::commit();</code>
- ???? ?? ???? : Laravel? ?? ? ???? ??? ???? ????? ?? ??? ??? ???? ??? ? ?? ??? ?????.
??? ???? ???? ?? Laravel ?????? ???? ? ??? ??? ?? ? ? ???????
Laravel ?????? ???? ??? ??? ???? ?? ??? ???? ???? ? ?????. Laravel? ???? ?? ??? ??? ???? ????? ???? ?????. ????? ??? ? ??? ?? ??? ?? ?? ??? ??? ?? ????.
?? ? ??? ?? ? ??? ??? ??? ????.
<code class="php">use Illuminate\Support\Facades\DB; use Exception; try { DB::transaction(function () { DB::table('users')->update(['votes' => 1]); // This will throw an exception DB::table('non_existent_table')->delete(); }); } catch (Exception $e) { // Log the exception report($e); // Optionally, perform any necessary cleanup or additional handling // ... // The transaction has already been rolled back by Laravel }</code>
? ???? ??? ???? ????? ???? ?????. ??? ???? ?? ?? ??? ?? ??? ?? ? ? ????.
?? ???? ?? ??? ?? ?? ?? ??? ???? ?? ??? ??? ??? ?? ? ? ??????.
<code class="php">use Illuminate\Support\Facades\DB; use Exception; use Illuminate\Database\QueryException; try { DB::transaction(function () { // Transaction operations }); } catch (QueryException $e) { // Handle database-specific exceptions report($e); // Rollback is automatic, but you can perform additional cleanup } catch (Exception $e) { // Handle other exceptions report($e); // Rollback is automatic }</code>
Laravel? ?????? ??? ?????? ????? ?? ?? ??? ??????
Laravel? ?????? ????? ?????? ????? ? ?? ??? ???? ???? ??? ???? ??? ??? ? ? ??? ?????.
-
LARAVEL ??? : ???? Laravel ??????? ??? ??????. ???? ???? ?????? ??? ?? ???? ?????. ? ??? ?? ??, SQL ? ? ???? ? ? ????.
???? ????? ??????.
<code class="bash">composer require laravel/telescope</code>
?? ?? Laravel ??? ?? ??? ?????.
-
Laravel Debugbar : Debugbar? ?????? ??? ??? ???? ? ?? ??? ?????. ???? ?? ? ???? ??? ?????? ??? ?? ??? ??? ?????.
??? ? ????? ?? :
<code class="bash">composer require barryvdh/laravel-debugbar --dev</code>
?? ?? ?? ??? ?? ?? ?????? ???????.
-
Laravel Logging : Laravel? ?? ?? ???? ???? ???? ?? ???? ?? ? ? ????. ???? ??? ?? ??? ?? ??? ???? ?? ??? ???? ??? ?? ? ? ????.
<code class="php">use Illuminate\Support\Facades\Log; DB::transaction(function () { Log::info('Transaction started'); // Transaction operations Log::info('Transaction completed successfully'); });</code>
-
?? ?? : Laravel? ?? ? ?? ??? ???? ?? ?? ??? ??? ? ? ????. ?? ???? ???? ?? ? ? ????.
<code class="php">DB::enableQueryLog(); DB::transaction(function () { // Transaction operations }); $queries = DB::getQueryLog(); // Process or log the queries</code>
??? ??? ???? ?????? ????? ?? ???? ??? ??? ????? Laravel ??????? ??? ??? ?? ? ? ????.
? ??? Laravel?? ?????? ????? ???? ??? ???? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

TOWORKEFCITIVE WITHPIVOTTBLESINLARAVEL, FIRDSCESSPIVOTDATAUSINGWITHPIVOT () ORWITHTIMESTAMPS (), thenupdateentrieswithupdatee XistingPivot (), ManagerElationshipsviadetach () andsync (), andusecustompivotmodelswheneded.1.usewithpivot () toincludescificcol

LaravelProvideAcleanAnandflexiblewaytosendNotificationsViamultipleChannels LikeEmail, SMS, In-Appalerts ? PushNotifications.youdeFinenotificationChannelsinThevia () MethodofanotificationClass, and ortovonage (), Ortovonage ()

??? ??? ?? ? ???? Laravel? ??? ????? ?? ??? ???? ???? ?????. ??? ????? ?? ????? ???? ???? ?? ?? ??? ?? ? ??? ?????. Laravel? ?? ????? ?? ???? ?? ???? ??? ??? ?? ??? ?????. ??? ????? ? ??? ??? ?? ??? BIND ??? ????? ?? ?? ???? ?? ?? ????? ? ??? ? ????. ?? ??? ?? ?? ????? ????, ??? ???? ???,???? ???? ???? ????, ?? ?? ?? ??? ???????. ?? ????? ?? ??? ? ?? ??? ?? ? ? ????.

Laravel ?? ???? 4 ?? ?? ??? ?? ?? ???? ???? ???? ? ????. 1. ?? ????? ???? ?? ??? ??? ??? ?? ???? ??? ???? ?????? ??? ??? ????? ?? ??? ?? ???? ??? ??????. 2. ???? ?? ????? ??????? ?????, n 1 ??? ???, ?? ??? ????, ??? ??, ??? ?? ? ?? ? ?? ??, ?? ??? ????. 3. ?? ?? ?? ? ?? ???? ??? ??? ?? ?? ??? ? ??? ???? ???? ???? ???? ???? ? ?? ????? ??????. 4. ??? ?? ? ???? ??? ??? ??? ?? ???? ????? ?? ?????? ????? ?? ???? ? ??? ?? ??? ????? ??????.

Laravel ????? ?????? ??? ???? ???? RefreshDatabase ??, ??? ??? ??, ?? ??? ?? ? ??? ?? ?? ??? ?????. 1. ?? ??? ???? ? ???? ??? ??????? ??????? ???? ?? ?????? ??? ???? ?????????. 2. ?? ??? ???? ??? ???? ??? ?? ???? ?? ?? ???? ?????. 3. DatabasEtransactionStrait? ???? ??? ?? ??? ????? ? ?????????. 4. ???? ???? ???? ??????? ???? ??? ? ?? ? ??????? ?? ??????. ??? ??? ???? ???? ???? ???? ?? ??? ? ??? ??? ?? ???? ?????.

Laravelsanctum? SPA ?? ??? ??????? ?? ???? ?? API ??? ??? ?? ??? ?? OAUTH2 ??? ??? ????? ?????. 1. Sanctum? ?? ?? ??? ????, ??? ???? ?????. 2. Passport? ?? ?? ? ????? ?? ??? ?? ??? ????? ????, ?? ???? ?????? ?????. 3. ?? ?? ? ??? ? ???? ?? ?? ??? ????. 4. ?? ??? ?????? ??? ???? ??? ?? ??? ??? ???? ?????. ??? ? ???? ?? ??? ?? OAUTH2 ??? ???? ??? ???????.

Laravel? ?? ???? ?????? ???? ??? ??????. 1. DB :: Transaction () ???? ???? ??? ???? ???? ?? ?? ?? ?? ?? ??; 2. ?? ? ????? ???? ?? ???? ?? ????? ????? ?? ???? ??? ???? ???? ??? ?? ????. 3.?? ??? ??? ??? ????? ??? begintransaction (), commit () ? rollback ()? ?? ?? ?? ??? ?????. 4. ?? ???? ??? ?? ????, ??? ?? ??, ??? ?? ? ?? ?? ??? ?????. ????? ?? ?? ??? ???? ?? ???? ??? ? ??? ???? ? ????.

Laravel?? HTTP ?? ? ??? ???? ??? ?? ???, ?? ?? ? ?? ???? ??? ????? ????. 1. ?? ???? ?? ? ? ?? ????? ?? ?? ????? ???? input () ?? ?? ???? ???? ??? ?? ??? ?? validate () ?? ?? ?? ???? ?? ? ? ????. 2. Return Response? ???,??, JSON, ?? ?? ? ??? ?? ?? ? ???? ??? ?????. 3. ?? ???? ?? ? ?? ?? () ??? ? Store ()? ???? ??? ???????. ????? ?? ?? ?? ? ??? ?????? ???? ??? ??????? ??? ? ????.
