Table Command
handle() - Execute Table Synchronization
handle() - Execute Table Synchronizationpublic function handle($tableName) {
$modelClass = "\\App\\Models\\".ucfirst($tableName).'Model';
// Initialize the model
$model = new $modelClass();
$table = $model->_table();
$schema = $model->_schema();
// Check the table and synchronize its structure
$this->syncTableSchema($table, $schema);
echo "{$table} Table has been synchronized.\n";
}syncTableSchema() - Synchronize Table Schema
syncTableSchema() - Synchronize Table SchematableExists() - Check If Table Exists
tableExists() - Check If Table ExistscreateTable() - Create a New Table
createTable() - Create a New TableupdateTable() - Update Table Schema
updateTable() - Update Table SchemagetCurrentColumns() - Get Current Table Columns
getCurrentColumns() - Get Current Table ColumnsExample:
Last updated
Was this helpful?