Skip to content

Commit

Permalink
Merge pull request #11 from rgasch/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rgasch authored Dec 4, 2022
2 parents ba61618 + 2f1a743 commit 6f93414
Show file tree
Hide file tree
Showing 11 changed files with 529 additions and 529 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,24 @@ require tuning is the "nCpuCores" variable which is used to configure
CPU load and needs to know the number of CPU cores on you system in order
to make this calculation correct.

## ThemeColors

The filament-theme-color-switcher package allows you to easily switch
theme colors. The starter pack contains a *theme-colors* array in the
*config/filament-extended-starter-kit.php* config file which allows you
to set colors either there directly or by setting *FILAMENT_PRIMARY_COLOR*
and *FILAMENT_SECONDARY_COLOR* in your *.env* file.

## Performance

Some people have reported slow page loading speeds. In response to this I've
added a .htaccess file which defines caching directives which already helps
quite a bit. If after this optimization you are still unhappy with your loading
speeds, try removing the *"ralphjsmit/tall-interactive"* package from your
composer.json file and then run "composer update" (this of course assumes that
you are not using the functionality in this package).


## Alternative

If you want a tweakable install script to produce a Filament instance for you,
Expand Down
2 changes: 1 addition & 1 deletion app/Policies/EmailPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function restoreAny(User $user)
}

/**
* Determine whether the user can bulk restore.
* Determine whether the user can replicate.
*
* @param \App\Models\User $user
* @param \Ramnzys\FilamentEmailLog\Models\Email $email
Expand Down
2 changes: 1 addition & 1 deletion app/Policies/FeatureFlagPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function restoreAny(User $user)
}

/**
* Determine whether the user can bulk restore.
* Determine whether the user can replicate.
*
* @param \App\Models\User $user
* @param \RyanChandler\LaravelFeatureFlags\Models\FeatureFlag $featureFlag
Expand Down
2 changes: 1 addition & 1 deletion app/Policies/MenuPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function restoreAny(User $user)
}

/**
* Determine whether the user can bulk restore.
* Determine whether the user can replicate.
*
* @param \App\Models\User $user
* @param \io3x1\FilamentMenus\Models\Menu $menu
Expand Down
14 changes: 7 additions & 7 deletions app/Policies/RolePolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function deleteAny(User $user)
*/
public function forceDelete(User $user, Role $role)
{
return $user->can('force_delete_role');
return $user->can('{{ ForceDelete }}');
}

/**
Expand All @@ -99,7 +99,7 @@ public function forceDelete(User $user, Role $role)
*/
public function forceDeleteAny(User $user)
{
return $user->can('force_delete_any_role');
return $user->can('{{ ForceDeleteAny }}');
}

/**
Expand All @@ -111,7 +111,7 @@ public function forceDeleteAny(User $user)
*/
public function restore(User $user, Role $role)
{
return $user->can('restore_role');
return $user->can('{{ Restore }}');
}

/**
Expand All @@ -122,19 +122,19 @@ public function restore(User $user, Role $role)
*/
public function restoreAny(User $user)
{
return $user->can('restore_any_role');
return $user->can('{{ RestoreAny }}');
}

/**
* Determine whether the user can bulk restore.
* Determine whether the user can replicate.
*
* @param \App\Models\User $user
* @param \Spatie\Permission\Models\Role $role
* @return \Illuminate\Auth\Access\Response|bool
*/
public function replicate(User $user, Role $role)
{
return $user->can('replicate_role');
return $user->can('{{ Replicate }}');
}

/**
Expand All @@ -145,7 +145,7 @@ public function replicate(User $user, Role $role)
*/
public function reorder(User $user)
{
return $user->can('reorder_role');
return $user->can('{{ Reorder }}');
}

}
14 changes: 13 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace App\Providers;

use Filament\Facades\Filament;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\HtmlString;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
Expand All @@ -23,6 +26,15 @@ public function register()
*/
public function boot()
{
//
Filament::serving(function () {
$primaryColor = Config::get('filament.colors.primary', '#1bb6ff');
$secondaryColor = Config::get('filament.colors.secondary', '#ff49db');

Filament::pushMeta(
[
new HtmlString('<meta name="theme-primary-color" id="theme-primary-color" content="' . $primaryColor . '">' .
'<meta name="theme-secondary-color" id="theme-secondary-color" content="' . $secondaryColor . '">'),
]);
});
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"awcodes/filament-gravatar": "^1.0",
"bezhansalleh/filament-addons": "^1.0",
"bezhansalleh/filament-language-switch": "^1.0",
"bezhansalleh/filament-shield": "^2.2",
"bezhansalleh/filament-shield": "^2.3.2",
"filament/filament": "^2.16.31",
"filament/forms": "^2.16",
"filament/notifications": "^2.16",
Expand Down
Loading

0 comments on commit 6f93414

Please sign in to comment.