/**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($userId)
 {
     $user = User::find($userId);
     $defaults = NotificationTemplate::whereUserId(0)->get();
     foreach ($defaults as $default) {
         $clone = $user->notificationTemplates()->whereDefaultId($default->id)->first();
         if (!$clone) {
             NotificationTemplate::create(['subject' => $default->subject, 'content' => $default->content, 'default_id' => $default->id, 'user_id' => $user->id]);
         }
     }
     $notifications = User::find($userId)->notificationTemplates()->paginate(10);
     return $this->view("partials.notification_templates.index", ['notifications' => $notifications, 'userId' => $userId]);
 }