Skip to content

Instantly share code, notes, and snippets.

@mattlanham
Created February 2, 2012 19:13
Show Gist options
  • Save mattlanham/1725189 to your computer and use it in GitHub Desktop.
Save mattlanham/1725189 to your computer and use it in GitHub Desktop.
// No point applying an account id, unless we can tell the URL (this wont work for everything)
if(array_key_exists('SERVER_NAME', $_SERVER))
{
// Get the table name
$table_name = call_user_func($this->model.'::table');
// Load config
$locked_tables = \Config::get('settings.protected_models');
// Check if it's a protected modal
if(in_array($table_name, $locked_tables)) $this->where('account_id', \Session::get('account_id', \Inquirely::get_account()->id));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment