SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘app.infos’ doesn’t exist.
home controller
<?php
namespace AppHttpControllers;
// use IlluminateHttpRequest;
use AppHttpControllersController;
use AppModelsinfo;
class homeController extends Controller
{
public function index(){
$data=info::all();
return view('home',['data'=>$data]);
}
}
web php
Route::get('home', [homeController::class ,'index']);
2
Answers
Make sure table name is "infos" not info
After that run following command
change your table ‘info’ to ‘infos’ or just add (protected $table = ‘info’) to your model