Laravel 5 |找不到接口"Illuminate \ Contracts \ Routing \ Middleware" [英] Laravel 5 | Interface 'Illuminate\Contracts\Routing\Middleware' not found

查看:165
本文介绍了Laravel 5 |找不到接口"Illuminate \ Contracts \ Routing \ Middleware"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Laravel 5.

I use Laravel 5.

我尝试

 "use Illuminate\Contracts\Routing\Middleware;"

将中间件"实现为

class Language implements Middleware {
       // Some Functions 
  }

我收到错误消息,

Interface 'Illuminate\Contracts\Routing\Middleware' not found

该接口实际上丢失了吗?

Is actually that interface is Missing ?

(OR)错误定义?

(OR)需要创建|下载吗?

(OR) Need to Create | Download ?

感谢Q!

推荐答案

Illuminate \ Contracts \ Routing \ Middleware合同已在5.2中弃用,请将其删除.并且不要在类定义中使用它.

The Illuminate\Contracts\Routing\Middleware contract has been deprecated in 5.2, remove it. And dont use it in class definition.

喜欢

<?php namespace App\Http\Middleware;

use Closure;
use Illuminate\Routing\Redirector;
use Illuminate\Http\Request;
use Illuminate\Foundation\Applicaion;

class Language{
    //..... YOUR CODE
}

这篇关于Laravel 5 |找不到接口"Illuminate \ Contracts \ Routing \ Middleware"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆