1day2die 3 лет назад
Родитель
Сommit
a11a9cf99c

+ 3 - 0
app/Http/Controllers/Admin/SettingsController.php

@@ -8,6 +8,7 @@ use Illuminate\Contracts\View\Factory;
 use Illuminate\Contracts\View\View;
 use Illuminate\Http\Request;
 use Illuminate\Http\Response;
+use App\Models\invoiceSettings;
 
 class SettingsController extends Controller
 {
@@ -47,6 +48,8 @@ class SettingsController extends Controller
         ]);
 
 
+
+
         return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!');
     }
 

+ 21 - 0
app/Models/InvoiceSettings.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+
+class invoiceSettings extends Model
+{
+    use HasFactory;
+
+    protected $table = 'invoice_settings';
+
+    protected $fillable = [
+        'company_name',
+        'company_adress',
+        'company_phone',
+        'company_vat',
+        'company_web'
+    ];
+}

+ 37 - 0
database/migrations/2021_11_30_174439_invoice-settings.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class InvoiceSettings extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('invoice_settings', function (Blueprint $table) {
+            $table->id();
+            $table->string('company_name')->nullable();
+            $table->string('company_adress')->nullable();
+            $table->string('company_phone')->nullable();
+            $table->string('company_vat')->nullable();
+            $table->string('company_mail')->nullable();
+            $table->string('company_web')->nullable();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('invoice_settings');
+    }
+}

+ 36 - 16
resources/views/admin/settings/index.blade.php

@@ -100,63 +100,64 @@
 
                                 <div class="row">
                                     <div class="col-md-6 col-lg-4 col-12">
-                                        <!-- Phone -->
+                                        <!-- Name -->
                                         <div class="form-group">
                                             <div class="custom-file mb-3 mt-3">
                                                 <input type="text"
-                                                       class="custom-text-input" name="company-phone" id="company-phone">
+                                                       class="custom-text-input" name="company-name" id="company-name">
                                                 <label class="custom-text-label selected"
-                                                       for="company-phone">{{__('Enter your Company Phone Number')}}</label>
+                                                       for="company-phone">{{__('Enter your Company Name')}}</label>
                                             </div>
-                                            @error('company-phone')
+                                            @error('company-name')
                                             <span class="text-danger">
                                                    {{$message}}
                                                </span>
                                             @enderror
                                         </div>
-<!-- Name -->
+                                        <!-- adress -->
                                         <div class="form-group">
                                             <div class="custom-file mb-3 mt-3">
                                                 <input type="text"
-                                                       class="custom-text-input" name="company-name" id="company-name">
+                                                       class="custom-text-input" name="company-adress" id="company-adress">
                                                 <label class="custom-text-label selected"
-                                                       for="company-phone">{{__('Enter your Company Name')}}</label>
+                                                       for="company-phone">{{__('Enter your Company Adress')}}</label>
                                             </div>
-                                            @error('company-name')
+                                            @error('company-adress')
                                             <span class="text-danger">
                                                    {{$message}}
                                                </span>
                                             @enderror
                                         </div>
-                                        <!-- VAT -->
+                                        <!-- Phone -->
                                         <div class="form-group">
                                             <div class="custom-file mb-3 mt-3">
                                                 <input type="text"
-                                                       class="custom-text-input" name="company-vat" id="company-vat">
+                                                       class="custom-text-input" name="company-phone" id="company-phone">
                                                 <label class="custom-text-label selected"
-                                                       for="company-phone">{{__('Enter your Company VAT')}}</label>
+                                                       for="company-phone">{{__('Enter your Company Phone Number')}}</label>
                                             </div>
-                                            @error('company-vat')
+                                            @error('company-phone')
                                             <span class="text-danger">
                                                    {{$message}}
                                                </span>
                                             @enderror
                                         </div>
 
-                                        <!-- adress -->
+                                        <!-- VAT -->
                                         <div class="form-group">
                                             <div class="custom-file mb-3 mt-3">
                                                 <input type="text"
-                                                       class="custom-text-input" name="company-adress" id="company-adress">
+                                                       class="custom-text-input" name="company-vat" id="company-vat">
                                                 <label class="custom-text-label selected"
-                                                       for="company-phone">{{__('Enter your Company Adress')}}</label>
+                                                       for="company-phone">{{__('Enter your Company VAT')}}</label>
                                             </div>
-                                            @error('company-adress')
+                                            @error('company-vat')
                                             <span class="text-danger">
                                                    {{$message}}
                                                </span>
                                             @enderror
                                         </div>
+
                                         <!-- email -->
                                         <div class="form-group">
                                             <div class="custom-file mb-3 mt-3">
@@ -186,6 +187,25 @@
                                             @enderror
                                         </div>
 
+                                        <!-- logo -->
+                                        <div class="form-group">
+                                            <div class="custom-file mb-3">
+                                                <input type="file" accept="image/x-icon" class="custom-file-input"
+                                                       name="logo" id="logo">
+                                                <label class="custom-file-label selected"
+                                                       for="favicon">{{__('Select Invoice Logo')}}</label>
+                                            </div>
+                                            @error('logo')
+                                            <span class="text-danger">
+                                                   {{$message}}
+                                               </span>
+                                            @enderror
+                                        </div>
+                                    </div>
+                                </div>
+
+                                        <!-- end -->
+
                                     </div>
                                 </div>