Display your Laravel routes in the console, but make it pretty. ๐Ÿ˜Ž

Overview

Pretty Routes for Laravel

Latest Version on Packagist Total Downloads

Display your Laravel routes in the console, but make it pretty. ๐Ÿ˜Ž

Installation

You can install the package via composer:

composer require wulfheart/pretty_routes

Usage

php artisan route:pretty

or

php artisan route:pretty --except-path=horizon --method=POST --reverse
php artisan route:pretty --only-path=app --method=POST --reverse
php artisan route:pretty --only-name=app --method=POST 
php artisan route:pretty --only-name=app --method=POST --group=path --reverse-group
php artisan route:pretty --only-name=app,horizon,debugbar --except-path=foo,bar --group=name --reverse

Advanced Example

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Feel free to open an issue or a PR. Discussions are disabled right now as there shouldn't be too much need for discussion and it can happen in the issues.

Credits

License

The MIT License (MIT). Please see License File for more information.

Comments
  • -d --update-snapshots flag is needed for the phpunit tests to work

    -d --update-snapshots flag is needed for the phpunit tests to work

    Screenshot 2021-04-30 at 1 52 17 AM

    If a new contributor forks the project and runs the tests .. then it fails .. and it suggests adding -d --update-snapshots flag with the PHP unit command.. then tests works fine.

    but the problem is snapshots output file is modified and then it will be part of new PR. SO each new PR will have its own snapshot version.

    opened by bhushan 23
  • Change path grep syntax to match Laravel

    Change path grep syntax to match Laravel

    Taylor just informed me that Laravel recently got except-path and has had only-path for a while, so it would probably be worth deprecating the old syntax and changing this package's flags to match Laravel's:

    https://twitter.com/stauffermatt/status/1389245939106390019

    image

    Would you accept a PR to change the syntax and either drop the old syntax, or offer it as a deprecated fallback?

    enhancement good first issue 
    opened by mattstauffer 11
  • added github actions to check phpcsfixer and phpunit tests

    added github actions to check phpcsfixer and phpunit tests

    This PR will add 2 github actions

    1. To check if the PR is following .php_cs.dist rules if not then it will apply those changes with commit message Automatically applied php-cs-fixer changes.
    2. It checks if all tests are still passing when new PR is generated and also when pushed to master branch.
    opened by bhushan 10
  • Error after install package in Laravel 8

    Error after install package in Laravel 8

    ParseError
    syntax error, unexpected 'Package' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
    
    ::Composer\Autoload\includeFile
    E:\wamp64\www\AcodePlus\vendor\spatie\laravel-package-tools\src\PackageServiceProvider.php:14
    
    `<?php
    
     
    
    namespace Spatie\LaravelPackageTools;
    
     
    
    use Carbon\Carbon;
    
    use Illuminate\Support\Facades\View;
    
    use Illuminate\Support\ServiceProvider;
    
    use Illuminate\Support\Str;
    
    use ReflectionClass;
    
    use Spatie\LaravelPackageTools\Exceptions\InvalidPackage;
    
     
    
    abstract class PackageServiceProvider extends ServiceProvider
    
    {
    
        protected Package $package;   <-- error here (line 14)
     
    
        abstract public function configurePackage(Package $package): void;
    
     
    
        public function register()
    
        {
    
            $this->registeringPackage();
    
     
    
            $this->package = new Package();
    
     
    
            $this->package->setBasePath($this->getPackageBaseDir());
    
     
    
            $this->configurePackage($this->package);
    
     
    
            if (empty($this->package->name)) {
    
                throw InvalidPackage::nameIsRequired();
    
            }`
    
     
    
    opened by alowisiustri 9
  • Add option to see middlewares in pretty

    Add option to see middlewares in pretty

    Is your feature request related to a problem? Please describe. No

    Describe the solution you'd like It would be nice to have an option to see the middlewares for a route in pretty.

    Describe alternatives you've considered

    Additional context

    opened by LeonBuchner 6
  • Error when running php artisan route:pretty

    Error when running php artisan route:pretty

    When trying to run php artisan route:pretty, I get this error : ` ErrorException

    Undefined array key 0

    at vendor/laravel/framework/src/Illuminate/Routing/Router.php:1286 1282โ–• if ($method === 'middleware') { 1283โ–• return (new RouteRegistrar($this))->attribute($method, is_array($parameters[0]) ? $parameters[0] : $parameters); 1284โ–• } 1285โ–• โžœ 1286โ–• return (new RouteRegistrar($this))->attribute($method, $parameters[0]); 1287โ–• } 1288โ–• } 1289โ–•

      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    

    `

    My project use Laravel 8.5.9

    bug 
    opened by MaximeGratens 6
  • Install fails

    Install fails

    composer require wulfheart/pretty_routes:^0.3.0
    
    ./composer.json has been updated
    Running composer update wulfheart/pretty_routes
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Root composer.json requires wulfheart/pretty_routes 0.3.0 -> satisfiable by wulfheart/pretty_routes[0.3.0].
        - wulfheart/pretty_routes 0.3.0 requires illuminate/contracts ^8.0 -> found illuminate/contracts[v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
    
    
    Installation failed, reverting ./composer.json and ./composer.lock to their original content.
    
    opened by Sophist-UK 5
  • Add --except-path to config file

    Add --except-path to config file

    Just a thought here, maybe it'd nice to move the config inside the config file and let the user overwrite them if they explicitly put it in the command.

    enhancement 
    opened by s-patompong 5
  • Filtering for route names

    Filtering for route names

    What if we have a new custom flag which will show only the routes we want

    โ€”show=tickets

    it will show only routes which has tickets in it.

    If you think its good i can send you a PR.

    enhancement 
    opened by bhushan 5
  • str_repeat(): Argument #2 ($times) must be greater than or equal to 0

    str_repeat(): Argument #2 ($times) must be greater than or equal to 0

    โ””โ”€[$] <git:(pretty_routes*)> sail artisan route:pretty
      GET|HEAD / ..................................................... index
      GET|HEAD _debugbar/assets/javascript .............. debugbar.assets.js
      GET|HEAD _debugbar/assets/stylesheets ............ debugbar.assets.css
      DELETE   _debugbar/cache/{key}/{tags?} ......... debugbar.cache.delete
      GET|HEAD _debugbar/clockwork/{id} ................. debugbar.clockwork
      GET|HEAD _debugbar/open ......................... debugbar.openhandler
      GET|HEAD _debugbar/telescope/{id} ................. debugbar.telescope
      GET|HEAD api/user .................................................... 
    
       ValueError 
    
      str_repeat(): Argument #2 ($times) must be greater than or equal to 0
    
      at vendor/wulfheart/pretty_routes/src/Commands/PrettyRoutesCommand.php:161
        157โ–•             $method = $route["method"];
        158โ–•             $uri = $route["uri"];
        159โ–•             $name = $route["name"];
        160โ–• 
      โžœ 161โ–•             $spaces = str_repeat(' ', $maxMethod + 6 - strlen($method));
        162โ–• 
        163โ–•             $additionalSpace = ! is_null($name) ? 1 : 0;
        164โ–•             $dots = str_repeat('.', max($terminalWidth - strlen($method.$uri.$name) - strlen($spaces) - 14 - $additionalSpace, 0));
        165โ–• 
    
          +15 vendor frames 
      16  artisan:37
          Illuminate\Foundation\Console\Kernel::handle()
    
    

    do you have any idea why this happens / do you need more information about my route definitions for this problem to solve?

    thanks a lot !

    opened by thyseus 5
  • Not compatible with Laravel 7

    Not compatible with Laravel 7

    When I try to install it on my Laravel 7 project it shows this problem

    Problem 1 - Root composer.json requires wulfheart/pretty_routes ^0.3.0 -> satisfiable by wulfheart/pretty_routes[0.3.0]. - wulfheart/pretty_routes 0.3.0 requires illuminate/contracts ^8.0 -> found illuminate/contracts[v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.

    opened by MarkLester10 4
Releases(0.3.0)
Owner
Alex
Alex
Console - The Console component eases the creation of beautiful and testable command line interfaces.

Console Component The Console component eases the creation of beautiful and testable command line interfaces. Sponsor The Console component for Symfon

Symfony 9.4k Jan 7, 2023
Supercharge your Symfony console commands!

zenstruck/console-extra A modular set of features to reduce configuration boilerplate for your commands: /** * Creates a user in the database. * *

Kevin Bond 29 Nov 19, 2022
๐Ÿƒ In short, it's like Tailwind CSS, but for the PHP command-line applications.

Termwind Termwind allows you to build unique and beautiful PHP command-line applications, using the Tailwind CSS API. In short, it's like Tailwind CSS

Nuno Maduro 1.8k Dec 30, 2022
Simple but yet powerful library for running almost all artisan commands.

:artisan gui Simple but yet powerful library for running some artisan commands. Requirements Laravel 8.* php ^7.3 Installation Just install package: c

null 324 Dec 28, 2022
Customized loading โŒ› spinner for Laravel Artisan Console.

Laravel Console Spinner Laravel Console Spinner was created by Rahul Dey. It is just a custom Progress Bar inspired by icanhazstring/symfony-console-s

Rahul Dey 71 Oct 26, 2022
Laravel Console Toolkit

This Package provides some usefully console features like the attribute syntax for arguments and options, validation, auto ask and casting.

Tobi 29 Nov 29, 2022
The Hoa\Console library.

Hoa is a modular, extensible and structured set of PHP libraries. Moreover, Hoa aims at being a bridge between industrial and research worlds. Hoa\Con

Hoa 366 Dec 14, 2022
ReactPHP Shell, based on the Symfony Console component.

Pecan Event-driven, non-blocking shell for ReactPHP. Pecan (/pษชหˆkษ‘หn/) provides a non-blocking alternative to the shell provided in the Symfony Consol

Michael Crumm 43 Sep 4, 2022
๐Ÿค– GitHub Action to run symfony console commands.

Symfony Console GitHub Action Usage You can use it as a Github Action like this: # .github/workflows/lint.yml name: "Lint" on: pull_request: push

Nucleos 3 Oct 20, 2022
Console component from Zend Framework

zend-console Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-console. Zend\Console is a component to design and implement

Zend Framework 47 Mar 16, 2021
Simple and customizable console log output for CLI apps.

Console Pretty Print Simple and customizable console log output for CLI apps. Highlights Simple installation (Instalaรงรฃo simples) Very easy to customi

William Alvares 3 Aug 1, 2022
A package built for lumen that ports most of the make commands from laravel.

A package built for lumen that ports most of the make commands from laravel. For lumen v5.1, but will most likely work for 5.2 as well. I haven't tested. If you have requests, let me know, or do it yourself and make a pull request

Michael Bonds 22 Mar 8, 2022
Extendable Interactive Make Command for Laravel

Extendable Interactive Make Command for Laravel Make your life easier with interactive make command! Installation composer require hydreflab/laravel-m

Hydref Lab 37 Nov 29, 2022
I gues i tried to make a shell that's looks like a terminal in single php file

php-shell-gui Terms of service This tool can only be used for legal purposes. You take full responsibility for any actions performed using this. The o

Squar3 4 Aug 23, 2022
Backup your laravel database by a simple artisan command

Backup your laravel database by a simple artisan command This package will allow you to backup your laravel app database and you can also choose to se

Mohammed Omer 23 Feb 10, 2022
A powerful command line application framework for PHP. It's an extensible, flexible component, You can build your command-based application in seconds!

CLIFramework CLIFramework is a command-line application framework, for building flexiable, simple command-line applications. Commands and Subcommands

Yo-An Lin 428 Dec 13, 2022
Render the symfony profiler toolbar in your terminal.

sourceability/console-toolbar-bundle Render the symfony profiler toolbar in your terminal. Each panel links to the corresponding web profiler page.

null 49 Nov 8, 2022
๐Ÿ‘จ๐Ÿปโ€๐Ÿš€ A command-line tool that gives you the Alpine Day 2021 schedule in your timezone. ๐Ÿš€

Alpine Day Schedule a command-line tool that gives you the Alpine Day 2021 schedule in your timezone. ?? Quick start Requires PHP 7.4+ # First, instal

Nuno Maduro 11 Jun 10, 2021