Skip to content

Commit

Permalink
Packages Locate and Flags (#688)
Browse files Browse the repository at this point in the history
Co-authored-by: adrolli <[email protected]>
  • Loading branch information
adrolli and adrolli authored Aug 16, 2024
1 parent 748c636 commit b0e4667
Show file tree
Hide file tree
Showing 51 changed files with 1,554 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/monorepo-split-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
- builder
- core
- expiry
- flags
- jobs
- locate
- login-link
- notifications
- passkey
Expand Down
29 changes: 29 additions & 0 deletions app/Providers/Filament/AdminPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use Moox\Builder\BuilderPlugin;
use Moox\Jobs\JobsBatchesPlugin;
use Moox\Jobs\JobsFailedPlugin;
use Moox\Jobs\JobsPlugin;
use Moox\Jobs\JobsWaitingPlugin;
use Moox\Locate\LocatePlugin;
use Moox\Page\PagePlugin;
use Moox\Security\Services\RequestPasswordReset;
use Moox\Sync\SyncPlugin;
use Moox\User\UserPlugin;

class AdminPanelProvider extends PanelProvider
{
Expand Down Expand Up @@ -58,6 +67,26 @@ public function panel(Panel $panel): Panel
])
->spa()
->plugins([
// GravatarPlugin::make(),
BuilderPlugin::make(),
JobsPlugin::make(),
JobsWaitingPlugin::make(),
JobsFailedPlugin::make(),
JobsBatchesPlugin::make(),

PagePlugin::make(),
SyncPlugin::make(),
UserPlugin::make(),
\Moox\Sync\PlatformPlugin::make(),
\Moox\Audit\AuditPlugin::make(),

//LocatePlugin::make(), macht keinen Sinn, war nur für Demo
\Moox\Locate\AreaPlugin::make(),
//\Moox\Locate\CountryPlugin::make(),
//\Moox\Locate\LanguagePlugin::make(),
//\Moox\Locate\TimezonePlugin::make(),

\Moox\UserDevice\UserDevicePlugin::make(),
// CMS plugin
\Moox\Page\PagePlugin::make(),

Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
"moox/user": "*",
"moox/user-device": "*",
"moox/user-session": "*",
"moox/passkey": "*",
"moox/notifications": "*",
"moox/flags": "*",
"moox/locate": "*",
"wikimedia/composer-merge-plugin": "^2.1"
},
"require-dev": {
Expand Down
8 changes: 8 additions & 0 deletions config/locate.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

return [
'navigation_sort' => 2001,

// API configuration

];
28 changes: 28 additions & 0 deletions database/migrations/2024_07_10_123207_create_areas_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
public function up(): void
{
Schema::create('areas', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('slug');
$table->enum('area_type', ['continent', 'sub-continent', 'union', 'other']);
$table->text('description');
$table->json('nutrition');
$table->boolean('tropical');
$table->softDeletes();
$table->timestamps();
});
}

public function down(): void
{
Schema::dropIfExists('areas');
}
};
13 changes: 13 additions & 0 deletions packages/flags/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* text=auto

/.github export-ignore
/bin export-ignore
/config/generation.php export-ignore
/dist export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
CHANGELOG.md export-ignore
phpunit.xml.dist export-ignore
README.md export-ignore
UPGRADE.md export-ignore
7 changes: 7 additions & 0 deletions packages/flags/.github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Coding Standards

on: [push]

jobs:
lint:
uses: laravel/.github/.github/workflows/coding-standards.yml@main
38 changes: 38 additions & 0 deletions packages/flags/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests

on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'

jobs:
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.2, 8.3]
laravel: [11]

name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip
coverage: none

- name: Install dependencies
run: |
composer require "illuminate/contracts=^${{ matrix.laravel }}" --prefer-dist --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit
6 changes: 6 additions & 0 deletions packages/flags/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
vendor/
.phpunit.result.cache
composer.lock
phpunit.xml
package-lock.json
9 changes: 9 additions & 0 deletions packages/flags/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

This changelog follows [the Keep a Changelog standard](https://keepachangelog.com).

## [Unreleased](https://github.com/mooxphp/flags/compare/1.0.0...main)

## 1.0.0 (20??-??-??)

Initial release.
21 changes: 21 additions & 0 deletions packages/flags/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Blade Developer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
98 changes: 98 additions & 0 deletions packages/flags/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Moox Flags

<a href="https://github.com/mooxphp/flags/actions?query=workflow%3ATests">
<img src="https://github.com/blade-ui-kit/flags/workflows/Tests/badge.svg" alt="Tests">
</a>
<a href="https://packagist.org/packages/moox/flags">
<img src="https://img.shields.io/packagist/v/moox/flags" alt="Latest Stable Version">
</a>
<a href="https://packagist.org/packages/moox/flags">
<img src="https://img.shields.io/packagist/dt/moox/flags" alt="Total Downloads">
</a>

> 5. `Blade Developer` with your name
>
> Then, make sure [the implementation](./src) is correct, that you set up [icon generation](https://github.com/blade-ui-kit/blade-icons#generating-icons) and that [your tests](./tests) pass. And remove this quote block from your readme. When you've published your package on Packagist, make sure to send it in to [the Blade Icons package list](https://github.com/blade-ui-kit/blade-icons#icon-packages).
A package to easily make use of beautiful stylable country and language flags in your Laravel Blade views.

For a full list of available icons see [the SVG directory](resources/svg).

## Requirements

- PHP 8.2 or higher
- Laravel 10.0 or higher

## Installation

```bash
composer require moox/flags
```

## Updating

Please refer to [`the upgrade guide`](UPGRADE.md) when updating the library.

## Blade Icons

Moox Flags uses Blade Icons under the hood. Please refer to [the Blade Icons readme](https://github.com/blade-ui-kit/blade-icons) for additional functionality. We also recommend to [enable icon caching](https://github.com/blade-ui-kit/blade-icons#caching) with this library.

## Configuration

Moox Flags also offers the ability to use features from Blade Icons like default classes, default attributes, etc. If you'd like to configure these, publish the `flags.php` config file:

```bash
php artisan vendor:publish --tag=flags-config
```

## Usage

Icons can be used as self-closing Blade components which will be compiled to SVG icons:

```blade
<x-heroicon-o-adjustments/>
```

You can also pass classes to your icon components:

```blade
<x-heroicon-o-adjustments class="w-6 h-6 text-gray-500"/>
```

And even use inline styles:

```blade
<x-heroicon-o-adjustments style="color: #555"/>
```

The solid icons can be referenced like this:

```blade
<x-heroicon-s-adjustments/>
```

### Raw SVG Icons

If you want to use the raw SVG icons as assets, you can publish them using:

```bash
php artisan vendor:publish --tag=flags --force
```

Then use them in your views like:

```blade
<img src="{{ asset('vendor/flags/o-adjustments.svg') }}" width="10" height="10"/>
```

## Changelog

Check out the [CHANGELOG](CHANGELOG.md) in this repository for all the recent changes.

## Maintainers

Moox Flags is developed and maintained by Blade Developer.

## License

Moox Flags is open-sourced software licensed under [the MIT license](LICENSE.md).
51 changes: 51 additions & 0 deletions packages/flags/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "moox/flags",
"description": "A package to easily make use of beautiful stylable country and language flags in your Laravel Blade views and Filament resources.",
"keywords": [
"Blade",
"Icons",
"Country Flags",
"Language Flags",
"Flags",
"SVG",
"Laravel"
],
"homepage": "https://github.com/mooxphp/flags",
"license": "MIT",
"authors": [
{
"name": "Moox Devs"
}
],
"require": {
"php": "~8.2.0|~8.3.0",
"blade-ui-kit/blade-icons": "^1.6",
"illuminate/support": "^11.0"
},
"require-dev": {
"orchestra/testbench": "^9.0",
"phpunit/phpunit": "^10.0"
},
"autoload": {
"psr-4": {
"Moox\\Flags\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests"
}
},
"extra": {
"laravel": {
"providers": [
"Moox\\Flags\\FlagsServiceProvider"
]
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Loading

0 comments on commit b0e4667

Please sign in to comment.