Skip to content

Commit

Permalink
Add omg site features (#34)
Browse files Browse the repository at this point in the history
* Add omg site features

* Wip

* Wip
  • Loading branch information
a21ns1g4ts authored Nov 15, 2024
1 parent 60672ea commit affd881
Show file tree
Hide file tree
Showing 26 changed files with 398 additions and 142 deletions.
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
"amidesfahani/filament-tinyeditor": "^2.0",
"andrewdwallo/filament-companies": "^4.0",
"artesaos/seotools": "^1.3",
"awcodes/filament-quick-create": "^3.6",
"bezhansalleh/filament-exceptions": "2.1",
"bezhansalleh/filament-google-analytics": "2.1.0",
"bezhansalleh/filament-google-analytics": "^2.1",
"bezhansalleh/filament-panel-switch": "^1.0",
"bezhansalleh/filament-shield": "^3.3.3",
"bezhansalleh/filament-shield": "^3.3",
"blade-ui-kit/blade-heroicons": "^2.1",
"blade-ui-kit/blade-icons": "^1.6",
"blade-ui-kit/blade-ui-kit": "^0.6.2",
Expand All @@ -44,12 +45,14 @@
"icetalker/filament-picker": "^0.1.1",
"illuminate/contracts": "^11.0",
"illuminate/support": "^11.0",
"inertiajs/inertia-laravel": "*",
"jeffgreco13/filament-breezy": "^2.4",
"joaopaulolndev/filament-pdf-viewer": "^1.0",
"laravel/sanctum": "^4.0",
"league/flysystem-aws-s3-v3": "^3.0",
"livewire/livewire": "^3.5",
"malzariey/filament-daterangepicker-filter": "^2.2",
"marcogermani87/filament-cookie-consent": "^1.0",
"marjose123/filament-webhook-server": "^2.1",
"opcodesio/log-viewer": "^3.10",
"openai-php/laravel": "^0.10.1",
Expand All @@ -65,6 +68,7 @@
"symfony/intl": "^6.2",
"taylornetwork/laravel-username-generator": "^2.8",
"widiu7omo/filament-bandel": "^2.0",
"wiebenieuwenhuis/filament-code-editor": "^1.1",
"xlite-dev/filament-impersonate": "^2.0",
"ysfkaya/filament-phone-input": "^2.1",
"z3d0x/filament-logger": "^0.7"
Expand Down
2 changes: 2 additions & 0 deletions config/filament-saas.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

return [
'admin_path' => 'admin',
'blog_path' => 'blog',
'tenant_path' => 'company',
'site_path' => '/',

'users' => [
'model' => A2Insights\FilamentSaas\User\User::class,
Expand Down
34 changes: 25 additions & 9 deletions resources/lang/en/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
return [
'users' => [
'register' => [
'accept_terms' => 'I accept the <a href=":terms_url" class="underline">Terms of Use</a> and <a href=":policies_url" class="underline">Policies</a>',
'accept_terms' => 'I accept the <a href=":terms_url" class="underline">Terms of Service</a> and <a href=":privacy_policy_url" class="underline">Privacy Policy</a>',
'phone' => 'Phone',
],
'profile' => [
Expand All @@ -20,12 +20,24 @@
'notify' => 'Password updated successfully!',
],
],
'navigation' => [
'user' => 'User|Users',
'role' => 'Role|Roles',
'group' => 'Users',
],
],

'features' => [
'title' => 'Features',
'heading' => 'Features',
'subheading' => 'These are the main features of the application.',
'subheading' => 'Enable or disable features of the application.',
'auth' => [
'title' => 'Auth',
'registration' => [
'label' => 'Register',
'help_text' => 'Enable register page.',
],
],
'developer' => [
'title' => 'Developer',
'webhooks' => [
Expand Down Expand Up @@ -59,10 +71,6 @@
'label' => 'Username',
'help_text' => 'Enable username in the register page and profile.',
],
'user_phone' => [
'label' => 'User Phone',
'help_text' => 'Enable phone in the register page and profile.',
],
],
'terms_and_privacy_policy' => [
'title' => 'Terms and Privacy Policy',
Expand All @@ -79,7 +87,7 @@
'settings' => [
'title' => 'Settings',
'heading' => 'Settings',
'subheading' => 'These are the main settings of the application.',
'subheading' => 'Configure the behavior of the application.',
'seo' => [
'title' => 'SEO',
'name' => [
Expand Down Expand Up @@ -112,11 +120,11 @@
'title' => 'Security',
'restrict_ips' => [
'label' => 'Restrict IPs',
'help_text' => 'Caution: If you block your own IP address, you will be locked out of your site. And you will have to manually remove your IP address from the database or access from another IP address.',
'help_text' => 'Caution: If you block your own IP address, you will be locked out of your sistema. And you will have to manually remove your IP address from the database or access from another IP address.',
],
'restrict_users' => [
'label' => 'Restrict Users',
'help_text' => 'Caution: If you block your own user, you will be locked out of your site. And you will have to manually remove your user from the database or access from another user.',
'help_text' => 'Caution: If you block your own user, you will be locked out of your sistema. And you will have to manually remove your user from the database or access from another user.',
],
],
'localization' => [
Expand All @@ -135,4 +143,12 @@
],
],
],

'privacy-policy' => [
'title' => 'Privacy Policy',
],

'terms-of-service' => [
'title' => 'Terms of Service',
],
];
36 changes: 26 additions & 10 deletions resources/lang/pt_BR/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
return [
'users' => [
'register' => [
'accept_terms' => 'Eu aceito os <a href=":terms_url" class="underline">Termos de Uso</a> e as <a href=":policies_url" class="underline">Políticas</a>',
'accept_terms' => 'Eu aceito os <a href=":terms_url" class="underline">Termos de Uso</a> e as <a href=":privacy_policy_url" class="underline">Políticas</a>',
'phone' => 'Telefone',
],
'profile' => [
Expand All @@ -20,12 +20,24 @@
'notify' => 'Senha atualizada com sucesso!',
],
],
'navigation' => [
'user' => 'Usuário|Usuários',
'role' => 'Função|Funções',
'group' => 'Usuários',
],
],

'features' => [
'title' => 'Funcionalidades',
'heading' => 'Funcionalidades',
'subheading' => 'Essas são as principais funcionalidades do sistema.',
'subheading' => 'Habilite ou desabilite funcionalidades do sistema.',
'auth' => [
'title' => 'Autenticação',
'registration' => [
'label' => 'Registro',
'help_text' => 'Habilitar pagina de registro.',
],
],
'developer' => [
'title' => 'Desenvolvedor',
'webhooks' => [
Expand Down Expand Up @@ -56,13 +68,9 @@
'help_text' => 'Habilitar telefone na página de registro e perfil.',
],
'username' => [
'label' => 'Nome de Usuário',
'label' => 'Username',
'help_text' => 'Habilitar nome de usuário na página de registro e perfil.',
],
'user_phone' => [
'label' => 'Telefone do Usuário',
'help_text' => 'Habilitar telefone na página de registro e perfil.',
],
],
'terms_and_privacy_policy' => [
'title' => 'Termos e Política de Privacidade',
Expand All @@ -79,7 +87,7 @@
'settings' => [
'title' => 'Configurações',
'heading' => 'Configurações',
'subheading' => 'Essas são as principais configurações do site.',
'subheading' => 'Configure o comportamento do sistema.',
'seo' => [
'title' => 'SEO',
'name' => [
Expand Down Expand Up @@ -112,11 +120,11 @@
'title' => 'Segurança',
'restrict_ips' => [
'label' => 'Restringir IPs',
'help_text' => 'Cuidado: Se você bloquear seu próprio IP, será bloqueado do site e terá que remover o IP do banco de dados manualmente ou acessar de outro IP.',
'help_text' => 'Cuidado: Se você bloquear seu próprio IP, será bloqueado do sistema e terá que remover o IP do banco de dados manualmente ou acessar de outro IP.',
],
'restrict_users' => [
'label' => 'Restringir Usuários',
'help_text' => 'Cuidado: Se você bloquear seu próprio usuário, será bloqueado do site e terá que remover o usuário do banco de dados manualmente ou acessar com outro usuário.',
'help_text' => 'Cuidado: Se você bloquear seu próprio usuário, será bloqueado do sistema e terá que remover o usuário do banco de dados manualmente ou acessar com outro usuário.',
],
],
'localization' => [
Expand All @@ -135,4 +143,12 @@
],
],
],

'privacy-policy' => [
'title' => 'Política de Privacidade',
],

'terms-of-service' => [
'title' => 'Termos de Serviço',
],
];
10 changes: 0 additions & 10 deletions resources/views/features/policy.blade.php

This file was deleted.

10 changes: 0 additions & 10 deletions resources/views/features/terms.blade.php

This file was deleted.

9 changes: 5 additions & 4 deletions src/Commands/FilamentSaasCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,16 @@ public function handle()
$this->call('migrate:fresh', ['--force' => true]);

$this->info('Installing Shield');
$this->call('shield:setup', ['--fresh' => true,]);

$this->call('shield:setup');

$this->call('shield:install', ['panel' => 'admin']);
$this->call('shield:install', ['panel' => 'sysadmin']);

$this->call('shield:generate', [ '--all' => true, '--panel' => 'admin' ]);
$this->call('shield:generate', [ '--all' => true, '--panel' => 'sysadmin' ]);
$this->call('shield:generate', ['--all' => true, '--panel' => 'admin']);
$this->call('shield:generate', ['--all' => true, '--panel' => 'sysadmin']);

$this->call('vendor:publish', [ '--tag' => 'themes-assets']);
$this->call('vendor:publish', ['--tag' => 'themes-assets']);

$this->info('Creating super admin account');
$superAdmin = $this->setUpSuperAdminAccount();
Expand Down
3 changes: 0 additions & 3 deletions src/Features/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ class Features extends BaseSettings
// TODO: auth_2fa
public bool $auth_2fa;

// TODO: auth_registration
public bool $auth_registration;

public bool $webhooks;

//TODO: reCAPTCHA
public bool $recaptcha;

public bool $terms;

public bool $user_phone;

public bool $username;
Expand Down
11 changes: 0 additions & 11 deletions src/Features/FeaturesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@
namespace A2Insights\FilamentSaas\Features;

use A2Insights\FilamentSaas\Features\Filament\Components\SwitchLanguage;
use A2Insights\FilamentSaas\Features\Filament\Pages\Policy;
use A2Insights\FilamentSaas\Features\Filament\Pages\Terms;
use A2Insights\FilamentSaas\Settings\reCAPTCHASettings;
use A2Insights\FilamentSaas\Settings\WebhooksSettings;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Route;
use Livewire\Livewire;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
Expand All @@ -22,14 +19,6 @@ class FeaturesServiceProvider extends PackageServiceProvider
public function configurePackage(Package $package): void
{
$package->name('filament-saas.features');

Route::get('/terms-of-service', Terms::class)
->middleware('web')
->name('terms');

Route::get('/privacy-policy', Policy::class)
->middleware('web')
->name('policy');
}

public function packageBooted(): void
Expand Down
Loading

0 comments on commit affd881

Please sign in to comment.