timegridio/timegrid

View on GitHub
resources/views/widgets/appointment/row/_buttons.blade.php

Summary

Maintainability
A
0 mins
Test Coverage
<span class="btn-group">

    @if($appointment->isCancelableBy(auth()->id()))
        {!! Button::danger()->withIcon(Icon::remove())->small()->withAttributes([
            'data-action' => 'cancel',
            'class' => 'action',
            'data-business' => $appointment->business->id,
            'data-appointment' => $appointment->id,
            'data-code' => $appointment->code
        ]) !!}
    @endif

    @if($appointment->isConfirmableBy(auth()->id()))
        {!! Button::success()->withIcon(Icon::ok())->small()->withAttributes([
            'data-action' => 'confirm',
            'class' => 'action',
            'data-business' => $appointment->business->id,
            'data-appointment' => $appointment->id,
            'data-code' => $appointment->code
        ]) !!}
    @endif

    @if($appointment->isServeableBy(auth()->id()))
        {!! Button::normal()->withIcon(Icon::ok())->small()->withAttributes([
            'data-action' => 'serve',
            'class' => 'action',
            'data-business' => $appointment->business->id,
            'data-appointment' => $appointment->id,
            'data-code' => $appointment->code
        ]) !!}
    @endif

</span>