enhanced-router icon indicating copy to clipboard operation
enhanced-router copied to clipboard

Support for Laravel 4.1

Open kentliau opened this issue 10 years ago • 17 comments

There are dependency version problem when updating to Laravel 4.1

does changing this could fix the problem?

     "illuminate/support": "4.0.*",
      "illuminate/routing": "4.0.*"

to

     "illuminate/support": "4.0.0",
      "illuminate/routing": "4.0.0"

kentliau avatar Dec 02 '13 08:12 kentliau

4.0.0 would be worse actually, it only matches 4.0.0 and nothing else. It could be ~4 or ~4.0 to make it as general for Laravel 4 as possible.

tlgreg avatar Dec 02 '13 13:12 tlgreg

I'll push a change to support 4.1 later today. Cheers.

jasonlewis avatar Dec 06 '13 00:12 jasonlewis

I was going to push the changes for this but I'm going to wait for a stable 4.1 release first. I'll need to fix up some things as well as I haven't tested it with the latest development of 4.1. I'd say there will be some issues as the router had a huge overhaul between 4.0 and 4.1. Hang tight.

jasonlewis avatar Dec 07 '13 06:12 jasonlewis

Laravel 4.1 came today! Waiting on your release, can't go anywhere without the router!

srtfisher avatar Dec 12 '13 16:12 srtfisher

It'll be a priority for this weekend. On 13 Dec 2013 03:46, "Sean Fisher" [email protected] wrote:

Laravel 4.1 came today! Waiting on your release, can't go anywhere without the router!

— Reply to this email directly or view it on GitHubhttps://github.com/jasonlewis/enhanced-router/issues/16#issuecomment-30439246 .

jasonlewis avatar Dec 12 '13 19:12 jasonlewis

You're more then welcome to investigate the changes necessary for it to work with 4.1. ☺ On 13 Dec 2013 06:35, "Jason Lewis" [email protected] wrote:

It'll be a priority for this weekend. On 13 Dec 2013 03:46, "Sean Fisher" [email protected] wrote:

Laravel 4.1 came today! Waiting on your release, can't go anywhere without the router!

— Reply to this email directly or view it on GitHubhttps://github.com/jasonlewis/enhanced-router/issues/16#issuecomment-30439246 .

jasonlewis avatar Dec 12 '13 19:12 jasonlewis

I don't want this closed yet. Going to investigate how much work would be required to make this package 4.1 compatible but I am aware it could be rather difficult as the router has undergone a lot of change since 4.0.

jasonlewis avatar Dec 13 '13 22:12 jasonlewis

I did have a little look for you but ran out of time.

The interface of classes have changed

Argument 1 passed to Illuminate\Routing\Router::__construct() must be an instance of Illuminate\Events\Dispatcher, instance of Illuminate\Foundation\Application given, called in /vendor/jasonlewis/enhanced-router/src/JasonLewis/EnhancedRouter/EnhancedRouterServiceProvider.php on line 23 and defined

Declaration of JasonLewis\EnhancedRouter\Router::findPatternFilters() should be compatible with Illuminate\Routing\Router::findPatternFilters($request)

Declaration of JasonLewis\EnhancedRouter\Router::dispatch() should be compatible with Illuminate\Routing\Router::dispatch(Illuminate\Http\Request $request)

mrsimonbennett avatar Dec 16 '13 20:12 mrsimonbennett

is that someone managed to make it work?

100terres avatar Feb 25 '14 12:02 100terres

Any news on this? I'm working on a complex app which could benefit from this.

jbrooksuk avatar Mar 22 '14 14:03 jbrooksuk

+1

danielealbano avatar Mar 23 '14 14:03 danielealbano

Any news about 4.1 support?

jgrossi avatar Mar 25 '14 15:03 jgrossi

I don't have anything in the works as yet.

jasonlewis avatar Mar 26 '14 08:03 jasonlewis

Damn looks like a great package, definitely interested in a L 4.1 version

stevebauman avatar May 06 '14 14:05 stevebauman

Ditto!

gcphost avatar May 14 '14 20:05 gcphost

+1

dennisoderwald avatar May 16 '14 13:05 dennisoderwald

This gets round the updated Router dependencies.

src/JasonLewis/EnhancedRouter/EnhancedRouterServiceProvider.php

<?php namespace JasonLewis\EnhancedRouter;

use Illuminate\Support\ServiceProvider;

class EnhancedRouterServiceProvider extends ServiceProvider {

        /**
         * Indicates if loading of the provider is deferred.
         *
         * @var bool
         */
        protected $defer = false;

        /**
         * Register the service provider.
         *
         * @return void
         */
        public function register()
        {

                $this->app['router'] = $this->app->share(function($app)
                {
                        $router = new Router($this->app->make('Illuminate\Events\Dispatcher'), $app);

                        // If the current application environment is "testing", we will disable the
                        // routing filters, since they can be tested independently of the routes
                        // and just get in the way of our typical controller testing concerns.
                        if ($app['env'] == 'testing')
                        {
                                $router->disableFilters();
                        }

                        return $router;
                });
        }

        /**
         * Get the services provided by the provider.
         *
         * @return array
         */
        public function provides()
        {
                return array('router');
        }

}

anthonysterling avatar May 22 '14 10:05 anthonysterling