Skip to content

Commit

Permalink
isset
Browse files Browse the repository at this point in the history
  • Loading branch information
salahhusa9 committed Aug 31, 2023
1 parent e7077fb commit 7389b07
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ he accept all normal attributes of form tag and add some new attributes:
</x-slot>
</x-template-components-card>
```
he accept all normal attributes of div tag and add some new attributes:
- div-class: add class to div tag (contener div)
- other attributes will be added to form tag

## Supported Templates

Expand Down
12 changes: 8 additions & 4 deletions resources/views/components/card.blade.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
@props(['header', 'footer'])

<div {{ $header->attributes->class([config('template-components.defult_classes.card.div')]) }}>
<div class="{{ $attributes->get('div-class') }} {{ config('template-components.defult_classes.card.div') }}">
@isset($header)
<h5 {{ $header->attributes->class([config('template-components.defult_classes.card.header')]) }}>
{{ $header }}
</h5>
@endisset
<div {{ $attributes->class([config('template-components.defult_classes.card.body')]) }}>
{{ $slot }}
</div>
<div {{ $footer->attributes->class([config('template-components.defult_classes.card.footer')]) }}>
{{ $footer }}
</div>
@isset($footer)
<div {{ $footer->attributes->class([config('template-components.defult_classes.card.footer')]) }}>
{{ $footer }}
</div>
@endisset
</div>

0 comments on commit 7389b07

Please sign in to comment.