laragear / meta Goto Github PK
View Code? Open in Web Editor NEWA Laravel Package helper for Laravel Packages
License: MIT License
A Laravel Package helper for Laravel Packages
License: MIT License
Meta/src/Database/Eloquent/ExtendsBuilder.php
Lines 46 to 48 in 8b5ed97
alll
all
9.47.0
Be able to use Meta, and the Laragear Two Factor package, without pulling Laravel Breeze into my application.
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?
composer require laragear/two-factor
or
composer require laragear/meta
and you'll see laravel/breeze being pulled in.
No response
all
all
9.47.0
I expect that the middlewarePriority specified in app/Http/Kernel.php will be respected.
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.
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.
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.