| Server IP : 14.225.204.176 / Your IP : 216.73.216.252 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/thanhphuong/app/Providers/ |
Upload File : |
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\View;
use DB;
use Illuminate\Support\Facades\URL;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
public function boot()
{
// if( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443) {
// URL::forceScheme('https');
// }
//setting language
if(isset($_COOKIE['language'])) {
\App::setLocale($_COOKIE['language']);
} else {
\App::setLocale('en');
}
//get general setting value
$general_setting = DB::table('general_settings')->latest()->first();
$currency = \App\Currency::find($general_setting->currency);
View::share('general_setting', $general_setting);
View::share('currency', $currency);
config(['staff_access' => $general_setting->staff_access, 'date_format' => $general_setting->date_format, 'currency' => $currency->code, 'currency_position' => $general_setting->currency_position]);
$alert_product = DB::table('products')->where('is_active', true)->whereColumn('alert_quantity', '>', 'qty')->count();
View::share('alert_product', $alert_product);
Schema::defaultStringLength(191);
}
}