Jelajahi Sumber

переделки

dedomorozoff 3 tahun lalu
induk
melakukan
d7da0e5195

+ 1 - 1
.env

@@ -10,7 +10,7 @@ LOG_LEVEL=debug
 DB_CONNECTION=sqlite
 DB_HOST=127.0.0.1
 DB_PORT=3306
-DB_DATABASE=C:\cygwin64\home\stolovaya-server\storage\db\base.db
+DB_DATABASE=C:\Users\User\PhpstormProjects\stolovaya-server\storage\db\base.db
 DB_USERNAME=root
 DB_PASSWORD=
 

+ 1 - 1
.idea/php.xml

@@ -123,7 +123,7 @@
       <path value="$PROJECT_DIR$/vendor/doctrine/deprecations" />
     </include_path>
   </component>
-  <component name="PhpProjectSharedConfiguration" php_language_level="7.4" />
+  <component name="PhpProjectSharedConfiguration" php_language_level="8.0" />
   <component name="PhpUnit">
     <phpunit_settings>
       <PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" />

+ 17 - 17
app/Admin/Controllers/DishesController.php

@@ -15,7 +15,7 @@ class DishesController extends AdminController
      *
      * @var string
      */
-    protected $title = 'Dishes';
+    protected $title = 'Меню';
 
     /**
      * Make a grid builder.
@@ -27,11 +27,11 @@ class DishesController extends AdminController
         $grid = new Grid(new Dishes());
 
         $grid->column('id', __('Id'));
-        $grid->column('name', __('Name'));
-        $grid->column('price', __('Price'));
-        $grid->column('weigh', __('Weigh'));
-        $grid->column('category_id', __('Category id'));
-        $grid->column('composition', __('Composition'));
+        $grid->column('name', __('Название'));
+        $grid->column('price', __('Цена'));
+        $grid->column('weigh', __('Вес'));
+        $grid->column('categories', __('Категория'));
+        $grid->column('composition', __('Описание'));
         $grid->column('created_at', __('Created at'))->hide();
         $grid->column('updated_at', __('Updated at'))->hide();
 
@@ -49,12 +49,12 @@ class DishesController extends AdminController
         $show = new Show(Dishes::findOrFail($id));
 
         $show->field('id', __('Id'));
-        $show->field('name', __('Name'));
-        $show->field('price', __('Price'));
-        $show->field('weigh', __('Weigh'));
-        $show->field('category_id', __('Category id'));
+        $show->field('name', __('Название'));
+        $show->field('price', __('Цена'));
+        $show->field('weigh', __('Вес'));
+        $show->field('categories', __('Категория'));
         $show->field('composition', __('Composition'));
-        $show->field('created_at', __('Created at'));
+        $show->field('created_at', __('Описание'));
         $show->field('updated_at', __('Updated at'));
 
         return $show;
@@ -69,12 +69,12 @@ class DishesController extends AdminController
     {
         $form = new Form(new Dishes());
 
-        $form->textarea('name', __('Name'));
-        $form->number('price', __('Price'));
-        $form->number('weigh', __('Weigh'));
-        $form->image('image');
-        $form->text('categories.name');
-        $form->textarea('composition', __('Composition'));
+        $form->textarea('name', __('Название'));
+        $form->number('price', __('Цена'));
+        $form->number('weigh', __('Вес'));
+        $form->image('image', __('Изображение'));
+        $form->text('categories', __('Категория'));
+        $form->textarea('composition', __('Описание'));
 
         return $form;
     }

+ 1 - 4
app/Models/Categories.php

@@ -9,8 +9,5 @@ class Categories extends Model
 {
     use HasFactory;
 
-    public function dishes()
-    {
-        return $this->belongsTo(Dishes::class);
-    }
+
 }

+ 1 - 4
app/Models/Dishes.php

@@ -9,8 +9,5 @@ class Dishes extends Model
 {
     use HasFactory;
 
-    public function categories()
-    {
-        return $this->hasOne(Categories::class);
-    }
+
 }

+ 2 - 2
config/filesystems.php

@@ -38,7 +38,7 @@ return [
         'public' => [
             'driver' => 'local',
             'root' => storage_path('app/public'),
-            'url' => env('APP_URL').'/storage',
+            'url' => env('APP_URL') . '/storage',
             'visibility' => 'public',
         ],
 
@@ -51,9 +51,9 @@ return [
             'url' => env('AWS_URL'),
             'endpoint' => env('AWS_ENDPOINT'),
         ],
+        'admin' => ['driver' => 'local', 'root' => storage_path('app/public'), 'url' => env('APP_URL') . '/storage', 'visibility' => 'public',],
 
     ],
-
     /*
     |--------------------------------------------------------------------------
     | Symbolic Links

+ 2 - 1
database/migrations/2022_06_09_022738_create_dishes_table.php

@@ -18,8 +18,9 @@ class CreateDishesTable extends Migration
             $table->text('name');
             $table->unsignedInteger('price')->nullable();
             $table->unsignedInteger('weigh')->nullable();
-            $table->foreignId("category_id")->references("id")->on("categories");
+            $table->text("categories")->nullable();
             $table->text('composition', 255)->nullable();
+            $table->text('image')->nullable();
             $table->timestamps();
         });
     }

TEMPAT SAMPAH
storage/db/base.db