Answer the question
In order to leave comments, you need to log in
How to fix 'A non well formed numeric value encountered' error?
I 'm using version 5.2
When I try to display any of the variables ( $pages, $portfolios, $services, $peoples , $menu ) via helper 'dd' I get "ErrorException in VarCloner.php line 298:
A non well formed numeric value encountered" I
assume that it has something to do with time. The fields 'created_at' and 'updated_at' are created with type 'timestamp', default is Null and populated with inserted dates.
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use App\Page;
use App\Service;
use App\Portfolio;
use App\People;
class IndexController extends Controller
{
public function execute(Request $request) {
$pages = Page::all();
$portfolios = Portfolio::get(array('name','filter','images'));
$services = Service::where('id','<',20)->get();
$peoples = People::take(3)->get();
$menu = array();
foreach($pages as $page) {
$item = array('title' =>$page->name,'alias'=>$page->alias);
array_push($menu,$item);
}
dd($menu);
return view('site.index');
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question