title: How to add multiple table relationship in laravel
body: <p>I have following tables and building query with Laravel relationship. In my panel, once the user logged I am getting user details &amp; user business details but now I don't know how to get business types details too.</p>
  
  <h2>User Table:</h2>
  
  <pre><code>id | business_id | username | email          | password
  1    1             john632    john@gmail.com   *******
  </code></pre>
  
  <h2>Users Business Table</h2>
  
  <pre><code>id | user_id | business_type_id | business_name
  1    1         2                  Fortune
  </code></pre>
  
  <h2>Business Types Table</h2>
  
  <pre><code>id | business_type_name | description
  1    Hotel                Lorem Ipsum
  2    Movie                Lorem Ipsum
  </code></pre>
  
  <h2>Models:</h2>
  
  <p><strong>User</strong></p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  use Zizaco\Entrust\Traits\EntrustUserTrait;
  use App\Notifications\ResetPassword as ResetPasswordNotification;
  use Laravel\Passport\HasApiTokens;
  use Illuminate\Database\Eloquent\SoftDeletes;
  use Webpatser\Uuid\Uuid;
  use App\RoleUser;
  use App\UsersBusiness;
  
  class User extends Authenticatable
  {
      use Notifiable;
      use EntrustUserTrait;
      use HasApiTokens;
      use SoftDeletes, EntrustUserTrait {
          SoftDeletes::restore as sfRestore;
          EntrustUserTrait::restore as euRestore;
      }
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'business_id', 'username', 'email'
      ];
  
      public function usersBusiness()
      {
          return $this-&gt;belongsTo('App\UsersBusiness', 'business_id', 'id');
      }
  }
  </code></pre>
  
  <p><strong>UsersBusiness</strong></p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Database\Eloquent\SoftDeletes;
  
  class UsersBusiness extends Model
  {
      use SoftDeletes;
  
      /**
       * The table associated with the model.
       *
       * @var string
       */
      protected $table = 'tbl_users_business';
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'user_id', 'business_type_id', 'business_name'
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
  
      ];
  
      /**
       * Dates to be treated as Carbon instances
       *
       * @var array
       */
      public $dates = [
          'deleted_at'
      ];
  }
  </code></pre>
  
  <p><strong>BusinessTypes</strong></p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Database\Eloquent\SoftDeletes;
  
  class BusinessTypes extends Model
  {
      use SoftDeletes;
  
      /**
       * The table associated with the model.
       *
       * @var string
       */
      protected $table = 'tbl_master_business_types';
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'business_type_name', 'description'
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
  
      ];
  
      /**
       * Dates to be treated as Carbon instances
       *
       * @var array
       */
      public $dates = [
          'deleted_at'
      ];
  }
  </code></pre>
  
  <h2>Code:</h2>
  
  <pre><code>$user = Auth::user();
  $data['data'] = $user-&gt;load(['usersBusiness'] =&gt; function ($query) {
      $query-&gt;select(["id", "user_id", "business_name"])-&gt;get();
  }]);
  </code></pre>
  
  <p>I am getting below response data:</p>
  
  <pre><code>{
      "data": {
          "id": 1,
          "business_id": 1,
          "username": "john632",
          "email": "john632@gmail.com",
          "password": "john632",
          "users_business": {
              "id": 1,
              "user_id": 4,
              "business_type_id": 3,
              "business_name": "Honest"
          },
          "business_types": null
      },
      "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6Ijk4YTQ5OTBmOGQxOWQ5NTg1OGFlZWU1MDY0NTBiY2Y2OWJmOWQ3NzFhZjRmN2RmMzBmMWRkZWNmNWY4OTAzM2UyNmI2MzE3MTY3MDMxOTk4In0.eyJhdWQiOiIxIiwianRpIjoiOThhNDk5MGY4ZDE5ZDk1ODU4YWVlZTUwNjQ1MGJjZjY5YmY5ZDc3MWFmNGY3ZGYzMGYxZGRlY2Y1Zjg5MDMzZTI2YjYzMTcxNjcwMzE5OTgiLCJpYXQiOjE1MzIyNjA3ODUsIm5iZiI6MTUzMjI2MDc4NSwiZXhwIjoxNTYzNzk2Nzg1LCJzdWIiOiI1Iiwic2NvcGVzIjpbXX0.f_Xv0SrtTZ9m-40oHjAglCbKv76s_bARQ74XDihhFnI-jtHKwCWiF-jai5Yt6h9QyakCTZEo1bPAJdeph7Bj0_tKJpq3sGvK4t73_LZg_OOcsmAt61a4OSAgI1pjPV0tMMwHCoHm-xLlNnriAyaLCAbTQLQkfrw53467ys6rchE5V0rzy-JswjTfmB6SvZcqXsJQo6CWDRTWYbKvJO0FSmdZfLxxO_u4i_8ah5W63qJ4MSN9q22zkZLQ-L3NZhOux2KkwWiySioL2K25Y_UZmefClYwk1h-EY_LEVht3U7Kpqn9fmM6_Q4ByD-sSzLdAixdbq4REqinSaayzfMY934nijLu7ysEIc0oIukiHYcIk9tGV6DNuQ0CWhqEn0W_308MSBU4Ffyi5SQo7ubb5uPG7l_XOdomIR9dK9KtVONbPe7iF6TuccPCWZwvqKgfFl7TqEgiUWSiAl_ekkiaUDEM3cIuIH8AOLE17UuW4W0VyR2ziIt68au8SEuP2ilMBRsRMsFGbRKQWcvLluNw_qubcdzZ4yX9kuQAvXuBrHAcXb9WMlki2votvd7RKVDwxqwsTJRoeKNtJQdEQRbRZUD6nXyzGkmtEMrfwYoLVgTX3vAgVjO_erYtI5x-NV-EnoLT352odtRDYh5gTzVbmzYAxbLf_XUCDHjvlMEvM81g",
      "status": true,
      "status_code": 1,
      "message": "Login successfully."
  }
  </code></pre>
  
  <p>I want to add business types details too, so can you please guide me how to add relation for that table.</p>
  
  <p>Thanks.</p>