From cb086c470806c68343aa5cd0cabc4780a4a24d5b Mon Sep 17 00:00:00 2001 From: Jaiden Date: Sun, 25 May 2025 17:14:11 -0400 Subject: [PATCH 1/3] Remove search for now, increase upload filesize limits --- app/Livewire/App/Pagination.php | 13 ++ app/Livewire/Pages/Users.php | 2 +- app/Livewire/Posts/Index.php | 4 +- app/Livewire/Search.php | 29 ---- app/Livewire/Tags/View.php | 13 ++ app/Models/Tag.php | 2 - app/Models/User.php | 14 +- composer.json | 1 - composer.lock | 151 +----------------- config/favorite.php | 2 +- config/livewire.php | 7 +- deploy/php.ini | 4 +- resources/views/livewire/app/home.blade.php | 4 - .../views/livewire/app/pagination.blade.php | 34 ++++ .../views/livewire/pages/users.blade.php | 2 + resources/views/livewire/posts/edit.blade.php | 44 ++--- .../views/livewire/posts/index.blade.php | 1 + resources/views/livewire/posts/view.blade.php | 10 +- resources/views/livewire/search.blade.php | 19 --- resources/views/livewire/tags/view.blade.php | 3 + routes/web.php | 2 + 21 files changed, 117 insertions(+), 244 deletions(-) create mode 100644 app/Livewire/App/Pagination.php delete mode 100644 app/Livewire/Search.php create mode 100644 app/Livewire/Tags/View.php create mode 100644 resources/views/livewire/app/pagination.blade.php delete mode 100644 resources/views/livewire/search.blade.php create mode 100644 resources/views/livewire/tags/view.blade.php diff --git a/app/Livewire/App/Pagination.php b/app/Livewire/App/Pagination.php new file mode 100644 index 0000000..6db10c0 --- /dev/null +++ b/app/Livewire/App/Pagination.php @@ -0,0 +1,13 @@ + User::all() ]); + return view('livewire.pages.users', [ 'users' => User::paginate(10) ]); } } diff --git a/app/Livewire/Posts/Index.php b/app/Livewire/Posts/Index.php index b2cdeb8..669fbec 100644 --- a/app/Livewire/Posts/Index.php +++ b/app/Livewire/Posts/Index.php @@ -3,7 +3,9 @@ namespace App\Livewire\Posts; use App\Models\Post; +use App\Models\Tag; use Livewire\Attributes\Title; +use Livewire\Attributes\Url; use Livewire\Component; use Livewire\WithPagination; @@ -14,7 +16,7 @@ class Index extends Component #[Title('Posts')] public function render() { - return view('livewire.posts.index', [ + return view('livewire.posts.index', [ 'posts' => Post::orderBy('created_at', 'desc')->paginate(25), ]); } diff --git a/app/Livewire/Search.php b/app/Livewire/Search.php deleted file mode 100644 index de56fca..0000000 --- a/app/Livewire/Search.php +++ /dev/null @@ -1,29 +0,0 @@ -searchResults = (new SpatieSearch()) - ->registerModel(User::class, 'name') - ->perform($this->searchText); - } -} diff --git a/app/Livewire/Tags/View.php b/app/Livewire/Tags/View.php new file mode 100644 index 0000000..52b1154 --- /dev/null +++ b/app/Livewire/Tags/View.php @@ -0,0 +1,13 @@ +hasMany(Comment::class); } - public function getSearchResult(): SearchResult - { - $url = url("/profiles/$this->id"); - return new SearchResult( - $this, - $this->name, - $url - ); - } - public function getAvatarBase64(): string { $ext = $this->avatar_ext; diff --git a/composer.json b/composer.json index 76b9bf0..24ae217 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,6 @@ "require": { "php": "^8.2", "ext-gmp": "*", - "intervention/image-driver-vips": "^1.0", "intervention/image-laravel": "^1.5", "laravel/framework": "^12.0", "laravel/octane": "^2.9", diff --git a/composer.lock b/composer.lock index d80d1b1..5a2e698 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8b27de9cde91a749385c346c0d27d3e0", + "content-hash": "5de9119745206eabc310e39501de5f17", "packages": [ { "name": "brick/math", @@ -1261,80 +1261,6 @@ ], "time": "2025-05-22T17:26:23+00:00" }, - { - "name": "intervention/image-driver-vips", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/Intervention/image-driver-vips.git", - "reference": "080de0e638bcf508b5e79c2d88e82b0fd91b12b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Intervention/image-driver-vips/zipball/080de0e638bcf508b5e79c2d88e82b0fd91b12b0", - "reference": "080de0e638bcf508b5e79c2d88e82b0fd91b12b0", - "shasum": "" - }, - "require": { - "intervention/image": "^3.11.0", - "jcupitt/vips": "^2.4", - "php": "^8.1" - }, - "require-dev": { - "ext-fileinfo": "*", - "phpstan/phpstan": "^2", - "phpunit/phpunit": "^10.0 || ^11.0 || ^12.0", - "slevomat/coding-standard": "~8.0", - "squizlabs/php_codesniffer": "^3.8" - }, - "type": "library", - "autoload": { - "psr-4": { - "Intervention\\Image\\Drivers\\Vips\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Oliver Vogel", - "email": "oliver@intervention.io", - "homepage": "https://intervention.io/" - }, - { - "name": "Thomas Picquet", - "email": "thomas@sctr.net" - } - ], - "description": "libvips driver for Intervention Image", - "homepage": "https://image.intervention.io/", - "keywords": [ - "image", - "libvips", - "vips" - ], - "support": { - "issues": "https://github.com/Intervention/image-driver-vips/issues", - "source": "https://github.com/Intervention/image-driver-vips/tree/1.0.5" - }, - "funding": [ - { - "url": "https://paypal.me/interventionio", - "type": "custom" - }, - { - "url": "https://github.com/Intervention", - "type": "github" - }, - { - "url": "https://ko-fi.com/interventionphp", - "type": "ko_fi" - } - ], - "time": "2025-05-05T13:53:52+00:00" - }, { "name": "intervention/image-laravel", "version": "1.5.6", @@ -1419,67 +1345,6 @@ ], "time": "2025-04-04T15:09:55+00:00" }, - { - "name": "jcupitt/vips", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/libvips/php-vips.git", - "reference": "a54c1cceea581b592a199edd61a7c06f44a24c08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/libvips/php-vips/zipball/a54c1cceea581b592a199edd61a7c06f44a24c08", - "reference": "a54c1cceea581b592a199edd61a7c06f44a24c08", - "shasum": "" - }, - "require": { - "ext-ffi": "*", - "php": ">=7.4", - "psr/log": "^1.1.3|^2.0|^3.0" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpdocumentor/shim": "^3.3", - "phpunit/phpunit": "^9.5", - "squizlabs/php_codesniffer": "^3.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jcupitt\\Vips\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Cupitt", - "email": "jcupitt@gmail.com", - "homepage": "https://github.com/jcupitt", - "role": "Developer" - } - ], - "description": "A high-level interface to the libvips image processing library.", - "homepage": "https://github.com/libvips/php-vips", - "keywords": [ - "image", - "libvips", - "processing" - ], - "support": { - "issues": "https://github.com/libvips/php-vips/issues", - "source": "https://github.com/libvips/php-vips/tree/v2.5.0" - }, - "time": "2025-04-04T17:10:13+00:00" - }, { "name": "laminas/laminas-diactoros", "version": "3.6.0", @@ -3050,21 +2915,21 @@ }, { "name": "mongodb/mongodb", - "version": "2.0.0", + "version": "1.21.1", "source": { "type": "git", "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "04cd7edc6a28950e3fab6eccb2869d72a0541232" + "reference": "37bc8df3a67ddf8380704a5ba5dbd00e92ec1f6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/04cd7edc6a28950e3fab6eccb2869d72a0541232", - "reference": "04cd7edc6a28950e3fab6eccb2869d72a0541232", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/37bc8df3a67ddf8380704a5ba5dbd00e92ec1f6a", + "reference": "37bc8df3a67ddf8380704a5ba5dbd00e92ec1f6a", "shasum": "" }, "require": { "composer-runtime-api": "^2.0", - "ext-mongodb": "^2.0", + "ext-mongodb": "^1.21.0", "php": "^8.1", "psr/log": "^1.1.4|^2|^3" }, @@ -3120,9 +2985,9 @@ ], "support": { "issues": "https://github.com/mongodb/mongo-php-library/issues", - "source": "https://github.com/mongodb/mongo-php-library/tree/2.0.0" + "source": "https://github.com/mongodb/mongo-php-library/tree/1.21.1" }, - "time": "2025-04-10T08:34:11+00:00" + "time": "2025-02-28T17:24:20+00:00" }, { "name": "monolog/monolog", diff --git a/config/favorite.php b/config/favorite.php index b4ed52e..8d43dfe 100644 --- a/config/favorite.php +++ b/config/favorite.php @@ -4,7 +4,7 @@ return [ /** * Use uuid as primary key. */ - 'uuids' => false, + 'uuids' => true, /* * User tables foreign key name. diff --git a/config/livewire.php b/config/livewire.php index 14d3432..544a044 100644 --- a/config/livewire.php +++ b/config/livewire.php @@ -65,12 +65,13 @@ return [ 'temporary_file_upload' => [ 'disk' => null, // Example: 'local', 's3' | Default: 'default' - 'rules' => ['required', 'file', 'max:12288'], // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB) + 'rules' => ['file', 'max:81920'], // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB) 'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp' 'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1' 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs... - 'png', 'gif', 'bmp', 'svg', - 'jpg', 'jpeg', 'webp', + 'png', 'gif', 'bmp', 'svg', 'wav', 'mp4', + 'mov', 'avi', 'wmv', 'mp3', 'm4a', + 'jpg', 'jpeg', 'mpga', 'webp', 'wma', ], 'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated... 'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs... diff --git a/deploy/php.ini b/deploy/php.ini index ede12cf..2800a8b 100644 --- a/deploy/php.ini +++ b/deploy/php.ini @@ -1,2 +1,2 @@ -upload_max_filesize = 64M -post_max_filesize = 72M +upload_max_filesize = 80M +post_max_filesize = 100M diff --git a/resources/views/livewire/app/home.blade.php b/resources/views/livewire/app/home.blade.php index 64bdb7a..fa1f352 100644 --- a/resources/views/livewire/app/home.blade.php +++ b/resources/views/livewire/app/home.blade.php @@ -5,10 +5,6 @@ {{-- {{ config('app.name') }}--}} {{-- --}}

{{ config('app.name') }}

- - @auth - - @endauth diff --git a/resources/views/livewire/app/pagination.blade.php b/resources/views/livewire/app/pagination.blade.php new file mode 100644 index 0000000..a4364eb --- /dev/null +++ b/resources/views/livewire/app/pagination.blade.php @@ -0,0 +1,34 @@ + diff --git a/resources/views/livewire/pages/users.blade.php b/resources/views/livewire/pages/users.blade.php index 7cab255..e29f1d5 100644 --- a/resources/views/livewire/pages/users.blade.php +++ b/resources/views/livewire/pages/users.blade.php @@ -6,4 +6,6 @@ @endforeach + + {{ $users->links('livewire.app.pagination') }} diff --git a/resources/views/livewire/posts/edit.blade.php b/resources/views/livewire/posts/edit.blade.php index 287d43f..e66781b 100644 --- a/resources/views/livewire/posts/edit.blade.php +++ b/resources/views/livewire/posts/edit.blade.php @@ -40,12 +40,14 @@ Tags - @foreach ($tags as $postTag) - - @endforeach + @@ -63,24 +65,24 @@ {{-- Main content --}} -