mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 23:06:08 -06:00
#2362 ad post now working [URGENT]
This commit is contained in:
parent
73ec88e6e8
commit
8b560865fa
@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Anomaly\Streams\Platform\Database\Migration\Migration;
|
||||||
|
|
||||||
|
class VisiosoftModuleProfileCreateBirthdayField extends Migration
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
if ($stream = $this->streams()->findBySlugAndNamespace('users', 'users')) {
|
||||||
|
$field = $this->fields()
|
||||||
|
->newQuery()
|
||||||
|
->where('slug', 'birthday')
|
||||||
|
->where('namespace', 'users')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
if (!$field) {
|
||||||
|
$field = $this->fields()->create([
|
||||||
|
'name' => trans('visiosoft.module.profile::field.birthday.name'),
|
||||||
|
'namespace' => 'users',
|
||||||
|
'slug' => 'birthday',
|
||||||
|
'type' => 'anomaly.field_type.datetime',
|
||||||
|
'locked' => 0,
|
||||||
|
'config' => [
|
||||||
|
"mode" => "date",
|
||||||
|
"picker" => true,
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assignments()->create([
|
||||||
|
'stream_id' => $stream->id,
|
||||||
|
'field_id' => $field->id
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* I never go back on my word!
|
||||||
|
* That's my nindo: my ninja way!
|
||||||
|
* NARUTO
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user