Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #52 from zeo/master
Browse files Browse the repository at this point in the history
Add back PageController.php
  • Loading branch information
Larsklopstra authored Nov 17, 2020
2 parents 8e7126b + f3d9d24 commit 7f57c2c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Http/Controllers/PageController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Larsklopstra\Nebula\Http\Controllers;

use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Http\Request;
use Larsklopstra\Nebula\Contracts\NebulaPage;

class PageController
{
public function index(Request $request, NebulaPage $page)
{
if ($page->canSeeCallback && !$page->canSeeCallback($request)) {
throw new AuthorizationException;
}

return view('nebula::pages.index', [
'page' => $page
]);
}
}

0 comments on commit 7f57c2c

Please sign in to comment.