草庐IT

Illuminate

全部标签

php - 在 view-file.blade.php 中找不到类 ' Form'

我正在尝试在我的View文件中呈现一个文本输入字段。我不断收到此错误:“在view-file.blade.php中找不到类‘表单’”模板:@extends('layouts.app')@section('content')New{{Form::open()}}{{ Form::text('my-name')}}{{Form::close()}}@endsectionComposer.json"require":{"php":">=7.0.0","fideloper/proxy":"~3.3","laravel/framework":"5.5.*","laravel/tinker":"~

php - Illuminate\Support\MessageBag::has() 缺少参数 1

当我访问我的Laravel项目时。它返回以下错误。如何解决。Missingargument1forIlluminate\Support\MessageBag::has(),calledin/var/www/laravel/vendor/laravel/framework/src/Illuminate/Support/ViewErrorBag.phponline92anddefined(View:/var/www/laravel/resources/views/welcome.blade.php)在我的Blade代码中:@if($errors->has())@foreach($error

php - Laravel 5.4 路由相同的前缀组但不同的中间件给出错误

我需要相同前缀ma​​nager下的所有路由,其中​​一个中间件用于访客ma​​nager_guest,另一个用于登录用户ma​​nager_auth。下面的代码是我的路由web.php文件。还有其他办法吗?我的路线:Route::prefix('manager')->group(['middleware'=>'manager_guest'],function(){Route::get('/register','Manager\RegisterController@showRegister')->name('manager.register.create');Route::post('

php - 未定义的属性:Illuminate\Database\Eloquent\Relations\BelongsTo::$name laravel 5.4

大家好,以下是我的亲戚用户模型publicfunctionloginlogout(){$this->HasMany("App\Models\LoginLogoutLogs");}这是我的LoginLogoutLogs模型publicfunctionusers(){return$this->belongsTo('App\Models\User');}我正在尝试从这样的用户访问名称$loginLogoutLogs=LoginLogoutLogs::all();foreach($loginLogoutLogsas$loginLogoutLog){dd($loginLogoutLog->use

在类 Illuminate\Support\Fluent 中找不到 Phpstorm 9 EAP 方法 "unique"

我正在做一个网站项目,我正在使用Laravel5和PHPStorm9EAP。我创建了一个迁移并使用此代码$table->string('name')->unique();并且IDE突出显示了unique()和显示一条消息Illuminate\Support\Fluent类中未找到“唯一”方法。这是我的迁移:classCreateProductsTableextendsMigration{/***Runthemigrations.**@returnvoid*/publicfunctionup(){Schema::create('products',function(Blueprint$t

php - Laravel 5 本地化 : exclude/public/directory

我正在尝试在我的Laravel5项目中实现本地化,但遇到了问题。我放入的捕捉语言的中间件如下:app=$app;$this->redirector=$redirector;$this->request=$request;}/***Handleanincomingrequest.**@param\Illuminate\Http\Request$request*@param\Closure$next*@returnmixed*/publicfunctionhandle($request,Closure$next){//Makesurecurrentlocaleexists.$locale=

php - 如何为独立的 Illuminate IoC 容器创建 Illuminate/Support/Facade/App facade

在我的独立(没有Laravel)项目中,我想使用IlluminateIoC容器。我还想通过illuminate/support组件提供的Appfacade访问应用程序容器。我安装了这两个组件(v5.0.28)。这是我的(简化的)代码:functionsetup_App(){$container=newIlluminate\Container\Container();Illuminate\Support\Facades\Facade::setFacadeApplication($container);class_alias('Illuminate\Support\Facades\App'

php - Laravel Excel 安装

我刚刚使用composer获取MaatwebsiteLaravel-Excel。我即将使用它,但我是安装/使用软件包的新手。到目前为止,我只使用了Laravel附带的东西。我正在阅读thedocumentation并且正在按照这些步骤进行操作(我已经完成了前三个步骤)但是我对这一行感到困惑;TheclassisbindedtotheioCasexcel$excel=App::make('excel');我真的不知道其中大部分是什么意思。我已经阅读了一些关于ioC的内容,然后是依赖注入(inject)(对我来说也是新手)。但我仍然不知道-文档的这一部分是否告诉我做某事?我在命令行上运行了

php - Laravel 5.2 单元测试错误:BadMethodCallException:调用未定义的方法 Illuminate\Database\Query\Builder::make()

我正在尝试使用Laravel5.2设置PHPunit。我按照文档进行了简单的单元测试,但是每个测试都会抛出相同的错误:1)CreateAccountTest::testCreateUserWithInvalidEmailBadMethodCallException:CalltoundefinedmethodIlluminate\Database\Query\Builder::make()/some/path/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2405/some/path/vendor/l

php - 如何在 octobercms 中创建中间件

我是OctoberCMS的新手,但我对Laravel有一定的了解。在Laravel中很容易创建中间件并将多个中间件分组。在OctoberCMS中,我还找不到合适的指南或满意的答案。有谁知道如何在OctoberCMS中创建中间件和组合多个中间件? 最佳答案 在您的插件文件夹中,使用文件Plugin.php来设置您的中间件您必须像这样在启动函数中声明:publicfunctionboot(){//Registermiddleware$this->app['Illuminate\Contracts\Http\Kernel']->pushM