-
routes/web.php
Open in GitHubuse App\Http\Controllers\Submission\ApproveStreamController; use App\Http\Controllers\Submission\RejectStreamController; use Illuminate\Support\Facades\Route; Route::middleware('signed')->group(function() { Route::get('submission/{stream}/approve', ApproveStreamController::class)->name('stream.approve'); Route::get('submission/{stream}/reject', RejectStreamController::class)->name('stream.reject'); });
-
app/Models/Stream.php
Open in GitHubuse Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\URL; class Stream extends Model { // public function approveUrl(): string { return URL::temporarySignedRoute( 'stream.approve', now()->addMonth(), ['stream' => $this], ); } public function rejectUrl(): string { return URL::temporarySignedRoute( 'stream.reject', now()->addMonth(), ['stream' => $this], ); } // }
-
resources/views/mail/submitted.blade.php
Open in GitHub@component('mail::message') Hi, A new stream was submitted: * title: "[{{ $stream->title }}]({{ $stream->url() }})" * by: {{ $stream->submitted_by_email }} * language: {{ $stream->language_code }} ? [Approve]({{ $stream->approveUrl() }}) ? [Reject]({{ $stream->rejectUrl() }}) Greets, Larastreamers @endcomponent