Ich versuche, eine Ansicht aus einer Middleware zu nennen, aber ich bin immer diese Fehlermeldung:nicht definierte Methode mit() Laravel
Call to undefined method Illuminate\Http\Response::with()
Middleware
<?php
namespace App\Http\Middleware;
use Closure;
use App\Models\Readdb;
class Adminlogin {
public function handle($request, Closure $next) {
if (!$request->session()->has('userid')) {
$db = new Readdb();
$admin_theme = $db::get_setting('admin_theme');
$data = array(
'title' => 'My App yo',
'Description' => 'This is New Application',
'author' => 'foo'
);
return response()->view('admin.auth.login')->with($data);
} else {
return response()->view('admin.dash');
}
return $next($request);
}
}
View File
{{Session::get('name')}}
Verwenden Sie einfach die Rückansicht ('admin.auth.login') -> mit ($ data); –