classes/Models/Admin.php
public function onCreating()
    {
        // Send out email
        if (Request::has('_send_email')) {
            $this->sendCreateEmail();
        }

        // Make them active
        $this->active = 1;

        // If the current user can't grant permissions, make the new admin
        // have the same role as themselves.  Admins created from the CLI (like as
        // part of a migration) won't be logged in.
        if (($admin = app('decoy.user'))
            && !app('decoy.user')->can('grant', 'admins')) {
            $this->role = $admin->role;

        // Otherwise, give the admin a default role if none was defined
        } elseif (empty($this->role)) {
            $this->role = 'admin';
        }
    }
public function onCreating()
    {
        // Send out email
        if (Request::has('_send_email')) {
            $this->sendCreateEmail();
        }

        // Make them active
        $this->active = 1;

        // If the current user can't grant permissions, make the new admin
        // have the same role as themselves.  Admins created from the CLI (like as
        // part of a migration) won't be logged in.
        if (($admin = app('decoy.user'))
            && !app('decoy.user')->can('grant', 'admins')) {
            $this->role = $admin->role;

        // Otherwise, give the admin a default role if none was defined
        } elseif (empty($this->role)) {
            $this->role = 'admin';
        }
    }
public function onCreating ( ) { // Send out email if ( Request :: has ( '_send_email' ) ) { $ this -> sendCreateEmail ( ) ; } // Make them active $ this -> active = 1 ; // If the current user can't grant permissions, make the new admin // have the same role as themselves.  Admins created from the CLI (like as // part of a migration) won't be logged in. if ( ( $ admin = app ( 'decoy.user' ) ) && ! app ( 'decoy.user' ) -> can ( 'grant' , 'admins' ) ) { $ this -> role = $ admin -> role ; // Otherwise, give the admin a default role if none was defined } elseif ( empty ( $ this -> role ) ) { $ this -> role = 'admin' ; } }
New admin callbacks

@return void
New admin callbacks