app/Http/Controllers/ExtraWordsController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index($shopId)
    {
        if (Auth::check() and Auth::user()->type == 'admin') {
			$shop = Shop::find($shopId);
			$words = ExtraWords::where('shop_id',$shopId)->get();
			return view('extrawords.table', compact('shop', 'words'));
		}
		else {
			return redirect('/login');
		}
    }
public function index ( $ shopId ) { if ( Auth :: check ( ) and Auth :: user ( ) -> type == 'admin' ) { $ shop = Shop :: find ( $ shopId ) ; $ words = ExtraWords :: where ( 'shop_id' , $ shopId ) -> get ( ) ; return view ( 'extrawords.table' , compact ( 'shop' , 'words' ) ) ; } else { return redirect ( '/login' ) ; } }
Display a listing of the resource.
Display a listing of the resource .