shadrix
379
7
Nova

Nova Column not found - Do I need ID in my model?

Posted 8 months ago by shadrix

So my simple model is not using ID as a column. However, with Nova, it shows me the error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unsplash.id' in 'order clause' (SQL: select * fromunsplashorder byunsplash.iddesc limit 26 offset 0)"

My resource looks like this.

` public static $model = 'App\Unsplash';

public static $title = 'city';

public static $search = [
    'city'
];

public function fields(Request $request)
{
    return [
       Text::make('City'),
       Text::make('PhotoId'),
    ];
}`

What to do?

Please sign in or create an account to participate in this conversation.