feat: Implement addon functionality with schema updates, seeder, and administrator UI adjustments, including new favicons and a migration snapshot.
This commit is contained in:
@@ -1,58 +1,58 @@
|
||||
@php
|
||||
$tag = 'button';
|
||||
$href = null;
|
||||
$buttonType = $type;
|
||||
|
||||
if ($type === 'delete' || $confirm) {
|
||||
$tag = 'button';
|
||||
$buttonType = 'button';
|
||||
$attributes = $attributes->merge([
|
||||
'onclick' => "confirmDelete('$confirmUrl', '$confirmName')",
|
||||
]);
|
||||
} elseif ($route) {
|
||||
$href = route($route, $params);
|
||||
$tag = 'a';
|
||||
} elseif ($url) {
|
||||
$href = $url;
|
||||
$tag = 'a';
|
||||
} elseif ($attributes->has('href')) {
|
||||
$href = $attributes->get('href');
|
||||
$tag = 'a';
|
||||
}
|
||||
$href = null;
|
||||
$buttonType = $type;
|
||||
|
||||
$variants = [
|
||||
'primary' => 'btn-primary',
|
||||
'secondary' => 'btn-secondary',
|
||||
'outline' => 'btn-outline-primary',
|
||||
'outline-primary' => 'btn-outline-primary',
|
||||
'outline-secondary' => 'btn-outline-secondary',
|
||||
'outline-success' => 'btn-outline-success',
|
||||
'outline-danger' => 'btn-outline-danger',
|
||||
'outline-warning' => 'btn-outline-warning',
|
||||
'outline-info' => 'btn-outline-info',
|
||||
'ghost' => 'btn-light',
|
||||
'link' => 'btn-link',
|
||||
'danger' => 'btn-danger',
|
||||
'destructive' => 'btn-danger',
|
||||
'success' => 'btn-success',
|
||||
'warning' => 'btn-warning',
|
||||
'info' => 'btn-info',
|
||||
'light' => 'btn-light',
|
||||
'dark' => 'btn-dark',
|
||||
];
|
||||
if ($type === 'delete' || $confirm) {
|
||||
$tag = 'button';
|
||||
$buttonType = 'button';
|
||||
$attributes = $attributes->merge([
|
||||
'onclick' => "confirmDelete('$confirmUrl', '$confirmName')",
|
||||
]);
|
||||
} elseif ($route) {
|
||||
$href = route($route, $params);
|
||||
$tag = 'a';
|
||||
} elseif ($url) {
|
||||
$href = $url;
|
||||
$tag = 'a';
|
||||
} elseif ($attributes->has('href')) {
|
||||
$href = $attributes->get('href');
|
||||
$tag = 'a';
|
||||
}
|
||||
|
||||
$sizes = [
|
||||
'default' => '',
|
||||
'sm' => 'btn-sm',
|
||||
'lg' => 'btn-lg',
|
||||
'xs' => 'btn-xs',
|
||||
'icon' => 'btn-icon',
|
||||
];
|
||||
$variants = [
|
||||
'primary' => 'btn-primary',
|
||||
'secondary' => 'btn-secondary',
|
||||
'outline' => 'btn-outline-primary',
|
||||
'outline-primary' => 'btn-outline-primary',
|
||||
'outline-secondary' => 'btn-outline-secondary',
|
||||
'outline-success' => 'btn-outline-success',
|
||||
'outline-danger' => 'btn-outline-danger',
|
||||
'outline-warning' => 'btn-outline-warning',
|
||||
'outline-info' => 'btn-outline-info',
|
||||
'ghost' => 'btn-light',
|
||||
'link' => 'btn-link',
|
||||
'danger' => 'btn-danger',
|
||||
'destructive' => 'btn-danger',
|
||||
'success' => 'btn-success',
|
||||
'warning' => 'btn-warning',
|
||||
'info' => 'btn-info',
|
||||
'light' => 'btn-light',
|
||||
'dark' => 'btn-dark',
|
||||
];
|
||||
|
||||
$variantClass = $variants[$variant ?? 'primary'] ?? $variants['primary'];
|
||||
$sizeClass = $sizes[$size ?? 'default'] ?? '';
|
||||
$sizes = [
|
||||
'default' => '',
|
||||
'sm' => 'btn-sm',
|
||||
'lg' => 'btn-lg',
|
||||
'xs' => 'btn-xs',
|
||||
'icon' => 'btn-icon',
|
||||
];
|
||||
|
||||
$classes = "btn d-flex align-items-center {$variantClass} {$sizeClass}";
|
||||
$variantClass = $variants[$variant ?? 'primary'] ?? $variants['primary'];
|
||||
$sizeClass = $sizes[$size ?? 'default'] ?? '';
|
||||
|
||||
$classes = "btn d-flex align-items-center rounded-4 border {$variantClass} {$sizeClass}";
|
||||
@endphp
|
||||
@if($tag === 'a')
|
||||
<a href="{{ $href }}" {{ $attributes->merge(['class' => $classes]) }}>
|
||||
|
||||
Reference in New Issue
Block a user