Skip to content

Instantly share code, notes, and snippets.

@kamz8
kamz8 / RoleMenuFilter.php
Created October 30, 2019 16:00
Filter menu for jeroennoten/Laravel-AdminLTE based on Spatie/LaravelPermission
<?php
namespace App\Utilities;
use JeroenNoten\LaravelAdminLte\Menu\Builder;
use JeroenNoten\LaravelAdminLte\Menu\Filters\FilterInterface;
use Spatie\Permission\Models\Role;
use Spatie\Permission\Models\Permission;
class RoleMenuFilter implements FilterInterface
@kamz8
kamz8 / gist:51925c39f439adc08ec7ec78f2806ae8
Created March 5, 2019 14:57 — forked from massiws/gist:9593008
PHP Count the number of working days between two dates.
<?php
/**
* Count the number of working days between two dates.
*
* This function calculate the number of working days between two given dates,
* taking account of the Public festivities, Easter and Easter Morning days,
* the day of the Patron Saint (if any) and the working Saturday.
*
* @param string $date1 Start date ('YYYY-MM-DD' format)