title: How can I save user's setting for notifications laravel5 and mysql
body: <p>I am building Restful Api for a mobile application. I need to push the notification to user if he has saved the notification setting to true in his profile.</p>
  
  <p>I have created the following structure:</p>
  
  <p><strong>Users Table:</strong></p>
  
  <p><kbd>id</kbd> <kbd>name</kbd> <kbd>email</kbd></p>
  
  <p><kbd>1</kbd>  <kbd>Test</kbd> <kbd>test@test.com</kbd></p>
  
  <p><kbd>2</kbd>  <kbd>Test1</kbd> <kbd>test1@test1.com</kbd></p>
  
  <p><strong>Notifications Table:</strong></p>
  
  <p><kbd>id</kbd> <kbd>notification_name</kbd></p>
  
  <p><kbd>1</kbd>  <kbd>Like Notification</kbd></p>
  
  <p><kbd>2</kbd>  <kbd>Comment Notification</kbd></p>
  
  <p><strong>user_notification Table:</strong></p>
  
  <p><kbd>id</kbd> <kbd>notification_id</kbd> <kbd>user_id</kbd> <kbd>value (0=off, 1=on)</kbd></p>
  
  <p><kbd>1</kbd>  <kbd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd> <kbd>&nbsp;&nbsp;&nbsp;&nbsp; 1 &nbsp;&nbsp;&nbsp;&nbsp;</kbd> <kbd>&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;</kbd></p>
  
  <p><kbd>2</kbd>  <kbd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd> 
  <kbd>&nbsp;&nbsp;&nbsp;&nbsp; 1 &nbsp;&nbsp;&nbsp;&nbsp;</kbd> <kbd>&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;</kbd></p>
  
  <p><kbd>3</kbd>  <kbd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd> <kbd>&nbsp;&nbsp;&nbsp;&nbsp; 1 &nbsp;&nbsp;&nbsp;&nbsp;</kbd> <kbd>&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;</kbd></p>
  
  <p><kbd>4</kbd>  <kbd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</kbd> 
  <kbd>&nbsp;&nbsp;&nbsp;&nbsp; 1 &nbsp;&nbsp;&nbsp;&nbsp;</kbd> <kbd>&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;</kbd></p>
  
  <p>In the above table structure I have created a pivot table with an extra field <code>value</code> for saving settings of a user.</p>
  
  <p><strong>Is there any another great way to do this, in which I can minimize my queries and respond fast</strong></p>