Test your laravel routes. Routes and requests will be loaded automatically. This package doesn't need migration.
Install using composer:
composer require mhidea/laravel-tester
Add serviceproviver to 'providers' in config/app.php:
Mhidea\laraveltester\LaravelTesterServiceProvider::class
Publish config file to config/laravel-tester.php:
php artisan vendor:publish --tag=laraveltester
Add your headers to laravel-tester.config after you publish it. If you put 'testertoken' in header value, it will take the value you give it once and will be saved for next request. It is useful for authentication. For example to add bearer token header you need to have:
"Authorization" => 'Bearer testertoken'
Now 'testertoken' will be replaced with token you give to input and will be saved for next requests.
Currently you can have four request parameter types:
- required url parameter: is loaded from route path definition. e.g. id
Route::post("mail/{id}", "Controller@readmail");
- optional url parameter: is loaded from route path definition. e.g. id
Route::get("mail/{id?}", "Controller@showmail");
- query parameter: is loaded from controller doc. Follow this pattern. Type is optional.
For example you will get username in request pane under queryParam.
* @queryParam parameter-name parameter-type parameter-description
* @queryParam username string name of the user to show points
- body parameter: is loaded from controller doc. Follow this pattern. Type is optional.
For example you will get id in request pane under bodyParam.
* @bodyParam name type description
Object params are allowed. If you need to have objects, don't forget to mention the parameter with type 'object' in docs.* @bodyParam id int current user_id to get info
You can find more about documentation here.* @bodyParam friend object friend to follow * @bodyParam friend.id int id of friend