Skip to content

Commit a3d6a5d

Browse files
authored
Merge pull request #392 from laravel-enso/release/v4.8.0
Release/v4.8.0
2 parents 734d942 + 507766c commit a3d6a5d

36 files changed

+1967
-1494
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ CACHE_LIFETIME=60
2525

2626
LOGIN_ATTEMPTS_PER_MINUTE=5
2727
PASSWORD_LIFETIME=0
28-
PASSWORD_LENGTH=6
29-
PASSWORD_UPPER_CASE_CHARACTERS=0
30-
PASSWORD_NUMERIC_CHARACTERS=0
31-
PASSWORD_SPECIAL_CHARACTERS=0
28+
PASSWORD_MIN_LENGTH=6
29+
PASSWORD_MIXED_CASE=0
30+
PASSWORD_NUMERIC=0
31+
PASSWORD_SPECIAL=0
3232

3333
REDIS_HOST=127.0.0.1
3434
REDIS_PASSWORD=null

.env.testing

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ CACHE_LIFETIME=60
2525

2626
LOGIN_ATTEMPTS_PER_MINUTE=5
2727
PASSWORD_LIFETIME=0
28-
PASSWORD_LENGTH=6
29-
PASSWORD_UPPER_CASE_CHARACTERS=0
30-
PASSWORD_NUMERIC_CHARACTERS=0
31-
PASSWORD_SPECIAL_CHARACTERS=0
28+
PASSWORD_MIN_LENGTH=6
29+
PASSWORD_MIXED_CASE=0
30+
PASSWORD_NUMERIC=0
31+
PASSWORD_SPECIAL=0
3232

3333
REDIS_HOST=127.0.0.1
3434
REDIS_PASSWORD=null

.github/workflows/main.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: borales/actions-yarn@v2.0.0
2828
- uses: shivammathur/setup-php@v2
2929
with:
30-
php-version: '7.4'
30+
php-version: '8.0'
3131
- name: 'install & build'
3232
run: |
3333
sudo composer install
@@ -53,7 +53,7 @@ jobs:
5353
- uses: actions/checkout@v2
5454
- uses: shivammathur/setup-php@v2
5555
with:
56-
php-version: '7.4'
56+
php-version: '8.0'
5757
- name: 'PhpUnit'
5858
run: |
5959
sudo composer install
@@ -65,7 +65,7 @@ jobs:
6565
- uses: actions/checkout@v2
6666
- uses: shivammathur/setup-php@v2
6767
with:
68-
php-version: '7.4'
68+
php-version: '8.0'
6969
- name: 'Run Phpcpd'
7070
run: |
7171
sudo composer install
@@ -78,7 +78,7 @@ jobs:
7878
- uses: actions/checkout@v2
7979
- uses: shivammathur/setup-php@v2
8080
with:
81-
php-version: '7.4'
81+
php-version: '8.0'
8282
- name: 'Run php-insight'
8383
run: |
8484
sudo composer install
@@ -90,7 +90,7 @@ jobs:
9090
- uses: actions/checkout@v2
9191
- uses: shivammathur/setup-php@v2
9292
with:
93-
php-version: '7.4'
93+
php-version: '8.0'
9494
- name: 'Run php-insight'
9595
run: |
9696
PHP_SC_VERSION=$(curl -s "https://api.github.com/repos/fabpot/local-php-security-checker/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/;s/^v//')
@@ -109,7 +109,7 @@ jobs:
109109
mysql password: ${{env.DB_PASSWORD}}
110110
- uses: shivammathur/setup-php@v2
111111
with:
112-
php-version: '7.4'
112+
php-version: '8.0'
113113
- name: 'Run migration'
114114
run: |
115115
sudo composer install

CHANGELOG.md

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,245 @@
11
# Laravel Enso's Changelog
22

3+
## 4.8.0
4+
5+
This new release adds the possibility for back-end packages to publish their own state to the front-end as well migrates the framework & packages to PHP 8.0. Where applicable, updated packages to take advantage of the new language features.
6+
7+
### Front-end
8+
9+
Most of the packages received a dependency list cleanup.
10+
11+
#### bulma
12+
- added enhanced progress indicator
13+
- added `ProgressIndicator` component export
14+
15+
#### charts
16+
- fixed labels update on structure change
17+
- added `display` function prop
18+
19+
#### enums
20+
- renamed the internal `i18n` attribute to `_i18n`, to avoid potention conflicts with enum keys
21+
22+
#### financials
23+
- fixed supplier invoice index layout
24+
25+
#### localisation
26+
- improved store module
27+
28+
#### products
29+
- improved the product form to update slug dynamically
30+
- improved product picture styling/layout in table & form
31+
- added newly computed supplier discounted price to the form
32+
33+
#### progress-indicator
34+
- implemented enhanced indicator; various progress indicator improvements
35+
36+
#### rating
37+
- updated mobile bottom position
38+
39+
#### scroll-to-top
40+
- updated mobile bottom position
41+
42+
#### strings
43+
- fixed the slug helper
44+
45+
#### tables
46+
- removed the already deprecated `money` support; templates should now use `number ` - more details are found in the upgrade steps
47+
- added customizable total label via the template's `totalLabel` property
48+
- fixed page toggling
49+
50+
#### ui
51+
- improved store module to allow for automatic package store registration
52+
- small refactor and various fixes
53+
- added sentry spike protection
54+
55+
#### user-groups
56+
- removed unneeded file
57+
58+
### Back-end
59+
60+
- all packages have had the route `require` syntax updated to `reqire __DIR__./xxx.php`
61+
- all packages that were using `money` configuration for numeric formatting have been updated to use the already available `number` configuration
62+
- all packages that were including data imports, have been updated so that importers respect the new methods' signatures
63+
- all `get_class($instance)` usages refactored to `$instance::class`
64+
- seeders and factories have been updated, and where it made sense, helper methods (such as `test()`) were added which create a different factory state (such as for testing)
65+
66+
#### action-logger
67+
- code cleanup
68+
69+
#### activity-log
70+
- route refactor
71+
72+
#### api (new)
73+
- new package that provides boileplate for implementing APIs
74+
75+
#### categories
76+
- fixed stacked bar chart
77+
78+
#### charts
79+
- added `contains` nested scope
80+
81+
#### companies
82+
- extracted user state to the users package
83+
84+
#### core
85+
- extracted user state to the users package
86+
87+
#### currencies
88+
- removed `FixesCurrencyApi` exception
89+
- refactored to use the new `api` package
90+
91+
#### data-export
92+
- added `data_exports.name` index upgrade
93+
94+
#### data-import
95+
- improved error logging for local environments
96+
- updated interfaces to pass the import model instead of params/user
97+
- added avoids deletion conflicts and updated delete method
98+
- added `notifies` boolean flag in json template and `notifiableIds` config option
99+
- added `params` to optional attributes
100+
101+
#### files
102+
- improved the file resource
103+
104+
#### helpers
105+
- disabled algolia syncing when not in production
106+
- fixed searchable
107+
- added price computor
108+
- added new custom cast for `Object`
109+
110+
#### localisation
111+
- added & updated various keys & translations
112+
113+
#### measurement-units
114+
- added the name attribute to the rememberable keys config array
115+
- added `MeasurementUnits` enum
116+
117+
#### products
118+
- updated price computor use
119+
- updated product visibility in the supplier resource
120+
- added newly computed supplier discounted price
121+
- added `generateSlug` helper
122+
- added `part_number` index on `product_supplier` pivot
123+
- updated `package_quantity` type to int
124+
125+
#### roles
126+
- added config options for restricting user groups
127+
- improved visible scope
128+
129+
#### sentry
130+
- extracted sentry functionality from the Core package
131+
132+
#### services
133+
- made measurement unit not nullable in the table
134+
- improved upgrade
135+
136+
#### upgrade
137+
- renamed `nullable` Column method to `isNullable`
138+
- added `isSigned`, `isUnsigned` helpers, `getPrecision` and `getScale` for decimals
139+
140+
#### users (new)
141+
- extracted user functionality from the Core package
142+
- removed title from profile builder
143+
- added state provider
144+
- improved `changeGroup` policy
145+
146+
#### user-groups (new)
147+
- extracted user groups functionality from the Core package
148+
- added config options for restricting user groups
149+
- improved visible scope
150+
151+
#### tables
152+
- added customizable total label
153+
- removed the already deprecated `money` support; templates should now use `number ` - more details are found in the upgrade steps
154+
155+
### Upgrade steps
156+
* run `composer update` in the project's root
157+
* run the upgrade commands (both regular and `before-migration`) to ensure
158+
database & strucure is up to date, since this release cleans up a lot of package upgrades
159+
* upgrade your machine to php8
160+
* in `composer.json` update the following dependencies to the given versions:
161+
- `"laravel-enso/core": "^7.0",`
162+
- `"sentry/sentry-laravel": "^2.0.0"`
163+
- `"laravel-enso/phpunit-pretty-print": "^1.0",`
164+
- `"nunomaduro/phpinsights": "^2.0",`
165+
* search & replace in your local project (including the database folder) the following namespaces:
166+
- `Core\Models\UserGroup` -> `UserGroups\Models\UserGroup`
167+
- `Core\Enums\UserGroups` -> `UserGroups\Enums\UserGroups`
168+
- `Core\\Enums\\UserGroups` -> `UserGroups\\Enums\\UserGroups`
169+
- `Core\Models\User` -> `Users\Models\User`
170+
- `Core\Policies\User` -> `Users\Policies\User`
171+
- `Core\Models\Session` -> `Users\Models\Session`
172+
- `Core\Http\Controllers\Administration\Users` -> `Users\Http\Controllers`
173+
- `Core\Http\Controllers\Administration\UserGroups` -> `UserGroups\Http\Controllers`
174+
- `Core\Tables\Administration\Users` -> `Users\Tabels`
175+
- `Core\Forms\Administration\Users` -> `Users\Forms`
176+
- `Core\Http\Resources\User` -> `Users\Http\Resources\User`
177+
- `Core\\Http\\Resources\\User` -> `Users\\Http\\Resources\\User`
178+
- `Core\Http\Requests\ValidateUserRequest` -> `Users\Http\Requests\ValidateUserRequest`
179+
- `Core\Database\Factories\UserFactory` -> `Users\Database\Factories\UserFactory`
180+
- `Core\Database\Seeders\UserGroupSeeder` -> `UserGroups\Database\Seeders\UserGroupSeeder`
181+
- `Core\Database\Seeders\UserSeeder` -> `Users\Database\Seeders\UserSeeder`
182+
- remove from `config/insights.php` the deprecated:
183+
```
184+
use ObjectCalisthenics\Sniffs\Files\FunctionLengthSniff;
185+
use ObjectCalisthenics\Sniffs\Metrics\MethodPerClassLimitSniff;
186+
use ObjectCalisthenics\Sniffs\NamingConventions\ElementNameMinimalLengthSniff;
187+
```
188+
* run `composer update` in the project's root
189+
- update any local person/people factories and seeders and remove the `title` attribute as it has been dropped
190+
- for your local imports, for the importer & validator classes, update the following method signatures (& logic where necessary):
191+
- run: `public function run(Obj $row, DataImport $import);`
192+
- after: `public function after(DataImport $import);`
193+
- authorizes: `public function authorizes(DataImport $import): bool;`
194+
- before: `public function before(DataImport $import);`
195+
* for your local table JSON templates, change any `money` keys to `number`, and remove any "thousand" & "decimal" attributes. Number supports `precision`, `symbol` and `template` (e.g. "%v %s" - `%v` for value, `%s` for symbol)
196+
* local `storage/app/.gitignore` should be updated to ignore all and look like this
197+
```
198+
*
199+
!.gitignore
200+
```
201+
You may also remove `.gitignore` files from individual enso created, app sub-folders (except `public`)
202+
* check the local `config/enso/tables.php` file and if the `export.path` key is present, update it to `export.folder`
203+
* local state:
204+
- remove the local state binding from `App\Providers\AppServiceProvider`: `CoreLocalState::class => LocalState::class,`
205+
- remove the `App\Services\LocalState` class after moving any logic to one or more state builder services
206+
- from `client/src/js/enso.js`, remove the import: `import './localState';`
207+
- remove the file `client/src/js/localState.js`
208+
- if you moved logic from the old `LocalState` class, update the file `client/src/js/store/local.js` as required, otherwise you may delete it. Note that the `client/src/js/store` folder MUST be present.
209+
* compare `config/enso/config.php` with `vendor/laravel-enso/core/config/config.php`
210+
and remove any extra, deprecated keys
211+
* still in `config/enso/config.php` update the Enso version to 4.8.0
212+
* compare `config/enso/addresses.php` with `vendor/laravel-enso/addresses/config/addresses.php` and remove any extra, deprecated keys
213+
* update the `password` `config/enso/auth.php` key as follows:
214+
```
215+
'password' => [
216+
'lifetime' => env('PASSWORD_LIFETIME', 0),
217+
'minLength' => env('PASSWORD_MIN_LENGTH', 6),
218+
'mixedCase' => (bool) env('PASSWORD_MIXED_CASE', 0),
219+
'numeric' => (bool) env('PASSWORD_NUMERIC', 0),
220+
'special' => (bool) env('PASSWORD_SPECIAL', 0),
221+
],
222+
```
223+
* from `Database\Seeders\DatabaseSeeder`, from the `run()` method's unit tests running branch, you may delete the following seeders, as the respective factories have been updated to no longer require this:
224+
```
225+
CountrySeeder::class,
226+
RegionSeeder::class,
227+
TownshipSeeder::class,
228+
LocalitySeeder::class,
229+
```
230+
* update/rename the following `.env` variables:
231+
- `PASSWORD_LENGTH` -> `PASSWORD_MIN_LENGTH`
232+
- `PASSWORD_NUMERIC_CHARACTERS` -> `PASSWORD_NUMERIC`
233+
- `PASSWORD_SPECIAL_CHARACTERS` -> `PASSWORD_SPECIAL`
234+
- `PASSWORD_UPPER_CASE_CHARACTERS` -> `PASSWORD_MIXED_CASE`
235+
* replace `LaravelEnso\Core\Exceptions\Sentry` usage and import with `LaravelEnso\Sentry\Exceptions\Handler` in `App\Exceptions\Handler.php`
236+
* remove `bulma-rtl` patch from `client\patches`, as is no longer needed
237+
* run `yarn`, `yarn upgrade && yarn` in `/client` to ensure you have the latest versions and patches are applied. If necessary, update your patches
238+
* `php artisan migrate`
239+
* `php artisan enso:upgrade`
240+
* as per every release, delete any local, deprecated upgrades
241+
* it recommended to also run the all the enso tests to make everything is working properly; therefore, compare your local `phpunit.xml` with Enso's and make sure that you're not missing any package tests.
242+
3243
## 4.7.1
4244
5245
This is a patch release whose main purpose is to update localisation files.

app/Models/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App\Models;
44

5-
use LaravelEnso\Core\Models\User as CoreUser;
5+
use LaravelEnso\Users\Models\User as CoreUser;
66

77
class User extends CoreUser
88
{

app/Providers/AppServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
use App\Models\User;
99
use Illuminate\Support\ServiceProvider;
1010
use LaravelEnso\Companies\Models\Company;
11-
use LaravelEnso\Core\Models\User as BaseUser;
1211
use LaravelEnso\DynamicMethods\Services\Methods;
12+
use LaravelEnso\Users\Models\User as BaseUser;
1313

1414
class AppServiceProvider extends ServiceProvider
1515
{

app/Providers/HorizonServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public function boot()
2121

2222
protected function gate()
2323
{
24-
Gate::define('viewHorizon', fn ($user) => optional($user)->isAdmin());
24+
Gate::define('viewHorizon', fn ($user) => $user?->isAdmin());
2525
}
2626
}

app/Providers/LoggerServiceProvider.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)