I am working on a laravel project and would like to retrieve data from a server (postgresql). I have the class webmaster_tool in my Model folder but every time i try to call it with Eloquent i get this error:
Symfony \\ Component \\ Debug \\ Exception \\ FatalErrorException (E_ERROR) Class 'webmasters_tool' not found
This is my Controller:
<?php
/*Controller*/
class WebmastersController extends BaseController {
public function index() {
$webmasters_tools = webmasters_tool::all();
return View::make('webmasters_tools.index', ['webmasters_tools' => $webmasters_tools]);
}
}
My Model:
<?php
//Modell
class webmasters_tool extends Eloquent {
}
My route:
Route::get('/webmasters_tools', 'WebmastersController@index');
I would really appreciate if someone helped me out here.
可能您缺少使用声明:
use App\webmasters_tool;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.