Skip to content

Commit

Permalink
Revert "Update dependencies" (#422)
Browse files Browse the repository at this point in the history
Reverts #410
  • Loading branch information
wouterbles authored Jan 21, 2025
1 parent 9a79a6f commit 8601946
Show file tree
Hide file tree
Showing 46 changed files with 3,910 additions and 5,657 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
php-version: '8.2'

- name: Setup MySQL
uses: mirromutth/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the specified image as the base
FROM php:8.4-fpm
FROM php:8.2-fpm

# Install system dependencies, PHP extensions, and Node.js
RUN apt-get update && apt-get install -y \
Expand Down
10 changes: 2 additions & 8 deletions app/Http/Controllers/AgendaItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
use App\Repositories\ApplicationFormRepositories\ApplicationFormRepository;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Gd\Driver;
use Intervention\Image\ImageManagerStatic as Image;

class AgendaItemController extends Controller
{
private $_agendaItemRepository;
private $_agendaItemCategoryRepository;
private $_applicationFormRepository;
private $_imageManager;

public function __construct(
AgendaItemRepository $agendaItemRepository,
Expand All @@ -29,7 +27,6 @@ public function __construct(
$this->_agendaItemRepository = $agendaItemRepository;
$this->_agendaItemCategoryRepository = $agendaItemCategoryRepository;
$this->_applicationFormRepository = $applicationFormRepository;
$this->_imageManager = new ImageManager(new Driver());
}

public function index()
Expand Down Expand Up @@ -143,11 +140,8 @@ private function handleImage(Request $request, AgendaItem $agendaItem)
$request->file('thumbnail')->storeAs('agendaItem', $name, 'public');
$agendaItem->image_url = 'agendaItem/' . $name;
$agendaItem->save();

$img_path = "../storage/app/public/" . $agendaItem->image_url;
$image = $this->_imageManager->read($img_path);
$image->cover(400, 300);
$image->save();
Image::make($img_path)->fit(400, 300)->save($img_path);
}
}
}
13 changes: 4 additions & 9 deletions app/Http/Controllers/NewsItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,18 @@
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Storage;
use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Gd\Driver;
use Intervention\Image\ImageManagerStatic as Image;

class NewsItemController extends Controller
{
private $_newsItemRepository;
private $_imageManager;

public function __construct(NewsItemRepository $newsItemRepository)
{
$this->middleware('auth');
$this->middleware('authorize:' . Config::get('constants.Content_administrator') . ',' . Config::get('constants.Activity_administrator'));

$this->_newsItemRepository = $newsItemRepository;
$this->_imageManager = new ImageManager(new Driver());
}

public function index()
Expand Down Expand Up @@ -95,17 +92,15 @@ private function uploadAndResizeImage($request, $newsItem)
$newsItem->thumbnail_url = 'newsItems/' . $thumbnailFileName;
$newsItem->save();

// Resize both images
//resize both images
$this->resizeImage($newsItem->image_url, 1200, 500);
$this->resizeImage($newsItem->thumbnail_url, 400, 300);
}

private function resizeImage(string $path, int $width, int $height)
{
$imagePath = Storage::path('public/' . $path);
$image = $this->_imageManager->read($imagePath);
$image->cover($width, $height);
$image->save();
Image::make($imagePath)->fit($width, $height)->save($imagePath);
}

private function validateInput(Request $request)
Expand All @@ -115,4 +110,4 @@ private function validateInput(Request $request)
'text' => 'required',
]);
}
}
}
43 changes: 24 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@
"license": "MIT",
"require": {
"php": "^8.2",
"doctrine/dbal": "^3.8",
"doctrine/dbal": "^3.7",
"eluceo/ical": "^2.12",
"intervention/image": "^3.0",
"laravel/framework": "^11.0",
"intervention/image": "^2.7",
"laravel/framework": "10.*",
"laravel/helpers": "^1.6",
"laravel/legacy-factories": "^1.3",
"laravel/tinker": "^2.9",
"laravel/ui": "^4.5",
"nunomaduro/collision": "^8.1",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.2",
"laravelcollective/html": "^6.4",
"maatwebsite/excel": "^3.1",
"php-http/guzzle7-adapter": "^1.0",
"phpoffice/phpspreadsheet": "^1.29",
"spatie/laravel-blade-javascript": "^2.7",
"spatie/laravel-html": "^3.11"
"phpoffice/phpspreadsheet": "^1.22",
"spatie/laravel-blade-javascript": "^2.7"
},
"require-dev": {
"laravel/dusk": "^8.2",
"phpunit/phpunit": "^11.0",
"barryvdh/laravel-debugbar": "^3.9",
"laravel/dusk": "^7.8",
"phpunit/phpunit": "^10.0",
"barryvdh/laravel-debugbar": "^3.6",
"fakerphp/faker": "^1.23",
"mockery/mockery": "^1.6"
},
Expand Down Expand Up @@ -62,15 +61,21 @@
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
}
}
}
Loading

0 comments on commit 8601946

Please sign in to comment.