Giter Club home page Giter Club logo

laravel-routes-publisher's Issues

Step 2 command doesn't work for Laravel 5.2

protected $commands = [
    '\Themsaid\RoutesPublisher\RoutesPublisherCommand::class'
];

However, the following does:

protected $commands = [
    'Themsaid\RoutesPublisher\RoutesPublisherCommand'
];

Shall I create a PR for the README.md with this caveat for Laravel 5.2?

wrong route folder address

the below warning will shown when i want to convert my controller to routes .
i'm using laravel 5.3 .
should i install this package on my oldest laravel project ?
file_get_contents(D:\projects\codedesign\app\Http/routes.php): failed to open stream: No such file or directory

Route::any not converted

As the title says, functions in my controller that start with any do not get put into the generated routes file using Route::any()

Doesn't parsed method parameters with strict type

Example controller method:

public function getEdit( int $id ) {
   # ...
}

Parsing result:

Route::get('access/users/edit', 'Access\UsersController@getEdit');

When it should be:

Route::get('access/users/edit/{id}', 'Access\UsersController@getEdit');

Route namespace looks at wrong class path

It seems that the command does not work correctly if I have a group with a namespace. For example:

Route::group(['prefix' => 'acme', 'namespace' => 'Acme'], function () {
    Route::controller('abc', 'AbcController');
}

This throws the error:

  [ReflectionException]                                 
  Class App\Http\Controllers\AbcController does not exist

However, it should be looking at App\Http\Controllers\Acme\AbcController, which does exist. If I change my routes to:

Route::group(['prefix' => 'acme', 'namespace' => 'Acme'], function () {
    Route::controller('abc', 'Acme\AbcController');
}

then it works, so I have a workaround, but this means changing all my routes to include the namespace and then presumably fixing them after running the command.

php7 reflectionmethod

is the ReflectionParameter::hasType only available on php7? maybe you should hint that in describion

Erorr

E:\OSPanel\domains\laravelCurs.md>php artisan themsaid:publishRoutes

ErrorException : file_get_contents(E:\OSPanel\domains\laravelCurs.md\app\Http/routes.php): failed to open stream: No such file or directory

at E:\OSPanel\domains\laravelCurs.md\vendor\themsaid\laravel-routes-publisher\src\RoutesPublisherCommand.php:53
49| * @return mixed
50| */
51| public function handle()
52| {

53| $exactFileContent = file_get_contents(app_path('Http/routes.php'));
54|
55| $preparedFileContent = $this->prepareFileContent($exactFileContent);
56|
57| $output = '';

Exception trace:

1 file_get_contents("E:\OSPanel\domains\laravelCurs.md\app\Http/routes.php")
E:\OSPanel\domains\laravelCurs.md\vendor\themsaid\laravel-routes-publisher\src\RoutesPublisherCommand.php:53

2 Themsaid\RoutesPublisher\RoutesPublisherCommand::handle()
E:\OSPanel\domains\laravelCurs.md\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29

Please use the argument -v to see more details.

E:\OSPanel\domains\laravelCurs.md>

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.