本文整理汇总了PHP中Organization::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Organization::create方法的具体用法?PHP Organization::create怎么用?PHP Organization::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Organization
的用法示例。
在下文中一共展示了Organization::create方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created organization in storage.
*
* @return Response
*/
public function store()
{
$validator = Validator::make($data = Input::all(), Organization::$rules);
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
Organization::create($data);
return Redirect::route('organizations.index');
}
示例2: up
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::transaction(function () {
Schema::table('users', function (Blueprint $table) {
$table->integer('organization_id')->nullable()->index();
});
$org = Organization::create(['name' => 'Toodoo']);
DB::table('users')->update(['organization_id' => $org->id]);
});
}
开发者ID:sonico999,项目名称:Multitenant-Apps-in-Laravel,代码行数:15,代码来源:2014_09_04_032424_CreateToodooOrganizationAndUsers.php
示例3: __create
static function __create($ht, &$error = false)
{
$ht['created'] = new SqlFunction('NOW');
$org = Organization::create($ht);
// Add dynamic data (if any)
if ($ht['fields']) {
$org->save(true);
$org->addDynamicData($ht['fields']);
}
return $org;
}
示例4: run
public function run()
{
DB::table('organizations')->truncate();
Organization::create(['name' => 'Toodoo', 'slug' => 'toodoo']);
Organization::create(['name' => 'Envato', 'slug' => 'envato']);
}
示例5: run
public function run()
{
Organization::create(['name' => 'Demo']);
Organization::create(['name' => 'MAV']);
}