Skip to content

Commit 175f7ec

Browse files
committed
wip
1 parent 4eb751d commit 175f7ec

File tree

5 files changed

+25
-32
lines changed

5 files changed

+25
-32
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to `personal-data-export` will be documented in this file
44

5+
## 3.0.0 - 2021-08-01
6+
7+
- improve translations
8+
- refactor internals
9+
510
## 2.0.2 - 2021-05-05
611

712
- deps: update spatie/temporary-directory (#57)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected function schedule(Schedule $schedule)
9191
Optionally, you can publish the config file with:
9292

9393
```php
94-
php artisan vendor:publish --provider="Spatie\PersonalDataExport\PersonalDataExportServiceProvider" --tag="config"
94+
php artisan vendor:publish --provider="Spatie\PersonalDataExport\PersonalDataExportServiceProvider" --tag="personal-data-export-config"
9595
```
9696

9797
This is the content of the config file, which will be published at `config/personal-data-export.php`:
@@ -203,12 +203,12 @@ When the user clicks the download link in the mail that gets sent after creating
203203

204204
If you don't want to enforce that a user should be logged in to able to download a personal data export, you can set the `authentication_required` config value to `false`. Setting the value to `false` is less secure because anybody with a link to a zip file will be able to download it, but because the name of the zip file contains many random characters, it will be hard to guess it.
205205

206-
### Translate the mail
206+
### Translating the notification
207207

208208
You need to publish the translations:
209209

210210
```bash
211-
php artisan vendor:publish --provider="Spatie\PersonalDataExport\PersonalDataExportServiceProvider" --tag="translations"
211+
php artisan vendor:publish --provider="Spatie\PersonalDataExport\PersonalDataExportServiceProvider" --tag="personal-data-export-translations"
212212
```
213213

214214
### Customizing the mail
@@ -315,4 +315,4 @@ If you discover any security related issues, please email freek@spatie.be instea
315315

316316
## License
317317

318-
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
318+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"illuminate/queue": "^8.0",
2929
"illuminate/support": "^8.0",
3030
"nesbot/carbon": "^2.14",
31+
"spatie/laravel-package-tools": "^1.9",
3132
"spatie/temporary-directory": "^2.0"
3233
},
3334
"require-dev": {

resources/lang/en/notifications.php

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

33
return [
44
'subject' => 'Personal Data Download',
5-
'instructions' => 'Please click the button below to download a zip file containg all data we got for your account.',
5+
'instructions' => 'Please click the button below to download a zip file containing all data we got for your account.',
66
'action' => 'Download Zip File',
77
'deletion_message' => 'This file will be deleted at :date.',
88
];

src/PersonalDataExportServiceProvider.php

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,26 @@
44

55
use Illuminate\Support\Facades\Route;
66
use Illuminate\Support\ServiceProvider;
7+
use Spatie\LaravelPackageTools\Package;
8+
use Spatie\LaravelPackageTools\PackageServiceProvider;
79
use Spatie\PersonalDataExport\Commands\CleanOldPersonalDataExportsCommand;
10+
use Spatie\PersonalDataExport\Http\Controllers\PersonalDataExportController;
811

9-
class PersonalDataExportServiceProvider extends ServiceProvider
12+
class PersonalDataExportServiceProvider extends PackageServiceProvider
1013
{
11-
public function boot()
14+
public function configurePackage(Package $package): void
1215
{
13-
if ($this->app->runningInConsole()) {
14-
$this->publishes([
15-
__DIR__ . '/../config/personal-data-export.php' => config_path('personal-data-export.php'),
16-
], 'config');
17-
}
18-
19-
Route::macro('personalDataExports', function (string $url) {
20-
Route::get("$url/{zipFilename}", '\Spatie\PersonalDataExport\Http\Controllers\PersonalDataExportController@export')
21-
->name('personal-data-exports');
22-
});
23-
24-
$this->loadTranslationsFrom(
25-
__DIR__ . '/../resources/lang/',
26-
"personal-data-export"
27-
);
28-
29-
$this->publishes([
30-
__DIR__ . '/../resources/lang' => resource_path("lang/vendor/personal-data-export"),
31-
], "translations");
32-
33-
$this->commands([
34-
CleanOldPersonalDataExportsCommand::class,
35-
]);
16+
$package
17+
->name('laravel-personal-data-export')
18+
->hasConfigFile()
19+
->hasCommand(CleanOldPersonalDataExportsCommand::class)
20+
->hasTranslations();
3621
}
3722

38-
public function register()
23+
public function packageBooted()
3924
{
40-
$this->mergeConfigFrom(__DIR__ . '/../config/personal-data-export.php', 'personal-data-export');
25+
Route::macro('personalDataExports', function (string $url) {
26+
Route::get("$url/{zipFilename}", [PersonalDataExportController::class, 'export'])->name('personal-data-exports');
27+
});
4128
}
4229
}

0 commit comments

Comments
 (0)