本文整理汇总了PHP中app\Notification::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Notification::all方法的具体用法?PHP Notification::all怎么用?PHP Notification::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Notification
的用法示例。
在下文中一共展示了Notification::all方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
factory(App\QuestionCategory::class)->create(['name' => 'first category']);
factory(App\QuestionCategory::class)->create(['name' => 'second category']);
// Generate users
factory(App\User::class, 2)->create()->each(function ($user) {
// Generate trial period
\App\UserTrialPeriod::create(['user_id' => $user->id, 'trial_period_id' => \App\TrialPeriod::first()->id]);
// Settings
$user->settings()->save(factory(App\UserSetting::class)->make(['user_id' => $user->id, 'language_id' => 1]));
// Generate notifications
$notifications = \App\Notification::all();
foreach ($notifications as $notification) {
$user->notifications()->save(factory(\App\UserNotification::class)->make(['user_id' => $user->id, 'notification_id' => $notification->id]));
}
// Bills per user
$rows = 12;
// Products per bill
$productsPerBill = 5;
for ($i = 0; $i < $rows; $i++) {
// Generate client
$client = $user->clients()->save(factory(App\Client::class)->make());
// Generate bill for that client
$bill = $user->bills()->save(factory(App\Bill::class)->make(['client_id' => $client->id]));
// Generate products
for ($j = 0; $j < $productsPerBill; $j++) {
$product = $user->products()->save(factory(App\Product::class)->make());
$bill->products()->save(factory(App\BillProduct::class)->make(['product_id' => $product->id]));
$applicationProduct = factory(App\ApplicationProduct::class)->create();
$bill->applicationProducts()->save(factory(App\BillApplicationProduct::class)->make(['product_id' => $applicationProduct->id]));
}
}
});
}
示例2: show
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
$device = Device::findOrFail($id);
$notifications = Notification::all();
return View('devices.show', compact('device', 'notifications'));
}
示例3: index
public function index(Manager $fractal, NotificationTransformer $notificationTransformer)
{
// show all
$records = Notification::all();
$collection = new Collection($records, $notificationTransformer);
$data = $fractal->createData($collection)->toArray();
return $this->respond($data);
}
示例4: schedule
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
$tasks = Notification::all();
foreach ($tasks as $task) {
$schedule->call(function () use($task) {
Event::fire(new NotifyUsers($task->receiver, $task->message));
})->cron($task->cron);
}
}
示例5: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
if (Sentinel::hasAccess('notification.view')) {
$notifications = Notification::all();
return view('notifications.notifications.notifications', compact('notifications'));
} else {
return back()->withErrors(['NoAccess' => 'No tiene permisos para acceder a esta area.']);
}
}
示例6: index
public function index()
{
//get authenticated user
//return \Auth::user();
//return 'get all new info';
$notifications = Notification::all();
//return $notifications;
//Get the latest added and put at the top
//$notifications = Notification::latest('date')->notified()->get();
return view('notifies.index', compact('notifications'));
//return view('notifies.index');
}
示例7: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
//
$notifications = Notification::all();
return View('notifications.index', compact('notifications'));
}
示例8: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$notifications = Notification::all();
$actions = ActionSchema::getActionSchema($this->module);
return view('backend.notification.index')->with('content_title', 'Notifications')->with('notifications', $notifications)->with('actions', $actions)->with('module', $this->module);
}
示例9: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
return response()->json(Notification::all()->last());
}