Browse Source

добавлено апи

dedomorozoff 3 years ago
parent
commit
73c14be4bb
5 changed files with 87 additions and 3 deletions
  1. 1 0
      .idea/php.xml
  2. 1 0
      .idea/stolovaya.iml
  3. 2 1
      composer.json
  4. 69 2
      composer.lock
  5. 14 0
      routes/api.php

+ 1 - 0
.idea/php.xml

@@ -121,6 +121,7 @@
       <path value="$PROJECT_DIR$/vendor/doctrine/dbal" />
       <path value="$PROJECT_DIR$/vendor/doctrine/event-manager" />
       <path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
+      <path value="$PROJECT_DIR$/vendor/tiagomichaelsousa/laravelresources" />
     </include_path>
   </component>
   <component name="PhpProjectSharedConfiguration" php_language_level="8.0" />

+ 1 - 0
.idea/stolovaya.iml

@@ -128,6 +128,7 @@
       <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/dbal" />
       <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/event-manager" />
       <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" />
+      <excludeFolder url="file://$MODULE_DIR$/vendor/tiagomichaelsousa/laravelresources" />
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />

+ 2 - 1
composer.json

@@ -19,7 +19,8 @@
         "laravel/sail": "^1.0.1",
         "mockery/mockery": "^1.4.2",
         "nunomaduro/collision": "^5.0",
-        "phpunit/phpunit": "^9.3.3"
+        "phpunit/phpunit": "^9.3.3",
+        "tiagomichaelsousa/laravelresources": "^2.0"
     },
     "autoload": {
         "psr-4": {

+ 69 - 2
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "77b9a530872a1677943046530ccec32f",
+    "content-hash": "a913bf1b1a50e64ac6a4c9ddcfea1af9",
     "packages": [
         {
             "name": "asm89/stack-cors",
@@ -8426,6 +8426,73 @@
                 }
             ],
             "time": "2021-07-28T10:34:58+00:00"
+        },
+        {
+            "name": "tiagomichaelsousa/laravelresources",
+            "version": "v2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/tiagomichaelsousa/LaravelResources.git",
+                "reference": "965c4b76c88cc0bbec9652d59126d3fc35f93cf0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/tiagomichaelsousa/LaravelResources/zipball/965c4b76c88cc0bbec9652d59126d3fc35f93cf0",
+                "reference": "965c4b76c88cc0bbec9652d59126d3fc35f93cf0",
+                "shasum": ""
+            },
+            "require": {
+                "illuminate/support": "^7.0|^8.0"
+            },
+            "require-dev": {
+                "mockery/mockery": "^1.3.1",
+                "orchestra/testbench": "^5.0|^6.0",
+                "phpunit/phpunit": "^8.5|^9.0",
+                "sempro/phpunit-pretty-print": "^1.0"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "tiagomichaelsousa\\LaravelResources\\LaravelResourcesServiceProvider"
+                    ],
+                    "aliases": {
+                        "LaravelResources": "tiagomichaelsousa\\LaravelResources\\Facades\\LaravelResources"
+                    }
+                }
+            },
+            "autoload": {
+                "files": [
+                    "src/Helpers/helpers.php"
+                ],
+                "psr-4": {
+                    "tiagomichaelsousa\\LaravelResources\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "tiagomichaelsousa",
+                    "email": "tiagomichaelsousa@gmail.com",
+                    "homepage": "https://github.com/tiagomichaelsousa",
+                    "role": "Developer"
+                }
+            ],
+            "description": "Laravel Resources is a speed-up development package that allows you to create a boilerplate for Laravel apps with a default API structure.",
+            "homepage": "https://github.com/tiagomichaelsousa/laravelresources",
+            "keywords": [
+                "LaravelResources",
+                "laravel",
+                "laravel-resources"
+            ],
+            "support": {
+                "issues": "https://github.com/tiagomichaelsousa/LaravelResources/issues",
+                "source": "https://github.com/tiagomichaelsousa/LaravelResources/tree/v2.0"
+            },
+            "time": "2020-09-29T21:58:15+00:00"
         }
     ],
     "aliases": [],
@@ -8437,5 +8504,5 @@
         "php": "^8.0"
     },
     "platform-dev": [],
-    "plugin-api-version": "2.2.0"
+    "plugin-api-version": "2.1.0"
 }

+ 14 - 0
routes/api.php

@@ -1,5 +1,6 @@
 <?php
 
+use App\Http\Controllers\DishesControllerAPI;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Route;
 
@@ -17,3 +18,16 @@ use Illuminate\Support\Facades\Route;
 Route::middleware('auth:api')->get('/user', function (Request $request) {
     return $request->user();
 });
+/*
+|--------------------------------------------------------------------------
+| Dishes endpoints
+|--------------------------------------------------------------------------
+ */
+Route::name('dishes.')->prefix('dishes')->group(function () {
+    Route::get('/', [DishesControllerAPI::class, 'index'])->name('index');
+    Route::post('/', [DishesControllerAPI::class, 'store'])->name('create');
+    Route::get('/{dishes}', [DishesControllerAPI::class, 'show'])->name('show');
+    Route::patch('/{dishes}', [DishesControllerAPI::class, 'update'])->name('update');
+    Route::delete('/{dishes}', [DishesControllerAPI::class, 'destroy'])->name('destroy');
+});
+