當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。