I am just learning laravel and now I am trying to pass data to a view.. but its not passing everytime it gives error:
View [layouts.{{$admin_theme}}.admin.admin] not found.
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');
return response()->view('admin.auth.login')->with("admin_theme", $admin_theme);
} else {
return response()->view('admin.dash');
}
return $next($request);
}
}
and this is view:
@extends('layouts.{{$admin_theme}}.admin.admin')
@section('title', 'Mangement Login Area')
Route web.php
Route::get('/auth', function () {
// This is for admin login. We'll varify if admin is already logged in or not.. if yes, then, we'll redirect.
// We'll verify it using a middleware adminlogin.
})->middleware('adminlogin');
viewname.blade.php.