public function getLastMovementByAttribute()
    {
        if ($this->movements->count() > 0) {
            $movement = $this->movements->first();

            if ($movement instanceof InventoryStockMovement
                && $movement->user instanceof User) {
                return $movement->user->getRecipientName();
            }
        }

        return;
    }
public function getLastMovementByAttribute()
    {
        if ($this->movements->count() > 0) {
            $movement = $this->movements->first();

            if ($movement instanceof InventoryStockMovement
                && $movement->user instanceof User) {
                return $movement->user->getRecipientName();
            }
        }

        return;
    }
public function getLastMovementByAttribute ( ) { if ( $ this -> movements -> count ( ) > 0 ) { $ movement = $ this -> movements -> first ( ) ; if ( $ movement instanceof InventoryStockMovement && $ movement -> user instanceof User ) { return $ movement -> user -> getRecipientName ( ) ; } } return ; }
Accessor for viewing the user responsible for the last
movement.

@return null|string
Accessor for viewing the user responsible for the last movement .