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

标签 php laravel laravel-8 laravel-livewire

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

InvalidArgumentException View [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/

相关文章:

laravel - 如何检查表单是否在laravel中提交?

composer-php - Laravel 8 中损坏的 composer.json 文件

php - 处理来自不同时区的时间并存储到mysql中

php - 拉维尔 5.4 : Api route list

php - 我正在尝试使用 jquery $.post() 将 <div> 内容发布到数据库

Laravel 8 Fortify 登录显示 429 TOO MANY REQUESTS

php - 将数组发送到 Blade 组件 (Laravel 8)

php - 在 Laravel 8 的单元测试中调用未定义的方法 Tests\Unit\TopPageTest::get()

javascript - 增加javascript中使用的php变量

php - 将登录代码更新到 MySQLi