Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

christophrumpel/larastreamers

238 stars
2 code files
View christophrumpel/larastreamers on GitHub

app/Actions/Submission/ApproveStreamAction.php

Open in GitHub
use App\Mail\StreamApprovedMail;
use App\Models\Stream;
use Illuminate\Support\Facades\Mail;
 
class ApproveStreamAction
{
public function handle(Stream $stream)
{
if (! is_null($stream->approved_at)) {
return;
}
 
$stream->approved_at = now();
 
$stream->save();
 
Mail::to($stream->submitted_by_email)->queue(new StreamApprovedMail($stream));
}
}

app/Mail/StreamApprovedMail.php

Open in GitHub
use App\Models\Stream;
use Illuminate\Mail\Mailable;
 
class StreamApprovedMail extends Mailable
{
public function __construct(
public Stream $stream
) {}
 
public function build()
{
return $this
->subject("The stream you've submitted has been approved")
->markdown('mail.approved');
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.