You've already forked Atomcms-edit
Initial commit
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\RadioGiveaway;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\View\View;
|
||||
|
||||
class RadioGiveawayController extends Controller
|
||||
{
|
||||
public function index(): View
|
||||
{
|
||||
$giveaways = RadioGiveaway::where('is_active', true)
|
||||
->orderBy('starts_at', 'desc')
|
||||
->get();
|
||||
|
||||
return view('community.radio.giveaways.index', ['giveaways' => $giveaways]);
|
||||
}
|
||||
|
||||
public function show(RadioGiveaway $giveaway): View|RedirectResponse
|
||||
{
|
||||
if (! $giveaway->is_active) {
|
||||
return redirect()->route('radio.giveaways.index')->with('error', __('radio.not_active'));
|
||||
}
|
||||
|
||||
return view('community.radio.giveaways.show', ['giveaway' => $giveaway]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user