mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
148 - Viewing an Unused Invitation
This commit is contained in:
18
app/Http/Controllers/InvitationsController.php
Normal file
18
app/Http/Controllers/InvitationsController.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Invitation;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class InvitationsController extends Controller
|
||||
{
|
||||
public function show($code)
|
||||
{
|
||||
$invitation = Invitation::findByCode($code);
|
||||
|
||||
return view('invitations.show', [
|
||||
'invitation' => $invitation,
|
||||
]);
|
||||
}
|
||||
}
|
||||
13
app/Invitation.php
Normal file
13
app/Invitation.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Invitation extends Model
|
||||
{
|
||||
public static function findByCode($code)
|
||||
{
|
||||
return self::where('code', $code)->first();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user