gpt4 book ai didi

php - 未找到 InvalidArgumentException View [layouts.app]。 Laravel-8 LiveWire-2

转载 作者:行者123 更新时间:2023-12-05 06:02:15 27 4
gpt4 key购买 nike

当我将 app.blade.php 更改为 base.blade.php 时,出现以下错误。

InvalidArgumentExceptionView [layouts.app] not found. (View: D:\Code\my-app\vendor\livewire\livewire\src\Macros\livewire-view-component.blade.php)

layouts.app was not found.
Did you mean layouts\base?

否则,效果很好。

-这是我的代码。
资源\ View \布局\base.blade.php

<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
@livewireStyles
</head>
<body>
@livewire('auth.register')

@livewireScripts
</body>
</html>

资源\views\livewire\auth\register.blade.php

<div>
Registration Form
</div>

网络.php

<?php

use App\Http\Livewire\Auth\Register;
use Illuminate\Support\Facades\Route;


Route::get('/register', Register::class);

应用\Http\Livewire\Auth\Register.php

<?php

namespace App\Http\Livewire\Auth;

use Livewire\Component;

class Register extends Component
{
public function render()
{
return view('livewire.auth.register');
}
}

Note: app.blade.php is still works

最佳答案

您必须搜索任何引用最后一个 app.blade.php 源的内容。在某些情况下, Blade 是从主体延伸出来的,所以 Blade 可能具有指令 @extends('layout.app') 并且需要很好地引用

关于php - 未找到 InvalidArgumentException View [layouts.app]。 Laravel-8 LiveWire-2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66973185/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com