Просмотр исходного кода

Generated models command refactor

Vijayakrishnan 5 лет назад
Родитель
Сommit
bfeb2acffc
2 измененных файлов с 5 добавлено и 18 удалено
  1. 1 16
      app/Console/Commands/GenerateMCommand.php
  2. 4 2
      resources/views/pro/index.blade.php

+ 1 - 16
app/Console/Commands/GenerateMCommand.php

@@ -42,23 +42,8 @@ class GenerateMCommand extends Command
 
         global $argv;
         $models = json_decode(file_get_contents($argv[2]));
-        print_r($models);
 
-        $template =
-'<?php
-
-namespace App\Models;
-
-use Illuminate\Database\Eloquent\Model;
-
-class _NAME_ extends Model
-{
-
-    protected $table = "_TABLE_";
-
-    //
-}
-';
+        $template = file_get_contents(base_path('generatecv/model.template.php'));
 
         foreach ($models as $model) {
             $name = str_replace(" ", "", ucwords(str_replace("_", " ", $model)));

+ 4 - 2
resources/views/pro/index.blade.php

@@ -11,8 +11,9 @@
     </div>
 </div>
 
-<table class="table table-sm">
-    <thead class="thead-light">
+<div class="table-responsive p-0">
+<table class="table table-hover text-nowrap">
+    <thead>
         <tr>
             <th>#</th>
             <th>cell_number</th>
@@ -51,5 +52,6 @@
         @endforeach
     </tbody>
 </table>
+</div>
 
 @endsection