Knowledge Base

Empty filter

Laravel Template Slot

layouts/app.blade.php
**
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">

<title>{{ config('app.name', 'Laravel') }}</title>

<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />

<!-- Scripts -->
@vite(['resources/css/app.css', 'resources/js/app.js'])

<!-- Styles -->
@livewireStyles
</head>
<body>
<div class="font-sans text-gray-900 antialiased">
{{ $slot }}
</div>

@livewireScripts
</body>
</html>
**
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Knowledge Base') }}
</h2>
<div class="overflow-x-auto mt-6">
<!-- Search Form -->
<div class="bg-white dark:bg-gray-500 overflow-hidden shadow-sm sm:rounded-lg mb-4">
<div class="p-6 text-gray-900 dark:text-black">
<form method="GET" action="{{ route('knowledge_base.index') }}">
<table class="min-w-full w-full bg-white">
<tbody>
<tr>
<td>
<div class="form-group">
<!-- <label for="search" class="text-primary">Traži</label> -->
<input type="text" class="form-control w-full" name="search"
value="{{ old('search', session('search')) }}"
placeholder="{{ __('Search all Knowledge Base by title or content') }}">
</div>
</td>
<td>
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" name="exact_match"
id="exact_match" {{ session('exact_match') ? 'checked' : '' }}>
<label for="exact_match"
class="form-check-label">{{ __('Exact match') }}</label>
</div>
</td>
<td>
<!-- Search Button -->
<button type="submit"
class="text-white bg-red-600 hover:bg-red-700 font-medium py-2 px-4 rounded inline-block">{{ __('Search All') }}</button>
</td>
<td>
<!-- Reset Button to clear search filters -->
<button>
<a href="{{ route('knowledge_base.clear_filters') }}"
class="text-white bg-red-600 hover:bg-red-700 font-medium py-2 px-4 rounded inline-block"
style="background-color:rgb(5, 233, 202);">{{ __('Empty filter') }}
</a>
</button>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>

</div>
</x-slot>

<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-xl sm:rounded-lg p-6">

<div class="container mx-auto">
<h1 class="text-2xl font-bold mb-6">{{ __('Knowledge Base Entries') }}</h1>
<div class="flex justify-end ">
@can('create articles')
<a href="{{ route('knowledge_base.create') }}"
class="text-red bg-yellow-600 hover:bg-yellow-700 font-medium py-2 px-4 rounded inline-block"
style="background-color:rgb(225, 240, 10);">
{{ __('Create New Entry') }}
</a>
@endcan
</div>
@if ($entries->count())
<div class="w-full overflow-x-auto">
<div id="wrapper">
<table id="knowledgeBaseTable"
class="min-w-[700px] w-full">
<thead class="bg-gray-800 text-white">
<tr>
<th class="px-2 py-2 whitespace-nowrap">{{ __('ID') }}</th>
<th class="px-4 py-2 whitespace-nowrap">{{ __('Title') }}</th>
<th class="px-4 py-2 whitespace-nowrap">{{ __('Content') }}</th>
<th class="px-4 py-2 whitespace-nowrap">{{ __('Actions') }}</th>
</tr>
</thead>
<tbody>
@foreach ($entries as $entry)
<tr class="border-b">
<td class="border px-4 py-2 text-sm sm:text-base">{{ $entry->id }}</td>
<td class="border px-4 py-2 text-sm sm:text-base md:text-base">{{ ucfirst($entry->title) }}</td>
<td class="border px-4 py-2 text-xs sm:text-sm md:text-base">
{{ Str::limit($entry->content, 200) }}
</td>
<td class="border px-4 py-2 flex flex-wrap gap-2">
<a href="{{ route('knowledge_base.show', ['knowledge_base' => $entry->id, 'search' => $search]) }}"
class="text-white bg-blue-600 hover:bg-blue-700 font-medium py-1 px-2 rounded text-xs sm:text-sm equal-width-button"
style="background-color:rgb(10, 14, 240);">
{{ __('Show') }}
</a>

@can('edit articles')
<a href="{{ route('knowledge_base.edit', $entry) }}"
class="text-white bg-yellow-600 hover:bg-yellow-700 font-medium py-1 px-2 rounded text-xs sm:text-sm equal-width-button"
style="background-color:rgb(121, 240, 10);">
{{ __('Edit') }}
</a>
@endcan
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>

<!-- Pagination links -->
<div class="mt-4">
{{ $entries->links() }}
</div>
@else
<p class="mt-6 text-gray-700">{{ __('No entries found.') }}</p>
@endif
</div>

</div>
</div>
</div>
</x-app-layout>
**
**

Published
Back to Index