12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace App\Listeners;
- use App\Events\DeleteWarea;
- use App\Models\WarZone;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Contracts\Queue\ShouldQueue;
- class DeleteWareaListener
- {
- /**
- * Create the event listener.
- *
- * @return void
- */
- public function __construct()
- {
- //
- }
- /**
- * Handle the event.
- *
- * @param DeleteWarea $event
- * @return void
- */
- public function handle(DeleteWarea $event)
- {
- $warea=$event->warea;
- $war_name= explode('战区',$warea->name)[0];
- WarZone::where('war_name',$war_name)->delete();
- }
- }
|