voyager: Error with BREAD > Browse if column created_at was not created
Version information
- Laravel: v5.7
- Voyager: v1.1
- PHP: 7.1.3
- Database: MySQL 5.6
Description
BREAD > Browse sorts by created_at by default. If this column was not created, an error occurs.
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'created_at' in 'order clause' (SQL: select * from exampleorder bycreated_at desc)
Steps To Reproduce
Steps to reproduce the behavior:
- Go to Tools > BREAD
- Click on Browse
- See the error if the column created_at was not created for the table.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (6 by maintainers)
This is correct, but then this field must always be created when a model is created for the table. Or a warning should appear when creating the tables.
btw: thank you for the prompt response
Well, the problem for me is that when you do the following:
public $timestamps = false;in any model without timestamps? This would prevent the nasty error.