...和監(jiān)聽器。當(dāng)然,已經(jīng)存在的事件和監(jiān)聽器將保持不變:php artisan event:generateCopy
http://m.o2fo.com/laravel_8/laravel_8-53vd3hg9.html...輯。它只是一個已購買的 Order 的實(shí)例的容器。如果使用 PHP 的 serialize 函數(shù)序列化事件對象,事件使用的 SerializesModels trait 將會優(yōu)雅地序列化任何 Eloquent 模型。
http://m.o2fo.com/laravel_8/laravel_8-f67r3hgd.html...failed 方法接收事件實(shí)例和導(dǎo)致失敗的異常作為參數(shù):<?php namespace App\Listeners; use App\Events\OrderShipped; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\InteractsWithQueue; class SendShipmentNotification implements ShouldQueue { use InteractsWithQueue; /*...
http://m.o2fo.com/laravel_8/laravel_8-eovu3hgf.html...接口導(dǎo)入到當(dāng)前命名空間中,因此你可以直接使用:<?php namespace App\Listeners; use App\Events\OrderShipped; use Illuminate\Contracts\Queue\ShouldQueue; class SendShipmentNotification implements ShouldQueue { // }Copy就是這樣!現(xiàn)在,當(dāng)這個監(jiān)聽器被事件調(diào)用時...
http://m.o2fo.com/laravel_8/laravel_8-lmbo3hgg.html...,如果 shouldQueue 方法返回 false,則不會執(zhí)行監(jiān)聽器:<?php namespace App\Listeners; use App\Events\OrderPlaced; use Illuminate\Contracts\Queue\ShouldQueue; class RewardGiftCard implements ShouldQueue { /** * 給客戶獎勵禮品卡 * * @param \App\Events\OrderPlaced $event * @...
http://m.o2fo.com/laravel_8/laravel_8-erdq3hgh.html...加載到生成的監(jiān)聽器中,并提供對這些方法的訪問:<?php namespace App\Listeners; use App\Events\OrderShipped; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\InteractsWithQueue; class SendShipmentNotification implements ShouldQueue { use InteractsWithQueue; /**...
http://m.o2fo.com/laravel_8/laravel_8-6y313hgi.html...以全局使用,你可以在應(yīng)用中的任何位置進(jìn)行調(diào)用:<?php namespace App\Http\Controllers; use App\Events\OrderShipped; use App\Http\Controllers\Controller; use App\Models\Order; class OrderController extends Controller { /** * 為給定的訂單發(fā)貨 * * @param int $orderId * ...
http://m.o2fo.com/laravel_8/laravel_8-dtxy3hgj.html...給定事件分發(fā)器上的 listen 方法來注冊事件監(jiān)聽器:<?php namespace App\Listeners; class UserEventSubscriber { /** * 處理用戶登錄事件 */ public function handleUserLogin($event) {} /** * 處理用戶注銷事件 */ public function handleUserLogout($event) {} /** * 為事件...
http://m.o2fo.com/laravel_8/laravel_8-efv33hgl.html...者。例如,讓我們將 UserEventSubscriber 添加到列表中:<?php namespace App\Providers; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class EventServiceProvider extends ServiceProvider { /** * 應(yīng)用的事件監(jiān)聽器映射 * * @var array */ prot...
http://m.o2fo.com/laravel_8/laravel_8-f7mz3hgm.html...dle 方法中,你可以執(zhí)行任何必要的響應(yīng)事件的操作:<?php namespace App\Listeners; use App\Events\OrderShipped; class SendShipmentNotification { /** * 創(chuàng)建事件監(jiān)聽器 * * @return void */ public function __construct() { // } /** * 處理事件 * * @param \App\Events\OrderS...
http://m.o2fo.com/laravel_8/laravel_8-vkiw3hgp.html抱歉,暫時沒有相關(guān)的微課
w3cschool 建議您:
抱歉,暫時沒有相關(guān)的視頻課程
w3cschool 建議您:
抱歉,暫時沒有相關(guān)的教程
w3cschool 建議您:
...和監(jiān)聽器。當(dāng)然,已經(jīng)存在的事件和監(jiān)聽器將保持不變:php artisan event:generateCopy
http://m.o2fo.com/laravel_8/laravel_8-53vd3hg9.html...輯。它只是一個已購買的 Order 的實(shí)例的容器。如果使用 PHP 的 serialize 函數(shù)序列化事件對象,事件使用的 SerializesModels trait 將會優(yōu)雅地序列化任何 Eloquent 模型。
http://m.o2fo.com/laravel_8/laravel_8-f67r3hgd.html...failed 方法接收事件實(shí)例和導(dǎo)致失敗的異常作為參數(shù):<?php namespace App\Listeners; use App\Events\OrderShipped; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\InteractsWithQueue; class SendShipmentNotification implements ShouldQueue { use InteractsWithQueue; /*...
http://m.o2fo.com/laravel_8/laravel_8-eovu3hgf.html...接口導(dǎo)入到當(dāng)前命名空間中,因此你可以直接使用:<?php namespace App\Listeners; use App\Events\OrderShipped; use Illuminate\Contracts\Queue\ShouldQueue; class SendShipmentNotification implements ShouldQueue { // }Copy就是這樣!現(xiàn)在,當(dāng)這個監(jiān)聽器被事件調(diào)用時...
http://m.o2fo.com/laravel_8/laravel_8-lmbo3hgg.html...,如果 shouldQueue 方法返回 false,則不會執(zhí)行監(jiān)聽器:<?php namespace App\Listeners; use App\Events\OrderPlaced; use Illuminate\Contracts\Queue\ShouldQueue; class RewardGiftCard implements ShouldQueue { /** * 給客戶獎勵禮品卡 * * @param \App\Events\OrderPlaced $event * @...
http://m.o2fo.com/laravel_8/laravel_8-erdq3hgh.html...加載到生成的監(jiān)聽器中,并提供對這些方法的訪問:<?php namespace App\Listeners; use App\Events\OrderShipped; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\InteractsWithQueue; class SendShipmentNotification implements ShouldQueue { use InteractsWithQueue; /**...
http://m.o2fo.com/laravel_8/laravel_8-6y313hgi.html...以全局使用,你可以在應(yīng)用中的任何位置進(jìn)行調(diào)用:<?php namespace App\Http\Controllers; use App\Events\OrderShipped; use App\Http\Controllers\Controller; use App\Models\Order; class OrderController extends Controller { /** * 為給定的訂單發(fā)貨 * * @param int $orderId * ...
http://m.o2fo.com/laravel_8/laravel_8-dtxy3hgj.html...給定事件分發(fā)器上的 listen 方法來注冊事件監(jiān)聽器:<?php namespace App\Listeners; class UserEventSubscriber { /** * 處理用戶登錄事件 */ public function handleUserLogin($event) {} /** * 處理用戶注銷事件 */ public function handleUserLogout($event) {} /** * 為事件...
http://m.o2fo.com/laravel_8/laravel_8-efv33hgl.html...者。例如,讓我們將 UserEventSubscriber 添加到列表中:<?php namespace App\Providers; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; class EventServiceProvider extends ServiceProvider { /** * 應(yīng)用的事件監(jiān)聽器映射 * * @var array */ prot...
http://m.o2fo.com/laravel_8/laravel_8-f7mz3hgm.html...dle 方法中,你可以執(zhí)行任何必要的響應(yīng)事件的操作:<?php namespace App\Listeners; use App\Events\OrderShipped; class SendShipmentNotification { /** * 創(chuàng)建事件監(jiān)聽器 * * @return void */ public function __construct() { // } /** * 處理事件 * * @param \App\Events\OrderS...
http://m.o2fo.com/laravel_8/laravel_8-vkiw3hgp.html抱歉,暫時沒有相關(guān)的文章
w3cschool 建議您: