Laravel Ray installed, active tags

This commit is contained in:
Benjamin Takats
2022-12-05 16:25:33 +01:00
parent bfe15e80a0
commit 5735158927
5 changed files with 20 additions and 11 deletions

View File

@@ -8,6 +8,11 @@ use Livewire\Component;
class SearchByTag extends Component
{
public string $country = 'de';
public ?array $table = [];
protected $queryString = [
'table',
];
public function render()
{

View File

@@ -45,7 +45,6 @@ class CourseTable extends DataTableComponent
->toArray()
)
->filter(function (Builder $builder, array $values) {
ray($values);
$builder->withAnyTags($values, 'search');
}),
];

10
composer.lock generated
View File

@@ -12263,16 +12263,16 @@
},
{
"name": "laravel-lang/lang",
"version": "12.5.6",
"version": "12.5.7",
"source": {
"type": "git",
"url": "https://github.com/Laravel-Lang/lang.git",
"reference": "f0503d6bb897070c906847858eab9b4d6e40a85c"
"reference": "166a07a7f6cda95fa3c9b3b1d1ff872d44e7e71d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Laravel-Lang/lang/zipball/f0503d6bb897070c906847858eab9b4d6e40a85c",
"reference": "f0503d6bb897070c906847858eab9b4d6e40a85c",
"url": "https://api.github.com/repos/Laravel-Lang/lang/zipball/166a07a7f6cda95fa3c9b3b1d1ff872d44e7e71d",
"reference": "166a07a7f6cda95fa3c9b3b1d1ff872d44e7e71d",
"shasum": ""
},
"require": {
@@ -12334,7 +12334,7 @@
"type": "open_collective"
}
],
"time": "2022-12-03T12:40:40+00:00"
"time": "2022-12-05T07:46:36+00:00"
},
{
"name": "laravel-lang/publisher",

View File

@@ -93,13 +93,13 @@ return [
* Absolute base path for your sites or projects in Homestead,
* Vagrant, Docker, or another remote development server.
*/
'remote_path' => env('RAY_REMOTE_PATH', null),
'remote_path' => env('RAY_REMOTE_PATH', '/var/www/html'),
/*
* Absolute base path for your sites or projects on your local
* computer where your IDE or code editor is running on.
*/
'local_path' => env('RAY_LOCAL_PATH', null),
'local_path' => env('RAY_LOCAL_PATH', '/home/fsociety/Code/side/einundzwanzig-bitcoin-school'),
/*
* When this setting is enabled, the package will not try to format values sent to Ray.

View File

@@ -7,9 +7,13 @@
class="flex flex-1 justify-center p-0 m-0 leading-6 text-center align-baseline border-0 border-solid"
style="font-size: 128%; background-position: 0px center; list-style: outside;"
>
@php
$isActive = collect($table)->pluck('tag')->collapse()->contains($tag->name);
$activeClass = $isActive ? 'text-amber-500 bg-amber-500' : 'bg-blue-50 text-white hover:text-amber-500';
@endphp
<a
class="flex relative flex-col flex-shrink-0 justify-between py-1 px-3 w-full h-20 text-white hover:text-amber-500 bg-blue-50 border-0 border-solid duration-300 ease-in-out cursor-pointer bg-opacity-[0.07]"
href="{{ route('search.course', ['country' => $country, 'table' => ['filters' => ['tag' => [$tag->name]]], '#table']) }}"
class="{{ $activeClass }} flex relative flex-col flex-shrink-0 justify-between py-1 px-3 w-full h-20 border-0 border-solid duration-300 ease-in-out cursor-pointer bg-opacity-[0.07]"
href="{{ $isActive ? '#table' : route('search.course', ['country' => $country, 'table' => ['filters' => ['tag' => [$tag->name]]], '#table']) }}"
>
<div
class="flex flex-1 items-center p-0 m-0 text-center align-baseline border-0 border-solid"
@@ -41,7 +45,8 @@
>
</span>
{{ $tag->courses_count > 0 ? $tag->courses_count : 'kein' }} Kurs{{ $tag->courses_count > 1 ? 'e' : '' }}
{{ $tag->courses_count > 0 ? $tag->courses_count : 'kein' }}
Kurs{{ $tag->courses_count > 1 ? 'e' : '' }}
</div>
</div>
</div>