mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
add admin portal logo
This commit is contained in:
committed by
Mohit Panjwani
parent
f594556de0
commit
c194e98a7b
@ -49,7 +49,14 @@ class BootstrapController extends Controller
|
||||
|
||||
BouncerFacade::refreshFor($current_user);
|
||||
|
||||
$global_settings = Setting::getSettings(['api_token', 'admin_portal_theme']);
|
||||
$global_settings = Setting::getSettings([
|
||||
'api_token',
|
||||
'admin_portal_theme',
|
||||
'admin_portal_logo',
|
||||
'login_page_logo',
|
||||
'login_page_heading',
|
||||
'login_page_description'
|
||||
]);
|
||||
|
||||
return response()->json([
|
||||
'current_user' => new UserResource($current_user),
|
||||
|
||||
32
app/Providers/ViewServiceProvider.php
Normal file
32
app/Providers/ViewServiceProvider.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Crater\Providers;
|
||||
|
||||
use Crater\View\AdminComposer;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ViewServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
View::share('login_page_logo', get_login_page_logo());
|
||||
View::share('login_page_heading', get_login_page_heading());
|
||||
View::share('login_page_description', get_login_page_description());
|
||||
}
|
||||
}
|
||||
@ -34,6 +34,19 @@ function get_customer_logo($company_id)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get current admin portal logo
|
||||
*
|
||||
* @param $company_id
|
||||
* @return string
|
||||
*/
|
||||
function get_login_page_logo()
|
||||
{
|
||||
if (\Storage::disk('local')->has('database_created')) {
|
||||
return Setting::getSetting('login_page_logo');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current admin theme
|
||||
*
|
||||
@ -54,6 +67,33 @@ function get_admin_portal_theme()
|
||||
return 'crater';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current login page heading
|
||||
*
|
||||
* @param $company_id
|
||||
* @return string
|
||||
*/
|
||||
function get_login_page_heading()
|
||||
{
|
||||
if (\Storage::disk('local')->has('database_created')) {
|
||||
return Setting::getSetting('login_page_heading');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current login page description
|
||||
*
|
||||
* @param $company_id
|
||||
* @return string
|
||||
*/
|
||||
function get_login_page_description()
|
||||
{
|
||||
if (\Storage::disk('local')->has('database_created')) {
|
||||
return Setting::getSetting('login_page_description');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set Active Path
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user