Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: asvae/laravel-api-tester
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.0.9
Choose a base ref
...
head repository: asvae/laravel-api-tester
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 8 commits
  • 6 files changed
  • 6 contributors

Commits on Jul 6, 2018

  1. Copy the full SHA
    7fd5d86 View commit details

Commits on Nov 25, 2019

  1. Using _file instead of file for correct routing (#44)

    Using Str::contains instead of deprecated str_contains
    kadriev-ilyas authored and asvae committed Nov 25, 2019
    Copy the full SHA
    f6462a7 View commit details

Commits on Sep 19, 2020

  1. fix laravel 7+ issues (#48)

    credit to @safiullahsarhandi for comming up with fix , im simply implimenting it into base
    teddy9110 authored Sep 19, 2020
    Copy the full SHA
    54a8e2d View commit details

Commits on Jun 18, 2021

  1. Copy the full SHA
    8f6d1f7 View commit details
  2. Fix implode

    zlokomatic authored Jun 18, 2021
    Copy the full SHA
    65a140f View commit details

Commits on Jul 1, 2022

  1. Copy the full SHA
    7f52ebb View commit details
  2. Merge pull request #56 from caloskao/patch-for-issue-51

    Fix issue #51 (Route name conflict)
    greabock authored Jul 1, 2022
    Copy the full SHA
    3582480 View commit details

Commits on Jul 25, 2022

  1. Merge pull request #53 from zlokomatic/patch-1

    Fix Errors
    greabock authored Jul 25, 2022
    Copy the full SHA
    7883a4e View commit details
Showing with 16 additions and 6 deletions.
  1. BIN .DS_Store
  2. +7 −0 composer.json
  3. +2 −2 resources/views/api-tester.blade.php
  4. +5 −2 src/Entities/RouteInfo.php
  5. +1 −1 src/Http/routes.php
  6. +1 −1 src/Storages/JsonStorage.php
Binary file added .DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -30,5 +30,12 @@
"psr-4": {
"Asvae\\ApiTester\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Asvae\\ApiTester\\ServiceProvider"
]
}
}
}
4 changes: 2 additions & 2 deletions resources/views/api-tester.blade.php
Original file line number Diff line number Diff line change
@@ -9,13 +9,13 @@
<meta name="firebaseToken" content="{{ $firebaseToken }}">
<meta name="firebaseSource" content="{{ $firebaseSource }}">
<base href="{{ url(config('api-tester.route')).'/' }}">
<link media="all" type="text/css" rel="stylesheet" href="{{ route('api-tester.file', ['file' => 'api-tester.css']) }}">
<link media="all" type="text/css" rel="stylesheet" href="{{ route('api-tester.file', ['_file' => 'api-tester.css']) }}">
<title>Laravel api tester</title>
</head>
<body>
<div id="api-tester">
<vm-api-tester-main></vm-api-tester-main>
</div>
<script src="{{ route('api-tester.file', ['file' => 'api-tester.js']) }}"></script>
<script src="{{ route('api-tester.file', ['_file' => 'api-tester.js']) }}"></script>
</body>
</html>
7 changes: 5 additions & 2 deletions src/Entities/RouteInfo.php
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Foundation\Http\FormRequest;
use JsonSerializable;
use Illuminate\Support\Str;

/**
* Frontend ready route
@@ -134,7 +135,9 @@ protected function extractFormRequest()

// TODO Write the reasoning behind following lines.
try {
$class = $parameter->getClass();
$class = $parameter->getType() && !$parameter->getType()->isBuiltin()
? new \ReflectionClass($parameter->getType()->getName())
: null;
} catch (\ReflectionException $e) {
break;
}
@@ -187,7 +190,7 @@ protected function getActionReflection()
$uses = $this->route->getAction()['uses'];

// Если это строка и она содержит @, значит мы имем дело с методом контроллера.
if (is_string($uses) && str_contains($uses, '@')) {
if (is_string($uses) && Str::contains($uses, '@')) {
list($controller, $action) = explode('@', $uses);

// Если нет контроллера.
2 changes: 1 addition & 1 deletion src/Http/routes.php
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
$filePattern = '^([a-z0-9_\-\.]+)$';

$router->get('fonts/{_file}', [
'as' => 'image',
'as' => 'font',
'uses' => 'AssetsController@font'
])->where('_file', $filePattern);

2 changes: 1 addition & 1 deletion src/Storages/JsonStorage.php
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@ public function __construct(Filesystem $files, RequestCollection $collection, $p
$this->collection = $collection;
$path = explode('/', $path);
$this->filename = array_pop($path);
$this->path = implode($path, '/');
$this->path = implode('/', $path);
}

/**