If I create table without timestamps and than try to browse it get an error
QueryException in Connection.php line 647: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'created_at' in 'order clause' (SQL: select * from bookings order by created_at desc)
It could useful to add an option to BREAD creation, which adds public $timestamps = false; to the model.
@timbertlt then why don't you just add created_at to your table, so it's not causing error.
@endrureza because I don't need such type of fields in this table. It's not a problem to add $timestamps = false to the table, but anyway it's make sense to have this option or add timestamps by default.
I'm also seeing this issue. The table I've created is solely for storing dropdown list data used elsewhere in the admin dashboard so I have no need for created & updated data.
Labels: enhancement, possible bug
Closing since 1.0 is released. If this is still an issue in 1.0, please provide steps to reproduce the error in 1.0 and we'll reopen it.
This is still an issue in 1.0.5. I clicked "Add BREAD to this table" for a table without timestamps, left all of the fields the way they were, clicked "Submit", gave the "admin" role all permissions for the table, and then clicked the "Browse BREAD" button. This is what I got:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'created_at' in 'order clause' (SQL: select * from `mytable` order by `created_at` desc)
This may not be an issue after all. I'm still new to Laravel and am working with a legacy database. When I added public $timestamps = false; to the model, the problem went away.
Edited: @ataylor32 solution's could have been the solution to the original problem.
It was never reopened
Sorry I didn't saw, I would say that his solution simply work.
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.
Most helpful comment
This may not be an issue after all. I'm still new to Laravel and am working with a legacy database. When I added
public $timestamps = false;to the model, the problem went away.