Test your routes without hassle

Overview

Laravel Api Tester

Unit tests PHP version

Interface

Live demo

Try it out: laravel-api-tester.asva.by

Docs

Those are short and easy to read. Take a look.

Installation

Require this package with composer:

composer require asvae/laravel-api-tester

After updating composer, add the ServiceProvider to the providers array in config/app.php

Asvae\ApiTester\ServiceProvider::class,

That's it. Go to [your site]/api-tester and start testing routes. It works for Laravel 5.1+.

Config

By default, the package is bound to APP_DEBUG .env value. But you can easily override it. Just publish config:

php artisan vendor:publish --provider="Asvae\ApiTester\ServiceProvider"

And edit config/api-tester.php as you please.

Features

  • Display routes for your application.
  • Prepare and save requests.
  • Collaborate with your team using firebase.
  • Live search for everything.
  • Filter out routes in config.
  • CSRF token is handled for you.
  • Fill request in JSON editor.
  • Preview response depending on type (html or json).
  • Clean and intuitive interface.
  • Lightweight and no dependencies (except on laravel).

Powered By

Feedback

Don't hesitate to raise an issue if something doesn't work or you have a feature request. You're welcome to.

Authors

  • greabock — backends. All of em.
  • asvae — frontends. You guessed it.

Tests

Check badges on the top for details.

Licence

MIT

Comments
  • "Class web does not exist" after clean installation

    @asvae

    I caught this error just after a clean installation of the package :

    ReflectionException (-1)
    Class web does not exist
    

    Is it known?

    BTW, I use dingo/api

    bug 
    opened by welcoMattic 13
  • Place the response block just under the request block

    Place the response block just under the request block

    Hi!

    I've lots of annotation on my routes, and my response block is placed after the end of the route info block.

    It will be nice if you can move it juste under the request block ;)

    enhancement 
    opened by welcoMattic 8
  • Error on Laravel 5.1

    Error on Laravel 5.1

    I just pull the last 2.0.0-alpha from a composer update, and I caught this error on Laravel 5.1.41 :

    [BadMethodCallException]
      Method resourceParameters does not exist.
    

    This is due to a non-existant method on Route facade on 5.1 :

    In asvae/laravel-api-tester/src/Http/routes.php line 3 :

    Route::resourceParameters(['requests' => 'request']);
    

    Method resourceParameters doesn't exist

    bug 
    opened by welcoMattic 5
  • Check List For 2.0.0-beta

    Check List For 2.0.0-beta

    sould be

    • [x] Tidy interface
    • [x] FireBase streaming
    • [x] Better compatibility with Dingo
    • [x] Documentation

    may be

    • [ ] ~~Lumen support~~
    • [ ] ~~DataBase Storage Driver~~
    enhancement 
    opened by greabock 4
  • Unresolvable dependency and BindingResolutionException on Laravel 5.4

    Unresolvable dependency and BindingResolutionException on Laravel 5.4

    After installing package on laravel 5.4 php artisan route:list fails:

    $ php artisan   route:list
    
      [Illuminate\Contracts\Container\BindingResolutionException]
      Unresolvable dependency resolving [Parameter #2 [ <required> $path ]] in class Asvae\ApiTester\Storages\JsonStorage
    

    My environment: Windows 7 php 7.1 Laravel 5.4

    bug 
    opened by gandra 3
  • Error: no  found url

    Error: no found url

    when i call any api after install and publish package it give me below error.

    Error:

    Not Found The requested URL /api/v1.0/industries was not found on this server. Apache/2.4.7 (Ubuntu) Server at siteproofs.net Port 80

    so please help me. is there any settings or base url i miss it.

    opened by patelchirag123 3
  • Do not use aliases in the package

    Do not use aliases in the package

    Do not use aliases in the package. This forces the user to include aliases in the app configuration, even if he does not use them in own application.

    See: src/Http/routes.php

    enhancement 
    opened by ghost 3
  • Is it possible to install api-tester only in dev?

    Is it possible to install api-tester only in dev?

    I don't want api-tester will be installed in production, even if it will not booted (due to APP_DEBUG value). I just want to install it on local environment, so it will be possible to install it with composer require asvae/laravel-api-tester --dev, and register the service provider through AppServiceProvider with:

        /**
         * Register any application services.
         *
         * @return void
         */
        public function register()
        {
            if ($this->app->environment('local')) {
                $this->app->register(\Asvae\ApiTester\ServiceProvider::class);
            }
        }
    
    enhancement 
    opened by welcoMattic 3
  • Not possible to publish config file

    Not possible to publish config file

    Hi, I just install your package, and I can't publish the config file.

    Can't locate path: </Users/welcomattic/workspace/CoStreamMQ/vendor/asvae/laravel-api-tester/src/config/api-tester.php>
    
    bug 
    opened by welcoMattic 3
  • laravel-api-tester hang up if response status code 204

    laravel-api-tester hang up if response status code 204

    class SomeController
    {
        public function test()
        {
            return response('', 204);
    
            // or with dingo response helper
            // return $this->response->noContent();
        }
    }
    
    Route::get('test', 'SomeController@test');
    

    Postman works properly when get to /test, but laravel-api-tester hang up.

    bug 
    opened by melihovv 1
  • Fix for broken config file publication

    Fix for broken config file publication

    Fixed a broken link: to enable publication of the configuration (config/api-tester.php) through the existing php artisan vendor:publish --provider="Asvae\ApiTester\ServiceProvider" artisan command.

    opened by nyedidikeke 1
  • Template for post/put request

    Template for post/put request

    Hi, while working with team mate, I was asked to give a template for each POST/PUT request, for example if i have a POST route /user, api tester should show something like

    {
      "first_name":"string",
      "last_name":"string"
    }
    

    What i mean, is something that allows another developper to know what payload he should send

    Thanks

    opened by khlilturki97 0
  • php artisan route:cache throws LogicException

    php artisan route:cache throws LogicException

    There is a problem in routes.php, fonts route alias must not be named image. Change to font instead.

    Output:

    Route cache cleared!
    
       LogicException 
    
      Unable to prepare route [api-tester/assets/img/{_file}] for serialization. Another route has already been assigned name [api-tester.image].
    
      at vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php:212
        208â–•             $route->name($name = $this->generateRouteName());
        209â–• 
        210â–•             $this->add($route);
        211â–•         } elseif (! is_null($symfonyRoutes->get($name))) {
      ➜ 212▕             throw new LogicException("Unable to prepare route [{$route->uri}] for serialization. Another route has already been assigned name [{$name}].");
        213â–•         }
        214â–• 
        215â–•         $symfonyRoutes->add($route->getName(), $route->toSymfonyRoute());
        216â–• 
    
          +19 vendor frames 
      20  artisan:37
          Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    
       Whoops\Exception\ErrorException
    opened by ldanielduarte 1
  • Error while running `php artisan route:list`

    Error while running `php artisan route:list`

    This is a follow up issue after fixing the route:cache problem mentioned in #42 If you fix that, please fix this also.

    How to reproduce:

    • Follow the solution mentioned in #42
    • Run php artisan route:list

    Error:

    Array to string conversion
     
      at vendor/asvae/laravel-api-tester/src/Storages/JsonStorage.php:57
        53|         $this->files = $files;
        54|         $this->collection = $collection;
        55|         $path = explode('/', $path);
        56|         $this->filename = array_pop($path);
      > 57|         $this->path = implode('/'.$path);
        58|     }
        59|
        60|     /**
        61|      * Return path to folder that can contain file.
    
          +32 vendor frames
      33  [internal]:0
          Illuminate\Foundation\Console\RouteListCommand::Illuminate\Foundation\Console\{closure}(Object(Illuminate\Routing\Route))
    
          +17 vendor frames
      51  artisan:37
          Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    

    Solution: It's really just silly mistake though, pardon me for all the drama above, just replace . with , in src/Storages/JsonStorage.php:

    public function __construct(Filesystem $files, RequestCollection $collection, $path)
        {
            $this->files = $files;
            $this->collection = $collection;
            $path = explode('/', $path);
            $this->filename = array_pop($path);
            // Here was the mistake:
            $this->path = implode('/', $path);
        }
    

    Also raising a PR for this. Quick fix.

    opened by craftisan 5
  • Fix for route:cache

    Fix for route:cache

    The hack that is applied to stop route caching is not just hacky, it very hacky and way too inelegant. There is much simpler solution which I believe should have an been obvious choice. Instead of blocking the caching of routes by doing this:

    $router->any('* routes should not be cached',[
        'as' => 'routes-should not be cached',
        'uses' =>  function () { return 'Api-tester routes-should not be cached';},
    ]);
    

    Just simply register the route conditionally in RouteServiceProvider according to APP_DEBUG value, like so:

        public function map(Router $router)
        {
            if(config('api-tester.enabled')) {
                $router->group([
                    'as' => 'api-tester.',
                    'prefix' => config('api-tester.route'),
                    'namespace' => $this->getNamespace(),
                    'middleware' => $this->getMiddleware(),
                ], function () {
                    $this->requireRoutes();
                });
            }
        }
    
    opened by craftisan 0
  • Unable to pass Passport Bearer Token In Header

    Unable to pass Passport Bearer Token In Header

    Hello, Hope all are doing well as passport accessToken string length is too long and api tester headers value field in input im unable to pass bearer token any recommendation should be appreciated

    bug 
    opened by safiullahsarhandi 0
Releases(2.0.11)
Owner
Yauheni Prakopchyk
Multifaceted ̷e̷y̷e̷s̷ developer with focus on code quality.
Yauheni Prakopchyk
Ray server is a beautiful, lightweight php app build on Laravel that helps you debug your app. It runs without installation on multiple platforms.

RayServer is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app. It runs without installation on multiple platforms.

Pavel Buchnev 310 Jan 2, 2023
Restart a CLI process without loading the xdebug extension.

composer/xdebug-handler Restart a CLI process without loading the Xdebug extension, unless xdebug.mode=off. Originally written as part of composer/com

Composer 2.4k Dec 30, 2022
Php Debugger to run in terminal to debug your code easily.

What is Dephpugger? Dephpugger (read depugger) is an open source lib to make a debug in php direct in terminal, without necessary configure an IDE. Th

Renato Cassino 190 Dec 3, 2022
Clockwork - php dev tools in your browser - server-side component

Clockwork is a development tool for PHP available right in your browser. Clockwork gives you an insight into your application runtime - including requ

its 4.8k Dec 29, 2022
An artisan command to tail your application logs

Easily tail your logs This package offers an artisan command to tail the application log. It supports daily and single logs on your local machine. To

Spatie 677 Dec 29, 2022
Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps debugging your app.

A server for debugging more than just Laravel applications. Buggregator is a beautiful, lightweight web server built on Laravel and VueJs that helps d

Buggregator 311 Jan 4, 2023
Php Debugger to run in terminal to debug your code easily.

What is Dephpugger? Dephpugger (read depugger) is an open source library that allows a developer to debug in php direct in terminal, without necessary

Renato Cassino 190 Dec 3, 2022
A simple Craft module, inspired by Mildly Geeky's "Kint", to debug Twig within your browser

A simple Craft module, inspired by Mildly Geeky's "Kint", to debug Twig within your browser

TrendyMinds 4 Feb 2, 2022
QaraTMS is open source test case, test suites, test plans and test runs management tool.

QaraTMS - Open Source Test Management System QaraTMS is open source test management software for managing test suites, test cases, test plans, test ru

Alex H 29 Dec 22, 2022
:computer: :octocat: A hackathon/MVP boilerplate for laravel web applications. Start your hackathons without hassle.

Laravel Hackathon Starter - SUSUMU 進 If you have attended any hackathons in the past, then you know how much time it takes to get a project started: d

Prosper Otemuyiwa 1.6k Dec 17, 2022
A Laravel Wrapper for the CoinDCX API. Now easily connect and consume the CoinDCX Public API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the CoinDCX API and allows you to easily communicate with it. Important Note This package is in early deve

Moinuddin S. Khaja 2 Feb 16, 2022
A Laravel Wrapper for the Binance API. Now easily connect and consume the Binance Public & Private API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the Binance API and allows you to easily communicate with it. Important Note This package is in early deve

Moinuddin S. Khaja 7 Dec 7, 2022
Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

Joan 9 Oct 10, 2022
CodeIgniter4 Attribute Routes. You can set Routes in Controllers as PHP8 Attributes.

CodeIgniter4 Attribute Routes This package generates a Routes File from the Attribute Routes in your Controllers. You can set routes in your Controlle

kenjis 13 Dec 27, 2022
Simple way to auto load modules without complicate definition of routes

Phalcon-autorouter Version 2.0 Example full application with various libraries included in this example Change log Structure have been changed and upd

Kamil 28 Dec 27, 2022
salah eddine bendyab 18 Aug 17, 2021
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

This is a port of the VCR Ruby library to PHP. Record your test suite's HTTP interactions and replay them during future test runs for fast, determinis

php-vcr 1.1k Dec 23, 2022
Quickly and easily preview and test your Magento 2 order confirmation page, without hacks or spending time placing new order each time

Preview Order Confirmation Page for Magento 2 For Magento 2.0.x, 2.1.x, 2.2.x and 2.3.x Styling and testing Magento's order confirmation page can be a

MagePal :: Magento Extensions 71 Aug 12, 2022
Hassle-free Laravel + Inertiajs + Svelte + TailwindCSS Boilerplate

Hassle-free Laravel + Inertiajs + Svelte + TailwindCSS Boilerplate

Michael S 46 Dec 31, 2022
This package provides new helper functions that take care of handling all the translation hassle and do it for you.

Laravel Translate Message ?? This package provides new helper functions that take care of handling all the translation hassle and do it for you. Insta

Basel Rabia 17 Feb 8, 2022