@caje731 http://laravel.com/docs/5.0/schema#adding-columns
$table->enum('operation_type', ['create', 'update', 'delete']);
However I would rather do it at the code level, not necessarily in the db.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I'm trying to create a table using a migration, and I would like to restrict values of a column 'operation_type' to either of 'update', 'create', 'delete' . Can this be done while defining the migration? More importantly, is this the right way of restricting values ?
@caje731 http://laravel.com/docs/5.0/schema#adding-columns
$table->enum('operation_type', ['create', 'update', 'delete']);
However I would rather do it at the code level, not necessarily in the db.
Please or to participate in this conversation.