Wednesday, March 8, 2017

can't call a static method from Model(PHP)

$page = new \App\Page::where('page', $pageName)->first();

it gives me an error:

syntax error, unexpected 'where' (T_STRING), expecting variable (T_VARIABLE) or '$'

can someone tell me what is wrong with the first line of code?



via Skrudox

Advertisement