laravel5.6.35
ログイン機能を全体のページに対して付けたいのですがうまい具合にいきません…
自分が行ったことについてはいかに記載します.
/routes/web.phpにて
php
1<?php 2/* 3|-------------------------------------------------------------------------- 4| Web Routes 5|-------------------------------------------------------------------------- 6| 7| Here is where you can register web routes for your application. These 8| routes are loaded by the RouteServiceProvider within a group which 9| contains the "web" middleware group. Now create something great! 10| 11*/ 12Auth::routes(); 13 14if (Auth::has('login')) { 15 Route::get('/', function () { 16 return view('welcome'); 17 }); 18 19 Route::resource('hello','calendarController')->middleware('hello'); 20 Route::get('hello','calendarController@getSearch')->middleware('hello'); 21 // Route::get('rest','RestappController'); 22 23 Route::get('/home', 'HomeController@index')->name('home'); 24} 25
loginが確認できしだい,他のRouteを読み込もうと思ったのですがエラーが出ます…
エラーについて
"Method Illuminate\Auth\SessionGuard::has does not exist.
ご助力よろしくお願いします…
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/20 00:33