Commit Graph

78 Commits (b24503a46ccadf8e6b43438e7415f0222f5aa28d)

Author SHA1 Message Date
Your Name e3b6cebf27 Fix MariaDB driver detection and reblog caption null inserts
Laravel 11 exposes MariaDB as a dedicated 'mariadb' driver, so
config('database.default') === 'mysql' checks silently misclassified
MariaDB as the non-mysql (postgres) branch.

- Add App\Util\Database\DatabaseDriver with isMysqlLike()/isPgsql()
  plus db_is_mysql_like()/db_is_pgsql() global helpers.
- Route all database.default driver checks through the helpers so
  MySQL and MariaDB are treated as one group.
- Use '' (not null) for share/compose caption+rendered, valid whether
  the column is nullable or NOT NULL (it is NOT NULL on MySQL/MariaDB).
- Guard pgsql strtolower() in registration against missing fields.
- Scope CustomEmoji::duplicateShortcodes to the grouped column for
  Postgres GROUP BY validity.
- Remove stale Postgres guard in status:dedup; use havingRaw for
  cross-driver HAVING.
1 week ago
Your Name c0cde2f682 refactor: move 52 legacy models from App\ to App\Models\
Move all Eloquent models from the app/ root directory to app/Models/
for consistency with modern Laravel conventions. The project already had
54 models in App\Models; this migrates the remaining 52 legacy models.

Changes:
- Move 52 model files from app/ to app/Models/
- Update namespace declarations in each model
- Update all ~1000 import references across the codebase
- Add Relation::morphMap() in AppServiceProvider for backward
  compatibility with existing polymorphic database records
- Add missing HasSnowflakePrimary imports for models that relied
  on same-namespace resolution
4 weeks ago
Your Name 54cfdf3c2b refactor: add return type declarations to controller methods
Adds explicit return type declarations to 498 controller methods
across 88 files. Types inferred from return statements:

- JsonResponse for response()->json() returns
- RedirectResponse for redirect()/back() returns
- View (contract) for view() returns
- Response for response() returns
- void for methods with no return value
- array for array returns
- string/int/bool for scalar returns

Also fixes 3 methods with incorrect bare returns:
- AvatarController::deleteAvatar - bare return → json response
- ImportPostController::checkPermissions - bare return → true
- RemoteAuthController::accountToId - bare return → empty array
4 weeks ago
Your Name ffcef3eb2d fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name 1617734907 Revert "Merge pull request #6851 from pixelfed/fix/phpstan-auth-request-scope-2"
This reverts commit ce4baf6995, reversing
changes made to 9235cb979a.
4 weeks ago
Your Name 0939f495bb fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
4 weeks ago
Daniel Supernault d42c25ca64
Update DiscoverController 1 year ago
Daniel Supernault 32fc3180c8
Update DiscoverController, improve public hashtag feed. Fixes #5866 1 year ago
Daniel Supernault b27679fc88
Update Discover, fix account bug 2 years ago
Daniel Supernault 2cae8b48de
Update discover, add network trending using Beagle API 2 years ago
Daniel Supernault a4bc5ce3d0
Update web-api popular accounts route to its own method to remove the breaking oauth scope bug 3 years ago
Daniel Supernault 18382e8a1f
Update DiscoverController, handle discover hashtag redirects 3 years ago
Daniel Supernault 055aa6b39f
Update ApiV1Controller and DiscoverController, fix postgres hashtag search 3 years ago
Daniel Supernault b9154e3090
Update api routes 4 years ago
Daniel Supernault 8487231177
Add hashtag administration 4 years ago
Daniel Supernault 4873c7dd4b
Update HashtagController, improve trending hashtag endpoint 4 years ago
Daniel Supernault 243fcac7d5
Update Discover apis 4 years ago
Daniel Supernault 0afea2ba1c
Cleanup outdated discover routes and unused HomeController 4 years ago
Daniel Supernault 153eb6ba4c
Update HashtagService, use sorted set for followed tags 4 years ago
Daniel Supernault d8ff40ebf9
Update DiscoverController, improve tag feed perf 5 years ago
Daniel Supernault 0541aed510
Update DiscoverController, cache public tag feed and only include local posts for unauthenticated users 5 years ago
Daniel Supernault b91747b4bb
Update DiscoverController, fix favourited state on memories 5 years ago
Daniel Supernault 0b68009933
New Discover layout on Metro 2.0 5 years ago
Daniel Supernault 10b6058cc0
Update DiscoverController, add yearly option and increase limit from 15 to 30 posts 5 years ago
Daniel Supernault 135474ae11
Update DiscoverController, use UserFilterService on trendingApi 5 years ago
Daniel Supernault 1404ac6e6f
Update Discover, allow public discover access 6 years ago
Daniel Supernault b16e9452bc
Update DiscoverController, deprecate unused endpoints 6 years ago
Daniel Supernault 2eea04097a
Update DiscoverController, change api schema 6 years ago
Daniel Supernault a98b65bf5c
Update DiscoverController 6 years ago
Daniel Supernault 74ba326adb
Update DiscoverController, limit trending api to local posts 6 years ago
Daniel Supernault d8d3331f3f
Update DiscoverController, improve trending api performance 6 years ago
Daniel Supernault b2fe219eec
Update DiscoverController, add albums and video to discover trending api 6 years ago
Daniel Supernault f70826e18c
Update status model, use scope over deprecated visibility attribute 6 years ago
Daniel Supernault 2ab2c9a974
Update DiscoverController, fix trending api 6 years ago
Daniel Supernault e08f646008
Update DiscoverController 6 years ago
Daniel Supernault 8e7f4f9d88
Update DiscoverController, fixes #2378 6 years ago
Daniel Supernault c251d41b2e
Update Discover, add trending hashtags, places and posts 6 years ago
Daniel Supernault a87cc2dcaa
Update Discover 6 years ago
Daniel Supernault b04c7170d7
Update DiscoverController, fixes #2009 7 years ago
Daniel Supernault 293b806afc
Update DiscoverController 7 years ago
Daniel Supernault 4145141366
Update DiscoverController 7 years ago
Daniel Supernault c19fe3cde8
Update DiscoverController, limit Loops to local only posts 7 years ago
Daniel Supernault 39f4b470b3
Update DiscoverController 7 years ago
Daniel Supernault 4ca415e181
Fixes #1485 7 years ago
Daniel Supernault 1b9b299927
Update DiscoverController 7 years ago
Daniel Supernault d371c5a7de
Update DiscoverController 7 years ago
Daniel Supernault 5b713a1e0f
Update DiscoverController 7 years ago
Daniel Supernault 6f783cac66
Update DiscoverController 7 years ago
Daniel Supernault f9f38ac4d4
Update DiscoverController 7 years ago