I have a problem when I make a request on my Laravel server
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dbdespensa.imagenesProducto' doesn't exist (SQL: select * from
imagenesProductowhereproductoId= 5)
I have the imagenesProducto table but laravel didnt recognize it
Thanks and help :)
namespace App\Http\Controllers;
use App\ImagenesProducto;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Database\Eloquent\ModelNotFoundException;
class ImagenesProductoController extends Controller
{
function getImagesByProduct(Request $request,$id){
if($request-> isJson()){
try{
$images = ImagenesProducto::where('productoId','=',$id)->get();
return response()->json($images,200);
}catch(ModelNotFoundException $e){
return response()->json("error"=>"error",500);
}
}else{
return response()->json(['error'=>'Unhatorized'], 401, []);
}
}
}