Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 会话在Laravel软件包开发中过期_Php_Laravel_Laravel Livewire - Fatal编程技术网

Php 会话在Laravel软件包开发中过期

Php 会话在Laravel软件包开发中过期,php,laravel,laravel-livewire,Php,Laravel,Laravel Livewire,描述 我正在laravel包中使用livewire,该包将插入laravel项目。我成功地将Livewire集成到我的软件包中。我获取的错误是,当我单击绑定到组件方法的按钮时,由于不活动,此页面已过期。 我在我的基本文件中添加了csrf令牌,如 <meta name="csrf-token" content="{{ csrf_token() }}" /> 精简、复制可复制的代码段 依赖关系 "php": "

描述 我正在laravel包中使用livewire,该包将插入laravel项目。我成功地将Livewire集成到我的软件包中。我获取的错误是,当我单击绑定到组件方法的按钮时,由于不活动,此页面已过期。 我在我的基本文件中添加了csrf令牌,如

<meta name="csrf-token" content="{{ csrf_token() }}" />
精简、复制可复制的代码段 依赖关系

    "php": "^7.3|^8.0",
    "illuminate/support": "^8.15",
    "livewire/livewire": "^2.3",
    "fruitcake/laravel-cors": "^2.0"
浏览器:[Chrome,]

包路由文件

    <?php

use Enam\Acc\Http\Livewire\AccHeadComponent;
use Enam\Acc\Http\Livewire\VoucherComponent;
use Illuminate\Support\Facades\Route;

use Enam\Acc\Http\Controllers\HomeController;

Route::get('/acc', function () {
    return view('acc::app');
});
Route::get('/acc/test', VoucherComponent::class);

尝试将
web
中间件应用于路由


使用Enam\Acc\Http\Livewire\acchHeadComponent;
使用Enam\Acc\Http\Livewire\VoucherComponent;
使用照明\支持\立面\路线;
使用Enam\Acc\Http\Controllers\HomeController;
路由::中间件(['web'])
->组(函数(){
Route::get('/acc',function(){returnview('acc::app');});
路由::获取('/acc/凭证条目','Enam\acc\Http\Controllers\HomeController@index'); 
路由::get('/acc/test',VoucherComponent::class);
});

您的包路由是否应用了
web
中间件组?你能分享你的包的路由声明(文件)@Donkarnash不,我的路由中没有任何中间件。它是最新的,并且只有一条路由。@Donkarnash我已经用路由文件数据编辑了我的问题。单击按钮后,出现了名为“找不到livewire组件”的新问题。
    <?php

use Enam\Acc\Http\Livewire\AccHeadComponent;
use Enam\Acc\Http\Livewire\VoucherComponent;
use Illuminate\Support\Facades\Route;

use Enam\Acc\Http\Controllers\HomeController;

Route::get('/acc', function () {
    return view('acc::app');
});
Route::get('/acc/test', VoucherComponent::class);