Skip to content

Commit

Permalink
Merge pull request #204 from SlovakNationalGallery/KOMARCH-296-upgrad…
Browse files Browse the repository at this point in the history
…e-laravel-10

Komarch 296 upgrade laravel 10
  • Loading branch information
igor-kamil committed Feb 7, 2024
2 parents 46ae3fc + feecb16 commit 10969b1
Show file tree
Hide file tree
Showing 14 changed files with 736 additions and 969 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
${{ runner.os }}-node-
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
extensions: mbstring, bcmath, fileinfo, pdo_mysql
- name: Add Composer auth credentials (for Backpack Pro)
run: echo '${{ secrets.COMPOSER_AUTH_JSON }}' > $GITHUB_WORKSPACE/auth.json
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
${{ runner.os }}-composer-
- uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: 8.2
- name: Add Composer auth credentials (for Backpack Pro)
run: echo '${{ secrets.COMPOSER_AUTH_JSON }}' > $GITHUB_WORKSPACE/auth.json
- run: composer install --no-progress --no-interaction --no-dev
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.phpunit.cache
/node_modules
/public/hot
/public/storage
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Kernel extends HttpKernel
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
Expand Down
14 changes: 7 additions & 7 deletions app/Models/Contest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ class Contest extends Model implements HasMedia

public $incrementing = false;

protected $dates = [
'announced_at',
'approved_at',
'finished_at',
'results_published_at',
'created_at',
'updated_at',
protected $casts = [
'announced_at' => 'datetime',
'approved_at' => 'datetime',
'finished_at' => 'datetime',
'results_published_at' => 'datetime',
'created_at' => 'datetime',
'updated_at' => 'datetime',
];

protected $appends = ['state'];
Expand Down
7 changes: 6 additions & 1 deletion app/Models/Deadline.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ class Deadline extends Model

protected $table = 'deadlines';
protected $guarded = ['id'];
protected $dates = ['published_at', 'deadline_at'];
protected $translatable = ['title'];

protected $casts = [
'published_at' => 'datetime',
'deadline_at' => 'datetime',
];


/*
|--------------------------------------------------------------------------
| SCOPES
Expand Down
1 change: 0 additions & 1 deletion app/Models/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class Document extends Model implements HasMedia
];

protected $hidden = [];
// protected $dates = [];

public $with = ['types', 'topics', 'roles'];

Expand Down
5 changes: 4 additions & 1 deletion app/Models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ class Page extends Model implements HasMedia
'cover_image',
'redirect_url',
];
protected $dates = ['published_at'];

protected $casts = [
'published_at' => 'datetime',
];

public function getRouteKeyName()
{
Expand Down
3 changes: 2 additions & 1 deletion app/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ class Post extends Model implements HasMedia
'is_featured',
'cover_image',
];
protected $dates = ['published_at'];

protected $casts = [
'is_featured' => 'boolean',
'published_at' => 'datetime',
];

public function getRouteKeyName()
Expand Down
5 changes: 4 additions & 1 deletion app/Models/Publication.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ class Publication extends Model

protected $table = 'publications';
protected $guarded = ['id'];
protected $dates = ['published_at'];
protected $translatable = ['title', 'description'];

protected $casts = [
'published_at' => 'datetime',
];

/*
|--------------------------------------------------------------------------
| FUNCTIONS
Expand Down
1 change: 0 additions & 1 deletion app/Models/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class Tag extends Model
protected $guarded = ['id'];
// protected $fillable = [];
// protected $hidden = [];
// protected $dates = [];

protected $translatable = [
'name',
Expand Down
5 changes: 4 additions & 1 deletion app/Models/Tile.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ class Tile extends Model

protected $table = 'tiles';
protected $guarded = ['id'];
protected $dates = ['published_at'];
protected $translatable = ['title'];

protected $casts = [
'published_at' => 'datetime',
];

/*
|--------------------------------------------------------------------------
| FUNCTIONS
Expand Down
24 changes: 12 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,25 @@
],
"license": "MIT",
"require": {
"php": "^8.0.2",
"php": "^8.1",
"babenkoivan/elastic-migrations": "^1.3",
"babenkoivan/elastic-scout-driver": "^1.2",
"babenkoivan/elastic-scout-driver-plus": "^2.3",
"backpack/crud": "^5.0.0",
"backpack/filemanager": "^2.0",
"backpack/logmanager": "^4.0",
"backpack/pro": "1.2.8",
"doctrine/dbal": "^2.5",
"fruitcake/laravel-cors": "^2.0",
"doctrine/dbal": "^3.5",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.0",
"laravel/sanctum": "^3.0",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/scout": "^9.0",
"laravel/telescope": "^4.3",
"laravel/tinker": "^2.7",
"laravel/tinker": "^2.8",
"league/flysystem-sftp": "^3.0",
"mcamara/laravel-localization": "^1.6",
"sentry/sentry-laravel": "^3.3",
"spatie/laravel-medialibrary": "^9.4",
"spatie/laravel-medialibrary": "^11.0",
"spatie/laravel-missing-page-redirector": "^2.7",
"spatie/laravel-sluggable": "^3.5",
"spatie/laravel-tags": "^4.5",
Expand All @@ -40,17 +39,18 @@
"deployer/deployer": "^7.3",
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.0.1",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1",
"spatie/laravel-ignition": "^2.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
Expand All @@ -71,7 +71,7 @@
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable": true,
"scripts": {
"post-install-cmd": [
Expand Down
Loading

0 comments on commit 10969b1

Please sign in to comment.