studiocreativateam / base
This package's canonical repository appears to be gone and the package has been frozen as a result.
0.5.0
2024-03-15 17:14 UTC
Requires
- php: ^8.1
- barryvdh/laravel-debugbar: ^3.8
- barryvdh/laravel-ide-helper: ^2.12
- bensampo/laravel-enum: ^6.0
- darkaonline/l5-swagger: ^8.3
- diglactic/laravel-breadcrumbs: ^8.0
- kyslik/column-sortable: ^6.4
- laravel/framework: ^9.0|^10.0
- laravel/octane: ^2.0
- laravel/tinker: ^2.7
- laravelcollective/html: ^6.3
- oat-sa/composer-npm-bridge: ^0.4
- predis/predis: ^2.0
- reedware/laravel-relation-joins: ^4.0
- spatie/laravel-data: ^4.0|^5.0
- spatie/laravel-html: ^3.2
Requires (Dev)
- orchestra/testbench: ^7.0|^8.0
- dev-master
- 0.5.0
- 0.4.99
- 0.4.98
- 0.4.97
- 0.4.96
- 0.4.95
- 0.4.94
- 0.4.93
- 0.4.92
- 0.4.91
- 0.4.90
- 0.4.89
- 0.4.88
- 0.4.87
- 0.4.86
- 0.4.85
- 0.4.84
- 0.4.83
- 0.4.82
- 0.4.81
- 0.4.80
- 0.4.79
- 0.4.78
- 0.4.77
- 0.4.76
- 0.4.75
- 0.4.74
- 0.4.73
- 0.4.72
- 0.4.71
- 0.4.70
- 0.4.69
- 0.4.68
- 0.4.67
- 0.4.66
- 0.4.65
- 0.4.64
- 0.4.63
- 0.4.62
- 0.4.61
- 0.4.60
- 0.4.59
- 0.4.58
- 0.4.57
- 0.4.56
- 0.4.55
- 0.4.54
- 0.4.53
- 0.4.52
- 0.4.51
- 0.4.50
- 0.4.49
- 0.4.48
- 0.4.47
- 0.4.46
- 0.4.45
- 0.4.44
- 0.4.43
- 0.4.42
- 0.4.41
- 0.4.40
- 0.4.39
- 0.4.38
- 0.4.37
- 0.4.36
- 0.4.35
- 0.4.34
- 0.4.33
- 0.4.32
- 0.4.31
- 0.4.30
- 0.4.29
- 0.4.28
- 0.4.27
- 0.4.26
- 0.4.24
- 0.4.23
- 0.4.22
- 0.4.21
- 0.4.20
- 0.4.19
- 0.4.18
- 0.4.17
- 0.4.16
- 0.4.15
- 0.4.14
- 0.4.13
- 0.4.12
- 0.4.11
- 0.4.10
- 0.4.9
- 0.4.7
- 0.4.6
- 0.4.5
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.99
- 0.3.98
- 0.3.97
- 0.3.96
- 0.3.95
- 0.3.94
- 0.3.93
- 0.3.92
- 0.3.91
- 0.3.90
- 0.3.89
- 0.3.88
- 0.3.87
- 0.3.86
- 0.3.85
- 0.3.84
- 0.3.83
- 0.3.82
- 0.3.81
- 0.3.80
- 0.3.79
- 0.3.78
- 0.3.77
- 0.3.76
- 0.3.75
- 0.3.74
- 0.3.73
- 0.3.72
- 0.3.71
- 0.3.70
- 0.3.69
- 0.3.68
- 0.3.67
- 0.3.66
- 0.3.65
- 0.3.64
- 0.3.63
- 0.3.62
- 0.3.61
- 0.3.60
- 0.3.59
- 0.3.58
- 0.3.57
- 0.3.56
- 0.3.55
- 0.3.54
- 0.3.53
- 0.3.52
- 0.3.51
- 0.3.50
- 0.3.49
- 0.3.48
- 0.3.47
- 0.3.46
- 0.3.45
- 0.3.44
- 0.3.43
- 0.3.42
- 0.3.41
- 0.3.40
- 0.3.39
- 0.3.38
- 0.3.37
- 0.3.36
- 0.3.35
- 0.3.34
- 0.3.33
- 0.3.32
- 0.3.31
- 0.3.30
- 0.3.29
- 0.3.28
- 0.3.27
- 0.3.26
- 0.3.25
- 0.3.24
- 0.3.23
- 0.3.22
- 0.3.21
- 0.3.20
- 0.3.19
- 0.3.18
- 0.3.17
- 0.3.16
- 0.3.15
- 0.3.14
- 0.3.11
- 0.3.10
- 0.3.9
- 0.3.8
- 0.3.7
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.00
- 0.2.99
- 0.2.98
- 0.2.97
- 0.2.96
- 0.2.95
- 0.2.94
- 0.2.93
- 0.2.92
- 0.2.91
- 0.2.90
- 0.2.89
- 0.2.88
- 0.2.87
- 0.2.86
- 0.2.85
- 0.2.84
- 0.2.83
- 0.2.82
- 0.2.81
- 0.2.80
- 0.2.79
- 0.2.78
- 0.2.77
- 0.2.76
- 0.2.75
- 0.2.74
- 0.2.73
- 0.2.72b
- 0.2.71
- 0.2.70
- 0.2.69
- 0.2.68
- 0.2.67
- 0.2.66
- 0.2.65
- 0.2.64
- 0.2.63
- 0.2.62
- 0.2.61
- 0.2.60
- 0.2.59
- 0.2.58
- 0.2.57
- 0.2.56
- 0.2.55
- 0.2.54
- 0.2.53
- 0.2.52
- 0.2.51
- 0.2.50
- 0.2.49
- 0.2.48
- 0.2.47
- 0.2.46
- 0.2.45
- 0.2.44
- 0.2.43
- 0.2.42
- 0.2.41
- 0.2.7
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.99
- 0.1.98
- 0.1.97
- 0.1.96
- 0.1.95
- 0.1.94
- 0.1.93
- 0.1.92
- 0.1.91
- 0.1.90
- 0.1.89
- 0.1.88
- 0.1.87
- 0.1.86
- 0.1.85
- 0.1.84
- 0.1.83
- 0.1.82
- 0.1.81
- 0.1.80
- 0.1.79
- 0.1.78
- 0.1.77
- 0.1.76
- 0.1.75
- 0.1.74
- 0.1.73
- 0.1.72
- 0.1.71
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-dot2-192/195
This package is auto-updated.
Last update: 2024-03-18 08:27:13 UTC
README
This package is used as a base for SCTeam
Installation
1. Require package in your composer.json
:
composer require studiocreativateam/base
Run below command to overwrite config/breadcrumbs.php settings
php artisan vendor:publish --provider="SCTeam\Base\SCTeamServiceProvider" --tag="config-base" --force
Publishing
In this package you can publish below files:
- views
php artisan vendor:publish --provider="SCTeam\Base\SCTeamServiceProvider" --tag="views"
- config
php artisan vendor:publish --provider="SCTeam\Base\SCTeamServiceProvider" --tag="config"
Clear cache / delete cached js-css files
Command: php artisan cache:flush
Get request: /admin/cache/flush
add to composer.json:
{
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
...
"@php artisan cache:flush"
]
}
}
Clear cache by keys:
ClearCacheFiredEvent::dispatch([...keys])
How to add global scope:
- Create Scope class:
<?php
namespace SCTeam\Package\Scopes;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use SCTeam\Package\Models\Some; use SCTeam\Base\Models\GlobalScope;
class InCompany extends GlobalScope {
public static function model(): array|string
{
return [
\SCTeamAuth::userModelClass(),
Some::class,
];
}
public function apply(Builder $builder, Model $model): void
{
$builder->whereHas('company');
}
}
in the _model_ function, pass the names of the models for which globalscope is to be applied
2. Declare your custom global scope in service provider:
class SCTeamServiceProvider extends BaseSCTeamServiceProvider {
/// ...
protected function globalScopes(): array|string
{
return InCompany::class;
}
/// ...
}
3. Add trait to your model:
use HasHookGlobalScope;
# Sidebar configuration
### Add to config/config.php
'sidebar_elements' => [
\SCTeam\Base\Enums\LeftSidebarHook::Shop => [
100 => [ /// 100 is priority
'key' => 'some-key', // use to dynamic submenu positions
'text' => 'scteam.package::common.some',
'icon' => 'fa-solid fa-info',
'badge' => [SomeRepository::class, 'method'],
'submenu' => [
100 => [
'text' => 'scteam.package::common.somes',
'route' => 'package.somes.index',
'active' => ['admin/package/somes*'],
'icon' => false,
'can' => [SomePermissions::SomeList],
],
],
],
]
],
### How to add dynamic submenu position
'sidebar_elements' => [
\SCTeam\Base\Enums\LeftSidebarHook::Shop => [
360 => [
'add_to' => 'some-key', // this is important
'text' => 'scteam.package::common.some-sub-position',
'route' => 'package.some-sub.index',
'icon' => false,
'active' => ['admin/package/some-sub*'],
'can' => [SomeSubPermissions::SomeSubList]
]
]
],