title: Getting all related tables of a specific table in Laravel Eloquent
body: <p>I have an application implemented in laravel in which I want to add record rules security feature.</p>
  
  <p>The story is that admin selects a resource(object type) in the system as well as some user roles(groups) and then specifies rules for actions on that resource(object type). Therefore if a user has for example update permission on some resource he is limited to update the records that match the rule.</p>
  
  <p>I can let the admin write a domain in raw sql format inside a textarea for each rule. But for more user-friendliness Its better to show the column names of the resource tables and regarding the foreign-keys in the database list the <strong>tables that have relations with this resource table</strong> because admin may specify rules like this for example:</p>
  
  <pre><code>[resource.parent.user_id = user.id]
  </code></pre>
  
  <p>I can get the table columns simply by: </p>
  
  <pre><code>Schema::getColumnListing('users')
  </code></pre>
  
  <p>In addition to the above, what I wish is something like these:</p>
  
  <pre><code>Schema::getChildTables('users');
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>Schema::getParentTables('users')
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>Schema::getTablesWithManyToManyRelation('users')
  </code></pre>
  
  <p>and the output:</p>
  
  <pre><code>[
  'courses',
  'posts',
  ...
  ]
  </code></pre>
  
  <p>My question is that do we have such thing in Laravel Eloquent or we should get the show on the road? ;) </p>
  
  <p>Thank you in advance. :)</p>