clean UI
This commit is contained in:
parent
afd2e2eb21
commit
f62583a007
|
@ -3,12 +3,12 @@
|
||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\invoiceSettings;
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
use Illuminate\Contracts\View\Factory;
|
use Illuminate\Contracts\View\Factory;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use App\Models\invoiceSettings;
|
|
||||||
|
|
||||||
class SettingsController extends Controller
|
class SettingsController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,15 @@ class SettingsController extends Controller
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('admin.settings.index');
|
return view('admin.settings.index',
|
||||||
|
[
|
||||||
|
'company_name' => invoiceSettings::get()->first()->company_name,
|
||||||
|
'company_adress' => invoiceSettings::get()->first()->company_adress,
|
||||||
|
'company_phone' => invoiceSettings::get()->first()->company_phone,
|
||||||
|
'company_vat' => invoiceSettings::get()->first()->company_vat,
|
||||||
|
'company_mail' => invoiceSettings::get()->first()->company_mail,
|
||||||
|
'company_web' => invoiceSettings::get()->first()->company_web
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateIcons(Request $request)
|
public function updateIcons(Request $request)
|
||||||
|
@ -46,32 +54,18 @@ class SettingsController extends Controller
|
||||||
'logo' => 'nullable|max:10000|mimes:jpg,png,jpeg',
|
'logo' => 'nullable|max:10000|mimes:jpg,png,jpeg',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
invoiceSettings::updateOrCreate(['id' => "1"], ['company_name' => $request->get('company-name')]);
|
||||||
|
invoiceSettings::updateOrCreate(['id' => "1",], ['company_adress' => $request->get('company-adress')]);
|
||||||
|
invoiceSettings::updateOrCreate(['id' => "1",], ['company_phone' => $request->get('company-phone')]);
|
||||||
|
invoiceSettings::updateOrCreate(['id' => "1",], ['company_mail' => $request->get('company-email')]);
|
||||||
|
invoiceSettings::updateOrCreate(['id' => "1",], ['company_vat' => $request->get('company-vat')]);
|
||||||
|
invoiceSettings::updateOrCreate(['id' => "1",], ['company_web' => $request->get('company-web')]);
|
||||||
|
|
||||||
|
|
||||||
if($request->filled('company-name')) {
|
|
||||||
invoiceSettings::updateOrCreate(['id' => "1"],['company_name' => $request->get('company-name')]);
|
|
||||||
}
|
|
||||||
if($request->filled('company-adress')) {
|
|
||||||
invoiceSettings::updateOrCreate(['id' => "1",],['company_adress' => $request->get('company-adress')]);
|
|
||||||
}
|
|
||||||
if($request->filled('company-phone')) {
|
|
||||||
invoiceSettings::updateOrCreate(['id' => "1",],['company_phone' => $request->get('company-phone')]);
|
|
||||||
}
|
|
||||||
if($request->filled('company-vat')) {
|
|
||||||
invoiceSettings::updateOrCreate(['id' => "1",],['company_vat' => $request->get('company-vat')]);
|
|
||||||
}
|
|
||||||
if($request->filled('company-mail')) {
|
|
||||||
invoiceSettings::updateOrCreate(['id' => "1",],['company_mail' => $request->get('company-mail')]);
|
|
||||||
}
|
|
||||||
if($request->filled('company-web')) {
|
|
||||||
invoiceSettings::updateOrCreate(['id' => "1",],['company_web' => $request->get('company-web')]);
|
|
||||||
}
|
|
||||||
if ($request->hasFile('logo')) {
|
if ($request->hasFile('logo')) {
|
||||||
$request->file('logo')->storeAs('public', 'logo.png');
|
$request->file('logo')->storeAs('public', 'logo.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!');
|
return redirect()->route('admin.settings.index')->with('success', 'Invoice settings updated!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ class invoiceSettings extends Model
|
||||||
'company_name',
|
'company_name',
|
||||||
'company_adress',
|
'company_adress',
|
||||||
'company_phone',
|
'company_phone',
|
||||||
|
'company_mail',
|
||||||
'company_vat',
|
'company_vat',
|
||||||
'company_web'
|
'company_web'
|
||||||
];
|
];
|
||||||
|
|
|
@ -102,89 +102,63 @@
|
||||||
<div class="col-md-6 col-lg-4 col-12">
|
<div class="col-md-6 col-lg-4 col-12">
|
||||||
<!-- Name -->
|
<!-- Name -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="custom-file mb-3 mt-3">
|
<div class="custom-control mb-3">
|
||||||
<input type="text"
|
<label for="company-name">{{__('Enter your companys name' )}}</label>
|
||||||
class="custom-text-input" name="company-name" id="company-name">
|
<input x-model="company-name" id="company-name" name="company-name"
|
||||||
<label class="custom-text-label selected"
|
type="text" value="{{$company_name}}"
|
||||||
for="company-phone">{{__('Enter your Company Name')}}</label>
|
class="form-control @error('company-name') is-invalid @enderror">
|
||||||
</div>
|
</div>
|
||||||
@error('company-name')
|
|
||||||
<span class="text-danger">
|
|
||||||
{{$message}}
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
</div>
|
</div>
|
||||||
<!-- adress -->
|
<!-- adress -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="custom-file mb-3 mt-3">
|
<div class="custom-control mb-3">
|
||||||
<input type="text"
|
<label
|
||||||
class="custom-text-input" name="company-adress" id="company-adress">
|
for="company-adress">{{__('Enter your companys adress' )}}</label>
|
||||||
<label class="custom-text-label selected"
|
<input x-model="company-adress" id="company-adress"
|
||||||
for="company-phone">{{__('Enter your Company Adress')}}</label>
|
name="company-adress" type="text" value="{{$company_adress}}"
|
||||||
|
class="form-control @error('company-adress') is-invalid @enderror">
|
||||||
</div>
|
</div>
|
||||||
@error('company-adress')
|
|
||||||
<span class="text-danger">
|
|
||||||
{{$message}}
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
</div>
|
</div>
|
||||||
<!-- Phone -->
|
<!-- Phone -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="custom-file mb-3 mt-3">
|
<div class="custom-control mb-3">
|
||||||
<input type="text"
|
<label
|
||||||
class="custom-text-input" name="company-phone" id="company-phone">
|
for="company-phone">{{__('Enter your companys phone number' )}}</label>
|
||||||
<label class="custom-text-label selected"
|
<input x-model="company-phone" id="company-phone" name="company-phone"
|
||||||
for="company-phone">{{__('Enter your Company Phone Number')}}</label>
|
type="text" value="{{$company_phone}}"
|
||||||
|
class="form-control @error('company-phone') is-invalid @enderror">
|
||||||
</div>
|
</div>
|
||||||
@error('company-phone')
|
|
||||||
<span class="text-danger">
|
|
||||||
{{$message}}
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- VAT -->
|
<!-- VAT -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="custom-file mb-3 mt-3">
|
<div class="custom-control mb-3">
|
||||||
<input type="text"
|
<label for="company-vat">{{__('Enter your companys VAT id' )}}</label>
|
||||||
class="custom-text-input" name="company-vat" id="company-vat">
|
<input x-model="company-vat" id="company-vat" name="company-vat"
|
||||||
<label class="custom-text-label selected"
|
type="text" value="{{$company_vat}}"
|
||||||
for="company-phone">{{__('Enter your Company VAT')}}</label>
|
class="form-control @error('company-vat') is-invalid @enderror">
|
||||||
</div>
|
</div>
|
||||||
@error('company-vat')
|
|
||||||
<span class="text-danger">
|
|
||||||
{{$message}}
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- email -->
|
<!-- email -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="custom-file mb-3 mt-3">
|
<div class="custom-control mb-3">
|
||||||
<input type="text"
|
<label
|
||||||
class="custom-text-input" name="company-mail" id="company-mail">
|
for="company-mail">{{__('Enter your companys email adress' )}}</label>
|
||||||
<label class="custom-text-label selected"
|
<input x-model="company-mail" id="company-mail" name="company-mail"
|
||||||
for="company-phone">{{__('Enter your Company mail')}}</label>
|
type="text" value="{{$company_mail}}"
|
||||||
|
class="form-control @error('company-mail') is-invalid @enderror">
|
||||||
</div>
|
</div>
|
||||||
@error('company-mail')
|
|
||||||
<span class="text-danger">
|
|
||||||
{{$message}}
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
</div>
|
</div>
|
||||||
<!-- website -->
|
<!-- website -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="custom-file mb-3 mt-3">
|
<div class="custom-control mb-3">
|
||||||
<input type="text"
|
<label
|
||||||
class="custom-text-input" name="company-web" id="company-web">
|
for="company-web">{{__('Enter your companys website' )}}</label>
|
||||||
<label class="custom-text-label selected"
|
<input x-model="company-web" id="company-web" name="company-web"
|
||||||
for="company-phone">{{__('Enter your Company web')}}</label>
|
type="text" value="{{$company_web}}"
|
||||||
|
class="form-control @error('company-web') is-invalid @enderror">
|
||||||
</div>
|
</div>
|
||||||
@error('company-web')
|
|
||||||
<span class="text-danger">
|
|
||||||
{{$message}}
|
|
||||||
</span>
|
|
||||||
@enderror
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- logo -->
|
<!-- logo -->
|
||||||
|
@ -220,7 +194,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- END CUSTOM CONTENT -->
|
<!-- END CUSTOM CONTENT -->
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
@ -228,7 +201,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Add the following code if you want the name of the file appear on select
|
// Add the following code if you want the name of the file appear on select
|
||||||
document.addEventListener('DOMContentLoaded', ()=>{
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
$(".custom-file-input").on("change", function () {
|
$(".custom-file-input").on("change", function () {
|
||||||
var fileName = $(this).val().split("\\").pop();
|
var fileName = $(this).val().split("\\").pop();
|
||||||
$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
|
$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
|
||||||
|
|
Loading…
Reference in a new issue