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
3 code files
View christophrumpel/larastreamers on GitHub

routes/web.php

Open in GitHub
use 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 GitHub
use 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

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.