public function checkOut(User $user, Library $library, $circ_desk = 'DEFAULT_CIRC_DESK')
    {
        $postData = [
            'library'   => ['value' => $library->code],
            'circ_desk' => ['value' => $circ_desk],
        ];

        $data = $this->client->postJSON(
            $this->url('/loans', ['user_id' => $user->id]),
            $postData
        );

        return Loan::make($this->client, $user, $data->loan_id)
            ->init($data);
    }
public function checkOut(User $user, Library $library, $circ_desk = 'DEFAULT_CIRC_DESK')
    {
        $postData = [
            'library'   => ['value' => $library->code],
            'circ_desk' => ['value' => $circ_desk],
        ];

        $data = $this->client->postJSON(
            $this->url('/loans', ['user_id' => $user->id]),
            $postData
        );

        return Loan::make($this->client, $user, $data->loan_id)
            ->init($data);
    }
public function checkOut ( User $ user , Library $ library , $ circ_desk = 'DEFAULT_CIRC_DESK' ) { $ postData = [ 'library' => [ 'value' => $ library -> code ] , 'circ_desk' => [ 'value' => $ circ_desk ] , ] ; $ data = $ this -> client -> postJSON ( $ this -> url ( '/loans' , [ 'user_id' => $ user -> id ] ) , $ postData ) ; return Loan :: make ( $ this -> client , $ user , $ data -> loan_id ) -> init ( $ data ) ; }
Create a new loan.

@param User    $user
@param Library $library
@param string  $circ_desk

@throws \Scriptotek\Alma\Exception\RequestFailed

@return Loan
Create a new loan .