本文整理汇总了PHP中Dashboard::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::all方法的具体用法?PHP Dashboard::all怎么用?PHP Dashboard::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dashboard
的用法示例。
在下文中一共展示了Dashboard::all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setChat
/**
* Display the specified resource.
*
* @return Response
*/
public function setChat()
{
if (Dashboard::all()->count() == 0) {
Dashboard::create(array("report" => Input::get("name")));
} else {
$dashboard = Dashboard::first();
$dashboard->report = Input::get("name");
$dashboard->save();
}
}
示例2: run
public function run()
{
/* Apply seeder only if no Dashboard exists (database reset) */
if (!Dashboard::all()->count()) {
Dashboard::create(array('id' => '1', 'user_id' => '1', 'name' => 'First personal dashboard', 'background' => TRUE));
ClockWidget::create(array('id' => '1', 'dashboard_id' => '1', 'descriptor_id' => '1', 'state' => 'active', 'position' => '{"row":1,"col":3,"size_x":8,"size_y":3}'));
GreetingsWidget::create(array('id' => '2', 'dashboard_id' => '1', 'descriptor_id' => '1', 'state' => 'active', 'position' => '{"row":4,"col":3,"size_x":8,"size_y":1}'));
/* Send message to console */
error_log('InitialSeeder | Successfully seeded');
} else {
/* Send message to console */
error_log('InitialSeeder | No modifications were made, because the DB is not empty');
}
}