Skip to content

Commit

Permalink
Merge pull request #210 from SlovakNationalGallery/fix/KOMARCH-298
Browse files Browse the repository at this point in the history
Fix/komarch 298
  • Loading branch information
igor-kamil committed Feb 15, 2024
2 parents f871887 + fbaabff commit ee85065
Show file tree
Hide file tree
Showing 6 changed files with 325 additions and 210 deletions.
19 changes: 7 additions & 12 deletions app/Http/Controllers/Admin/DocumentCrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Controllers\Admin;

use App\Models\Tag;
use App\Http\Requests\DocumentRequest;
use Backpack\CRUD\app\Http\Controllers\CrudController;
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
Expand Down Expand Up @@ -120,41 +121,35 @@ protected function setupCreateOperation()
[
'name' => 'types',
'type' => 'select2_multiple_tags',
'entity' => 'types',
'entity' => false,
'attribute' => 'name',
'fake' => true,
'attributes' => [
'data-tags' => true
],
'options' => (function ($query) {
return $query->where('type', 'document-type')->get();
}),
'options' => Tag::where('type', 'document-type')->get(),
],
[
'name' => 'topics',
'type' => 'select2_multiple_tags',
'entity' => 'topics',
'entity' => false,
'attribute' => 'name',
'fake' => true,
'attributes' => [
'data-tags' => true
],
'options' => (function ($query) {
return $query->where('type', 'document-topic')->get();
}),
'options' => Tag::where('type', 'document-topic')->get(),
],
[
'name' => 'roles',
'type' => 'select2_multiple_tags',
'entity' => 'roles',
'entity' => false,
'attribute' => 'name',
'fake' => true,
'attributes' => [
'data-tags' => true
],
'options' => (function ($query) {
return $query->where('type', 'document-role')->get();
}),
'options' => Tag::where('type', 'document-role')->get(),
],
]);

Expand Down
4 changes: 4 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ public function register()
*/
public function boot()
{
if (config('app.locale') === 'sk') {
setlocale(LC_ALL, 'sk_SK.UTF-8');
}

Paginator::useBootstrap();

Blade::directive('date_localized', function ($expression) {
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"laravel/scout": "^9.0",
"laravel/telescope": "^4.3",
"laravel/tinker": "^2.8",
"league/flysystem-sftp": "^3.0",
"league/flysystem-sftp-v3": "^3.0",
"mcamara/laravel-localization": "^1.6",
"sentry/sentry-laravel": "^3.3",
"spatie/laravel-medialibrary": "^11.0",
Expand All @@ -33,12 +33,12 @@
"spatie/laravel-tags": "^4.5",
"spatie/laravel-translatable": "^6.5",
"spatie/pdf-to-image": "^2.1",
"staudenmeir/eloquent-has-many-deep": "^1.13"
"staudenmeir/eloquent-has-many-deep": "^1.13",
"fakerphp/faker": "^1.9.1"
},
"require-dev": {
"backpack/generators": "^4.0",
"deployer/deployer": "^7.3",
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
Expand Down
Loading

0 comments on commit ee85065

Please sign in to comment.