Skip to content

Instantly share code, notes, and snippets.

@Sarav-S
Created September 23, 2016 01:12
Show Gist options
  • Save Sarav-S/455f2ea58ba6d3f27b1fa72a36b27552 to your computer and use it in GitHub Desktop.
Save Sarav-S/455f2ea58ba6d3f27b1fa72a36b27552 to your computer and use it in GitHub Desktop.
<?php
if (! function_exists('admin') )
{
/**
* Returns the admin session instance
*
* @return mixed
*/
function admin()
{
return auth()->guard('admin')->user();
}
}
if (! function_exists('isAdminLoggedIn') )
{
/**
* Determines if admin is logged in.
*
* @return boolean True if admin logged in, False otherwise.
*/
function isAdminLoggedIn()
{
return auth()->guard('admin')->check();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment