/** Override BasicModel::create to ensure date settings are present */ public function create() { if ($this->name == '__needs_initialization') { return false; } else { return parent::create(); } }
/** Override BasicModel::create to add an initial partition when the table is first created */ public function create() { $exists = $this->connection->tableExists($this->name); $created = parent::create(); if ($created && !$exists) { $this->initPartitions(date('Y'), date('n')); } return $created; }