added recipe link to navigation finally

This commit is contained in:
Beth Parker 2022-02-12 21:07:27 -06:00
parent 55c42dc043
commit feb8b6d0d9
3 changed files with 16 additions and 1 deletions

View file

@ -25,7 +25,7 @@ class LoginController extends Controller
* *
* @var string * @var string
*/ */
protected $redirectTo = '/admin'; protected $redirectTo = '/recipes';
/** /**
* Create a new controller instance. * Create a new controller instance.

View file

@ -10,6 +10,20 @@ use App\User;
class RecipeController extends Controller class RecipeController extends Controller
{ {
/**
* Enforce middleware
*/
public function __construct(){
$this->middleware('auth', ['except' => ['index','show']]);
$this->middleware(['permissions:CreateUser.EditUser.DeleteUser.AssignRole'], ['only' => ['index','show']]);
$this->middleware(['permissions:DeleteUser'], ['only' => ['destroy']]);
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index() public function index()
{ {
$recipes = Recipe::with('user')->get(); $recipes = Recipe::with('user')->get();

View file

@ -9,6 +9,7 @@
@else @else
<!-- Standard Links --> <!-- Standard Links -->
@include('layouts.segments.link', ['route'=>'home','text'=>'Home']) @include('layouts.segments.link', ['route'=>'home','text'=>'Home'])
@include('layouts.segments.link', ['route'=>'recipes.index','text'=>'Recipes'])
<!-- Authentication Links --> <!-- Authentication Links -->
@guest @guest