Skip to content

Commit 05c9983

Browse files
committed
Merge branch 'master' of github.com:BinarCode/laravel-restify into 3.x
2 parents 667a14d + 578fcff commit 05c9983

28 files changed

+472
-130
lines changed

.github/workflows/tests.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
tests:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
php: [7.4]
17+
laravel: [^6.0, ^7.0]
18+
19+
name: P${{ matrix.php }} - L${{ matrix.laravel }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Cache dependencies
26+
uses: actions/cache@v1
27+
with:
28+
path: ~/.composer/cache/files
29+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
30+
31+
- name: Setup PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php }}
35+
extensions: dom, curl, libxml, mbstring, zip
36+
coverage: none
37+
38+
- name: Install dependencies
39+
run: composer require "illuminate/contracts=${{ matrix.laravel }}" --prefer-dist --no-interaction --no-suggest
40+
41+
- name: Execute tests
42+
run: vendor/bin/phpunit --verbose

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ html
77
output
88
docs/node_modules
99
docs/.vuepress/dist
10+
.phpunit.result.cache
1011

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
<p align="center"><img src="https://binaryk.github.io/laravel-restify/assets/img/logo.png"></p>
1+
<p align="center"><img src="https://BinarCode.github.io/laravel-restify/assets/img/logo.png"></p>
22

33
<p align="center">
4-
<a href="https://travis-ci.org/binaryk/laravel-restify"><img src="https://travis-ci.org/binaryk/laravel-restify.svg" alt="Build Status"></a>
4+
<a href="https://github.com/BinarCode/laravel-restify/actions"><img src="https://github.com/BinarCode/laravel-restify/workflows/tests/badge.svg" alt="Build Status"></a>
55
<a href="https://packagist.org/packages/binaryk/laravel-restify"><img src="https://poser.pugx.org/binaryk/laravel-restify/d/total.svg" alt="Total Downloads"></a>
66
<a href="https://packagist.org/packages/binaryk/laravel-restify"><img src="https://poser.pugx.org/binaryk/laravel-restify/v/stable.svg" alt="Latest Stable Version"></a>
7-
<a href="https://scrutinizer-ci.com/g/binaryk/laravel-restify"><img src="https://img.shields.io/scrutinizer/coverage/g/binaryk/laravel-restify.svg" alt="Test Coverage"></a>
8-
<a href="https://scrutinizer-ci.com/g/binaryk/laravel-restify"><img src="https://img.shields.io/scrutinizer/g/binaryk/laravel-restify.svg" alt="Quality"></a>
7+
<a href="https://scrutinizer-ci.com/g/BinarCode/laravel-restify"><img src="https://img.shields.io/scrutinizer/g/BinarCode/laravel-restify.svg" alt="Quality"></a>
98
<a href="https://packagist.org/packages/binaryk/laravel-restify"><img src="https://poser.pugx.org/binaryk/laravel-restify/license.svg" alt="License"></a>
109
</p>
1110

12-
This package will generate the API resources "CRUD" for you. By using Laravel buit in Policies and Eloquent Resource API the implementation become a pleasure.
13-
14-
The response is made according with [JSON:API](https://jsonapi.org/format/) standard.
11+
The first fully customizable Laravel [JSON:API](https://jsonapi.org) builder. "CRUD" and protect your resources with 0 (zero) extra line of code.
1512

1613
## Installation
1714

@@ -46,7 +43,7 @@ php artisan restify:repository Post
4643

4744
## Usage
4845

49-
See the [official documentation](https://binaryk.github.io/laravel-restify/).
46+
See the [official documentation](https://binarcode.github.io/laravel-restify/docs/2.0/).
5047

5148
### Testing
5249

composer.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
"name": "binaryk/laravel-restify",
33
"description": "Laravel REST API helpers",
44
"keywords": [
5-
"binaryk",
5+
"crud",
6+
"rest",
7+
"api",
68
"laravel-restify"
79
],
8-
"homepage": "https://github.com/binaryk/laravel-restify",
10+
"homepage": "https://github.com/BinarCode/laravel-restify",
911
"license": "MIT",
1012
"type": "library",
1113
"authors": [
@@ -16,13 +18,14 @@
1618
}
1719
],
1820
"require": {
19-
"php": "^7.1",
20-
"illuminate/support": "^5.8|^6.0"
21+
"php": "^7.4",
22+
"ext-json": "*",
23+
"illuminate/support": "^6.0|^7.0"
2124
},
2225
"require-dev": {
2326
"mockery/mockery": "^1.3",
24-
"orchestra/testbench": "3.8.*",
25-
"phpunit/phpunit": "^7.0"
27+
"orchestra/testbench": "^4.0|^5.0",
28+
"phpunit/phpunit": "^8.0"
2629
},
2730
"autoload": {
2831
"psr-4": {

docs/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,9 +1153,9 @@ accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7:
11531153
negotiator "0.6.2"
11541154

11551155
acorn@^6.2.1:
1156-
version "6.4.0"
1157-
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784"
1158-
integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==
1156+
version "6.4.1"
1157+
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474"
1158+
integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==
11591159

11601160
agentkeepalive@^2.2.0:
11611161
version "2.2.0"

phpunit.xml.dist

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
</exclude>
2323
</whitelist>
2424
</filter>
25-
<logging>
26-
<log type="tap" target="build/report.tap"/>
27-
<log type="junit" target="build/report.junit.xml"/>
28-
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
29-
<log type="coverage-text" target="build/coverage.txt"/>
30-
<log type="coverage-clover" target="build/logs/clover.xml"/>
31-
</logging>
25+
<!-- <logging>-->
26+
<!-- <log type="tap" target="build/report.tap"/>-->
27+
<!-- <log type="junit" target="build/report.junit.xml"/>-->
28+
<!-- <log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>-->
29+
<!-- <log type="coverage-text" target="build/coverage.txt"/>-->
30+
<!-- <log type="coverage-clover" target="build/logs/clover.xml"/>-->
31+
<!-- </logging>-->
3232
<php>
3333
<env name="APP_KEY" value="base64:la8jDWcqBHfGO6PR+OA9FAZqdi0XQKuhnzqc5tUATZs="/>
3434
<env name="MAIL_DRIVER" value="log"/>

routes/api.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
Route::post('/{repository}', 'RepositoryStoreController@handle');
55
Route::get('/{repository}/{repositoryId}', 'RepositoryShowController@handle');
66
Route::patch('/{repository}/{repositoryId}', 'RepositoryUpdateController@handle');
7+
Route::put('/{repository}/{repositoryId}', 'RepositoryUpdateController@handle');
78
Route::delete('/{repository}/{repositoryId}', 'RepositoryDestroyController@handle');

src/Commands/Refresh.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace Binaryk\LaravelRestify\Commands;
4+
5+
use Illuminate\Console\Command;
6+
7+
class Refresh extends Command
8+
{
9+
/**
10+
* The name and signature of the console command.
11+
*
12+
* @var string
13+
*/
14+
protected $signature = 'restify:refresh';
15+
16+
/**
17+
* The console command description.
18+
*
19+
* @var string
20+
*/
21+
protected $description = 'Clear all laravel caches (routes, cache, config and view)';
22+
23+
/**
24+
* Execute the console command.
25+
*
26+
* @return mixed
27+
*/
28+
public function handle()
29+
{
30+
$this->call('route:cache');
31+
$this->call('cache:clear');
32+
$this->call('config:cache');
33+
$this->call('view:clear');
34+
$this->call('route:clear');
35+
$this->call('optimize');
36+
}
37+
}

src/Commands/SetupCommand.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
namespace Binaryk\LaravelRestify\Commands;
44

55
use Illuminate\Console\Command;
6-
use Illuminate\Console\DetectsApplicationNamespace;
76
use Illuminate\Support\Str;
87

98
class SetupCommand extends Command
109
{
11-
use DetectsApplicationNamespace;
12-
1310
/**
1411
* The name and signature of the console command.
1512
*
@@ -57,7 +54,7 @@ public function handle()
5754
*/
5855
protected function registerRestifyServiceProvider()
5956
{
60-
$namespace = Str::replaceLast('\\', '', $this->getAppNamespace());
57+
$namespace = Str::replaceLast('\\', '', $this->laravel->getNamespace());
6158

6259
file_put_contents(config_path('app.php'), str_replace(
6360
"{$namespace}\\Providers\EventServiceProvider::class,".PHP_EOL,
@@ -73,7 +70,7 @@ protected function registerRestifyServiceProvider()
7370
*/
7471
protected function setAppNamespace()
7572
{
76-
$namespace = $this->getAppNamespace();
73+
$namespace = $this->laravel->getNamespace();
7774

7875
$this->setAppNamespaceOn(app_path('Restify/User.php'), $namespace);
7976
$this->setAppNamespaceOn(app_path('Providers/RestifyServiceProvider.php'), $namespace);

0 commit comments

Comments
 (0)