当前位置: 首页>>代码示例>>PHP>>正文


PHP Notification::all方法代码示例

本文整理汇总了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]));
             }
         }
     });
 }
开发者ID:bitller,项目名称:nova,代码行数:39,代码来源:UserTableSeeder.php

示例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'));
 }
开发者ID:Tanprasit,项目名称:property-management-system-web,代码行数:13,代码来源:DeviceController.php

示例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);
 }
开发者ID:wyrover,项目名称:lenda-api,代码行数:8,代码来源:NotificationsController.php

示例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);
     }
 }
开发者ID:dzikimarian,项目名称:hipchat-reminder,代码行数:15,代码来源:Kernel.php

示例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.']);
     }
 }
开发者ID:gitfreengers,项目名称:larus,代码行数:14,代码来源:NotificationsController.php

示例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');
 }
开发者ID:AngelWilson,项目名称:BermudaTransit,代码行数:12,代码来源:NotificationsController.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $notifications = Notification::all();
     return View('notifications.index', compact('notifications'));
 }
开发者ID:Tanprasit,项目名称:property-management-system-web,代码行数:11,代码来源:NotificationController.php

示例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);
 }
开发者ID:vampirethura,项目名称:modelvillage,代码行数:11,代码来源:NotificationController.php

示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     return response()->json(Notification::all()->last());
 }
开发者ID:BrynnLawson,项目名称:smarka,代码行数:10,代码来源:NotificationsController.php


注:本文中的app\Notification::all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。