Skip to content

Commit

Permalink
Move flag icons to public/images/flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert221 committed Jun 12, 2020
1 parent 4c5f4f1 commit a426d8f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/Repositories/CountryFlagRepository.php
Expand Up @@ -4,13 +4,13 @@

namespace Arbify\Repositories;

use Storage;

class CountryFlagRepository implements \Arbify\Contracts\Repositories\CountryFlagRepository
{
public function getAllFlags(): array
{
return collect(Storage::disk('public')->allFiles('flags'))
$flags = glob(resource_path('images/flags') . '/*.svg');

return collect($flags)
->map(fn($flagPath) => basename($flagPath, '.svg'))
->toArray();
}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/languages/index.blade.php
Expand Up @@ -36,7 +36,7 @@
<tr>
<td class="p-0 text-center align-middle">
@if(!is_null($language->flag))
<img src="{{ asset("storage/flags/$language->flag.svg") }}" alt="" class="country-flag">
<img src="{{ asset("images/flags/$language->flag.svg") }}" alt="" class="country-flag">
@endif
</td>
<td class="align-middle">{{ $language->code }}</td>
Expand Down
3 changes: 2 additions & 1 deletion resources/views/partials/languages-options.blade.php
Expand Up @@ -3,7 +3,8 @@
@empty($language->flag))
data-content="<span class='country-flag-selectpicker-placeholder'></span> {{ $language->getDisplayName() }}"
@else
data-content="<img src='{{ asset("storage/flags/$language->flag.svg") }}' alt='' class='country-flag-selectpicker'> {{ $language->getDisplayName() }}"
data-content="<img src='{{ asset("images/flags/$language->flag.svg") }}' alt='' class='country-flag-selectpicker'>
{{ $language->getDisplayName() }}"
@endif
{{ $selected($language) ? 'selected' : '' }}>
{{ $language->getDisplayName() }}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/projects/index.blade.php
Expand Up @@ -60,7 +60,7 @@
@foreach($project->languages as $language)
@if(!is_null($language->flag))
<li>
<img src="{{ asset("storage/flags/$language->flag.svg") }}"
<img src="{{ asset("images/flags/$language->flag.svg") }}"
alt="{{ $language->getDisplayName() }}">
</li>
@endif
Expand Down
2 changes: 1 addition & 1 deletion resources/views/projects/languages/index.blade.php
Expand Up @@ -34,7 +34,7 @@
<tr>
<td class="py-0 align-middle">
@if(!is_null($language->flag))
<img src="{{ asset("storage/flags/$language->flag.svg") }}" alt="" class="country-flag">
<img src="{{ asset("images/flags/$language->flag.svg") }}" alt="" class="country-flag">
@endif
</td>
<td>
Expand Down
2 changes: 1 addition & 1 deletion webpack.mix.js
Expand Up @@ -13,4 +13,4 @@ const mix = require('laravel-mix');

mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.copyDirectory('resources/images/flags', 'storage/app/public/flags');
.copyDirectory('resources/images', 'public/images');

0 comments on commit a426d8f

Please sign in to comment.