Tuesday, April 11, 2017

DB query taking wrong table name on laravel

QueryException in Connection.php line 647:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydb.posts' 
doesn't exist (SQL: select count(*) as aggregate from `posts` where 
`title` = asdas)

Table name in database is post, but it going to to posts.

Post.php

class Post extends Model{}



via Cristal

Advertisement