mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
143 - Testing Events
This commit is contained in:
23
app/Events/ConcertAdded.php
Normal file
23
app/Events/ConcertAdded.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
|
||||
class ConcertAdded
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
|
||||
public $concert;
|
||||
|
||||
public function __construct($concert)
|
||||
{
|
||||
$this->concert = $concert;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Backstage;
|
||||
use App\Concert;
|
||||
use App\NullFile;
|
||||
use Carbon\Carbon;
|
||||
use App\Events\ConcertAdded;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -59,6 +60,8 @@ class ConcertsController extends Controller
|
||||
'poster_image_path' => request('poster_image', new NullFile)->store('posters', 'public'),
|
||||
]);
|
||||
|
||||
ConcertAdded::dispatch($concert);
|
||||
|
||||
return redirect()->route('backstage.concerts.index');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user