Coder Social home page Coder Social logo

meta's People

Contributors

darkghosthunter avatar stylecibot avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

meta's Issues

[1.x] Remove dependency on Laravel Breeze

PHP & Platform

alll

Database

all

Laravel version

9.47.0

Have you done this?

  • I have checked my logs and I'm sure is a bug in this package.
  • I can reproduce this bug in isolation (vanilla Laravel install)
  • I can suggest a workaround as a Pull Request

Expectation

Be able to use Meta, and the Laragear Two Factor package, without pulling Laravel Breeze into my application.

Description

I installed the Larager Two Factor package, which works really well btw, and it required this package, laragear/meta.

That's all good, but Meta has a requirement in composer.json for laravel/breeze. I can't see any place in the Meta code that depends on Breeze, and I don't need, use or want Breeze in my application, but if I install Two Factor, or Meta ... I get breeze.

If this is required and I've overlooked the dependency, my apologies, but if not, can the composer dependency on breeze be removed?

Reproduction

composer require laragear/two-factor
or
composer require laragear/meta

and you'll see laravel/breeze being pulled in.

Stack trace & logs

No response

[1.x] withMiddleware calls cause user specified middlewarePriority's to be ignored

PHP & Platform

all

Database

all

Laravel version

9.47.0

Have you done this?

  • I have checked my logs and I'm sure is a bug in this package.
  • I can reproduce this bug in isolation (vanilla Laravel install)
  • I can suggest a workaround as a Pull Request

Expectation

I expect that the middlewarePriority specified in app/Http/Kernel.php will be respected.

Description

Laravel documents a way to specify the order in which non-global middleware is run:
https://laravel.com/docs/9.x/middleware#sorting-middleware

If you specify this, then install Laragear two-factor, which uses meta to define new middleware, your user specified middleware priority is lost. I'll confess this is really hard to observe/test, but ...

if you add a logger($this->middlewarePriority); call right before the return statement at the end of the resolveMiddleware method in vendor/laravel/framework/src/Illuminate/Routing/Router.php, then execute a web request and look for the DEBUG line in the log file, you'll see that it is using the middlewarePriority array from the Laravel base class, not the one you specified in app/Http/Kernel.php and as a result the middleware is not sorting the way you specified.

The bug appears to be in the withMiddleware method in the BootHelpers trait. It calls $this->app->make(Kernel::class) and near the top of the file contains use Illuminate\Foundation\Http\Kernel - the base class.

Instead I believe this use statement should be use Illuminate\Contracts\Http\Kernel after which the app->make() call will resolve to app/Http/Kernel.

I hope this makes sense, and if there is a different workaround, I'd be very open to it.

Reproduction

See the Description.
- Copy the middlewarePriority values from the Illuminate Kernel.php file into your own app/Http/Kernel.php file, then insert one of your own Middleware methods into the middle of the array.
- Add a logger call to `Router::resolveMiddleware` as described above.
- Execute a web request then check the log file and you'll see that the base class version of middlewarePriority is used for sorting, not your version.

Stack trace & logs

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.