for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Larafolio\Http\Controllers;
use Larafolio\Models\Image;
use Illuminate\Http\Request;
class ImageController extends Controller
{
/**
* Update image name and caption.
*
* @param \Illuminate\Http\Request $request Request object.
* @param Image $image Image to be updated.
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Image $image)
$imageData = $request->only(['name', 'caption', 'alt']);
$this->user->updateImageInfo($image, $imageData);
if ($request->ajax()) {
return response()->json(true);
true
boolean
string|array
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
}
return back();
* Remove image from portfolio.
* @param Image $image Image to be removed.
public function destroy(Request $request, Image $image)
$this->user->removeImage($image);
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: