草庐IT

php - Laravel NotFoundHttpException 虽然路由存在

我使用vue.js和Laravel5.1创建了一个小型文件共享应用程序。一切都很完美,但现在我想确保每个文件的所有者能够从他的文件中删除用户(当然,他首先必须与这些用户共享文件),因此我向一个PUT请求名为/files/share的URL。我的Laravel路由如下所示:Route::put('/files/share','FileController@test');当我运行phpartisanroute:list时,它也会被列出。客户端代码如下所示:this.$http.put('/files/share',{some_data},function(data){if(data.err

php - Mock 应该恰好被调用 1 次但被调用 0 次

我在使用Laravel5和PHPUnit时遇到了奇怪的问题。当我尝试模拟Laravel的外观(例如Auth、View、Mail)时,我总是得到这个异常:Mockery\Exception\InvalidCountException:Methodsend("emails.register",array('user'=>'object(MCC\Models\Users\User)',),object(Closure))fromMockery_0_Illuminate_Mail_Mailershouldbecalledexactly1timesbutcalled0times.我对"shoul

php - 找不到 Laravel 5.2 类,但类有命名空间

UPDATE01/26/1610:30pmEST:通过大量的Google搜索,我发现我误解了如何使用命名空间和自定义类。如果其他人遇到此问题,请阅读本教程:http://www.techigniter.in/tutorials/how-to-add-custom-class-in-laravel-5/它很短而且很容易理解。它帮助解决了这个问题并将我带到了下一个错误...:D问题:尝试全新安装Laravel5并将我的Laravel4代码转换为Laravel5。请求:请帮助我找到错误并提供有关如何更正错误的详细说明。错误:additionalPCs.php第4行中的FatalErrorEx

php - Blade 中的 Laravel 5.2 条件扩展模板

我想根据条件扩展模板。我知道我可以在Blade中使用@if@else语句。我在做同样的事情,但Blade扩展了两个模板。我不知道为什么。@if(isset(Auth::user()->id))@extends('layouts.adminlayout')@else@extends('layouts.default')@endif@section('content')iamthehomepage{{isset(Auth::user()->id)}}@stop因为,你可以看到我正在检查用户是否登录,然后扩展模板布局。但它是从这两个布局延伸出来的。请帮帮我。 最佳

php - 使用 Doctrine DBAL 使用 laravel 迁移更改列类型会出错

我使用Laravel5.2、Php7、Apache、Windows我的迁移文件是“2016_03_30_095234_alter_date_update_news_table.php”classAddSlugUpdateNewsTableextendsMigration{/***Runthemigrations.*phpartisanmake:migrationadd_slug_update_news_table*@returnvoid*/publicfunctionup(){Schema::table('news',function(Blueprint$table){$table->

php - fatal error : Unknown: Failed opening required Error in Laravel 5. 2 授权

我刚刚在我的应用程序中安装了laravel身份验证,并在URLhttp://localhost:8000/启动了我的服务器phpartisanserve我得到了以下错误。我正在使用Xampp和Windows10。Xampp安装在D根目录中。Warning:Unknown:failedtoopenstream:NosuchfileordirectoryinUnknownonline0Fatalerror:Unknown:Failedopeningrequired'D:\xampp\htdocs\ecom/server.php'(include_path='.;D:\xampp\php\p

php - laravel图像干预是压缩用户上传图像的好方法吗?

我正在检查这个laravel库来压缩用户上传的图像。http://image.intervention.io/我想知道这对用户上传的图片(个人资料图片)是否是个好主意?如果用户上传一张尺寸为1400x600的图片,它会被调整为200x200怎么办?它会是一个拉伸(stretch)的图像吗? 最佳答案 是的,它会被拉伸(stretch)。你想试试fit()方法:Combinecroppingandresizingtoformatimageinasmartway.Themethodwillfindthebestfittingaspect

php - laravel 按日期排序数组

你好,friend们,我有一个如下所示的数组:array:3[▼0=>array:6[▼"date"=>"2016-05-3115:08:33"0=>"31May16"1=>"aze"2=>"2"3=>"hi"4=>"487841464704194.jpg"]1=>array:6[▼"date"=>"2016-05-3115:26:09"0=>"31May16"1=>"aze"2=>"2"3=>"hey"4=>"487841464704194.jpg"]2=>array:6[▼"date"=>"2016-06-0111:33:06"0=>"01Jun16"1=>"aze"2=>"2"3

php - Laravel 拒绝用户 'root' @'localhost' 访问(使用密码 : YES) in laravel 4. 2

我有一个使用Laravel4.2构建的旧项目。我收到以下错误PDOException(1045)SQLSTATE[HY000][1045]Accessdeniedforuser'root'@'localhost'(usingpassword:YES)我用谷歌搜索并尝试了所有想法,但我无法修复它.env文件APP_KEY=az9tq5VHQCV9g5m2CsgY89jtijrCMgEADB_HOST=localhostDB_DATABASE=billingDB_USERNAME=rootDB_PASSWORD=1234数据库.php'mysql'=>array('driver'=>'my

php - 使用 Laravel 中的三个表的数据返回 json

//CartController$itens=CartItem::where('id_cart',$cart->id)->with('product')->get();returnresponse()->json($itens);此代码返回一个JSON,其中包含购物车项目和相关产品的数据。但我还想返回产品的图片,它在ProductImages表中。在我的模型中CartItem.php我有publicfunctionproduct(){return$this->belongsTo('App\Product','id_product');}在我的模型中Product.php我有public