Skip to content

Remove unused leafs/http dependency to clean up project - #56

Open
fadrian06 wants to merge 3 commits into
leafsphp:v5.xfrom
fadrian06:remove-leafs-http
Open

fadrian06 wants to merge 3 commits into
leafsphp:v5.xfrom
fadrian06:remove-leafs-http

Conversation

@fadrian06

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce? (pls check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe below

Developers using leafs/auth without leafs/leaf are still installing leafs/http unnecessarily, the Request, Response and Pages objects are only used if the developer has leafs/leaf installed.

This pull request is part of a series of cleanups made by me to reduce the size of the leafs/auth package and reduce installation times

Description

This pull request makes a minor update to the project's dependencies by removing the leafs/http package from composer.json. This change reduces unused or unnecessary dependencies in the project.

Does this PR introduce a breaking change? (check one)

  • Yes (partially)
  • No

This change will only break projects that use leafs/http without requiring it in composer.json, relying on it being included with leafs/auth.

If this pull request manages to be integrated into version 5, developers should be notified that leafs/auth no longer includes leafs/http, so if you use that package in your projects, add it to the requires of composer.json

Copilot AI lite review requested due to automatic review settings September 11, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃煝 Approval recommended

No unresolved review issues were identified.

Pull request overview

Removes the unused leafs/http dependency from leafs/auth.

Changes:

  • Deletes leafs/http from Composer requirements.
  • Retains other authentication dependencies.
File summaries
File Summary
composer.json Removes the unnecessary HTTP dependency.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mychidarko mychidarko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leafs/http isn't unused yet. Leaf\Http\Session comes from leafs/session, so that part is fine, but Auth::logout($url) calls response()->redirect() outside the class_exists('Leaf\App') guard. Without leafs/http, standalone (non-Leaf) users calling logout('/somewhere') would hit an undefined function. Could you either keep the dependency, or fall back to a plain header('Location: ...') when response() doesn't exist?

@fadrian06

Copy link
Copy Markdown
Contributor Author

It is better to add the class_exists conditional, because the behavior of location: / is different from redirect('/') I think leafs/http adds the base_url but location does not

@mychidarko

Copy link
Copy Markdown
Member

Sounds good 馃憣馃徑

Add a check for function_exists('response') before calling it to prevent
fatal errors in environments where the helper is not available.
@fadrian06
fadrian06 requested a review from mychidarko October 21, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants