/var/www/html/ApolloMarketplace/app/Http/Controllers/Controller.php
$slug = filter_var($slug, FILTER_SANITIZE_STRING);
$slug = str_replace(' ', '-', strtolower($slug));
$isSlugExist = DB::table($tablename)->where($fieldname,$slug)->first();
if (!empty($isSlugExist)) {
$slug = $slug.'-'.bin2hex(openssl_random_pseudo_bytes(6));
$this->createSlug($slug, $tablename, $fieldname);
}
return $slug;
}
public function getRandString($length) {
$length = ceil($length/2);
return bin2hex(openssl_random_pseudo_bytes($length));
}
public static function getSiteSetting() {
if( !empty(env('DB_HOST'))
&& !empty(env('DB_USERNAME'))
&& !empty(env('DB_DATABASE')) ){
$result = mysqli_query(mysqli_connect(env('DB_HOST'), env('DB_USERNAME'), env('DB_PASSWORD'), env('DB_DATABASE')), 'SELECT * FROM admin_settings WHERE id=1');
if($result){
return $result->fetch_object();
}
return null;
}
return null;
// return mysqli_query(mysqli_connect(env('DB_HOST'), env('DB_USERNAME'), env('DB_PASSWORD'), env('DB_DATABASE')), 'SELECT * FROM tbl_settings WHERE id=1')->fetch_object();
}
public function getWallerAmount($userId) {
$netincome = Wallet::select(DB::raw('SUM(revenue) as revenue'))->where(['user_id'=>$userId, 'add_minus'=>1])->whereIn('type', [0,6])->first()->revenue;
$withdrawn = Wallet::select(DB::raw('SUM(revenue) as revenue'))->where(['user_id'=>$userId, 'add_minus'=>0, 'type'=>3])->first()->revenue;
$userforpurchase = Wallet::select(DB::raw('SUM(revenue) as revenue'))->where(['user_id'=>$userId, 'add_minus'=>0, 'type'=>5])->first()->revenue;
$pendingclearance = Wallet::select(DB::raw('SUM(revenue) as revenue'))->where(['user_id'=>$userId, 'add_minus'=>0, 'type'=>2])->first()->revenue;
$availableforwithdraw = $netincome + $withdrawn + $userforpurchase + $pendingclearance;
$amountArray = array();
$expectedearnings = 0;
$amountArray['netincome'] = $netincome;
$amountArray['withdrawn'] = $withdrawn;
Arguments
"mysqli_query(): Argument #1 ($mysql) must be of type mysqli, bool given"
/var/www/html/ApolloMarketplace/app/Http/Controllers/Controller.php
$slug = filter_var($slug, FILTER_SANITIZE_STRING);
$slug = str_replace(' ', '-', strtolower($slug));
$isSlugExist = DB::table($tablename)->where($fieldname,$slug)->first();
if (!empty($isSlugExist)) {
$slug = $slug.'-'.bin2hex(openssl_random_pseudo_bytes(6));
$this->createSlug($slug, $tablename, $fieldname);
}
return $slug;
}
public function getRandString($length) {
$length = ceil($length/2);
return bin2hex(openssl_random_pseudo_bytes($length));
}
public static function getSiteSetting() {
if( !empty(env('DB_HOST'))
&& !empty(env('DB_USERNAME'))
&& !empty(env('DB_DATABASE')) ){
$result = mysqli_query(mysqli_connect(env('DB_HOST'), env('DB_USERNAME'), env('DB_PASSWORD'), env('DB_DATABASE')), 'SELECT * FROM admin_settings WHERE id=1');
if($result){
return $result->fetch_object();
}
return null;
}
return null;
// return mysqli_query(mysqli_connect(env('DB_HOST'), env('DB_USERNAME'), env('DB_PASSWORD'), env('DB_DATABASE')), 'SELECT * FROM tbl_settings WHERE id=1')->fetch_object();
}
public function getWallerAmount($userId) {
$netincome = Wallet::select(DB::raw('SUM(revenue) as revenue'))->where(['user_id'=>$userId, 'add_minus'=>1])->whereIn('type', [0,6])->first()->revenue;
$withdrawn = Wallet::select(DB::raw('SUM(revenue) as revenue'))->where(['user_id'=>$userId, 'add_minus'=>0, 'type'=>3])->first()->revenue;
$userforpurchase = Wallet::select(DB::raw('SUM(revenue) as revenue'))->where(['user_id'=>$userId, 'add_minus'=>0, 'type'=>5])->first()->revenue;
$pendingclearance = Wallet::select(DB::raw('SUM(revenue) as revenue'))->where(['user_id'=>$userId, 'add_minus'=>0, 'type'=>2])->first()->revenue;
$availableforwithdraw = $netincome + $withdrawn + $userforpurchase + $pendingclearance;
$amountArray = array();
$expectedearnings = 0;
$amountArray['netincome'] = $netincome;
$amountArray['withdrawn'] = $withdrawn;
Arguments
false
"SELECT * FROM admin_settings WHERE id=1"
/var/www/html/ApolloMarketplace/config/constant.php
<?php
$siteSetting = App\Http\Controllers\Controller::getSiteSetting();
$site_title = "";
$site_logo = "";
$site_contact_email = "";
if($siteSetting){
$site_title = $siteSetting->site_title;
$site_logo = $siteSetting->logo;
$site_contact_email = $siteSetting->contact_email;
}
define('DEFAULT_LANG', 'en');
define('SITE_TITLE', $site_title);
define('CAPTCHA_KEY', '6LeGWpceAAAAAHqwvvJtbRI4mc_-3k6_MfYa1wT5');
define('SECRET_KEY', '6LeGWpceAAAAAI_pNUlb9XjRCRPe5ruq2b5cU8AI');
//define('HTTP_PATH', 'http://127.0.0.1:8000');
if(config('app.env') === 'production') {
define('HTTP_PATH', 'https://'.env('APP_URL'));
} else {
define('HTTP_PATH', 'http://'.env('APP_URL'));
}
define('LOGO_IMAGE_DISPLAY_PATH', HTTP_PATH . '/upload/');
define('LOGO_PATH', LOGO_IMAGE_DISPLAY_PATH.$site_logo);
define("BASE_PATH", $_SERVER['DOCUMENT_ROOT']);
define('IMAGE_EXT', 'image/gif, image/jpeg, image/png');
define('PROFILE_FULL_UPLOAD_PATH','/files/users/full/');
define('PROFILE_newfull_PATH', HTTP_PATH . '/files/users/full/');
define('PROFILE_delete_PATH', HTTP_PATH . '/public/files/users/full/');
define('PROFILE_SMALL_UPLOAD_PATH','/files/users/small/');
define('PROFILE_FULL_DISPLAY_PATH', HTTP_PATH . '/files/users/full/');
define('PROFILE_SMALL_DISPLAY_PATH', HTTP_PATH . '/public/files/users/small/');
define('SERVICE_FULL_UPLOAD_PATH','/files/services/');
define('SERVICE_FULL_DISPLAY_PATH', HTTP_PATH . '/files/services/');
/* * ***************************** Gig Image Path ****************************** */
define('GIG_FULL_UPLOAD_PATH','/files/gigs/full/');
define('GIG_SMALL_UPLOAD_PATH','/files/gigs/small/');
define('GIG_SHOW_UPLOAD_PATH', BASE_PATH . '/files/gigs/full');
define('GIG_FULL_DISPLAY_PATH', HTTP_PATH . '/files/gigs/full/');
/var/www/html/ApolloMarketplace/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php
/**
* Load the configuration items from all of the files.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Contracts\Config\Repository $repository
* @return void
*
* @throws \Exception
*/
protected function loadConfigurationFiles(Application $app, RepositoryContract $repository)
{
$files = $this->getConfigurationFiles($app);
if (! isset($files['app'])) {
throw new Exception('Unable to load the "app" configuration file.');
}
foreach ($files as $key => $path) {
$repository->set($key, require $path);
}
}
/**
* Get all of the configuration files for the application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return array
*/
protected function getConfigurationFiles(Application $app)
{
$files = [];
$configPath = realpath($app->configPath());
foreach (Finder::create()->files()->name('*.php')->in($configPath) as $file) {
$directory = $this->getNestedDirectory($file, $configPath);
$files[$directory.basename($file->getRealPath(), '.php')] = $file->getRealPath();
}
Arguments
"/var/www/html/ApolloMarketplace/config/constant.php"
/var/www/html/ApolloMarketplace/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php
public function bootstrap(Application $app)
{
$items = [];
// First we will see if we have a cache configuration file. If we do, we'll load
// the configuration items from that file so that it is very quick. Otherwise
// we will need to spin through every configuration file and load them all.
if (file_exists($cached = $app->getCachedConfigPath())) {
$items = require $cached;
$loadedFromCache = true;
}
// Next we will spin through all of the configuration files in the configuration
// directory and load each one into the repository. This will make all of the
// options available to the developer for use in various parts of this app.
$app->instance('config', $config = new Repository($items));
if (! isset($loadedFromCache)) {
$this->loadConfigurationFiles($app, $config);
}
// Finally, we will set the application's environment based on the configuration
// values that were loaded. We will pass a callback which will be used to get
// the environment in a web context where an "--env" switch is not present.
$app->detectEnvironment(function () use ($config) {
return $config->get('app.env', 'production');
});
date_default_timezone_set($config->get('app.timezone', 'UTC'));
mb_internal_encoding('UTF-8');
}
/**
* Load the configuration items from all of the files.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Contracts\Config\Repository $repository
* @return void
Arguments
Illuminate\Foundation\Application {#2}
Illuminate\Config\Repository {#34}
/var/www/html/ApolloMarketplace/vendor/laravel/framework/src/Illuminate/Foundation/Application.php
{
$this->register(new EventServiceProvider($this));
$this->register(new LogServiceProvider($this));
$this->register(new RoutingServiceProvider($this));
}
/**
* Run the given array of bootstrap classes.
*
* @param string[] $bootstrappers
* @return void
*/
public function bootstrapWith(array $bootstrappers)
{
$this->hasBeenBootstrapped = true;
foreach ($bootstrappers as $bootstrapper) {
$this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]);
$this->make($bootstrapper)->bootstrap($this);
$this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]);
}
}
/**
* Register a callback to run after loading the environment.
*
* @param \Closure $callback
* @return void
*/
public function afterLoadingEnvironment(Closure $callback)
{
$this->afterBootstrapping(
LoadEnvironmentVariables::class, $callback
);
}
/**
* Register a callback to run before a bootstrapper.
Arguments
Illuminate\Foundation\Application {#2}
/var/www/html/ApolloMarketplace/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
}
/**
* Bootstrap the application for HTTP requests.
*
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
*
* @return \Closure
*/
protected function dispatchToRouter()
{
return function ($request) {
$this->app->instance('request', $request);
return $this->router->dispatch($request);
};
}
/**
* Call the terminate method on any terminable middleware.
*
Arguments
array:6 [
0 => "Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables"
1 => "Illuminate\Foundation\Bootstrap\LoadConfiguration"
2 => "Illuminate\Foundation\Bootstrap\HandleExceptions"
3 => "Illuminate\Foundation\Bootstrap\RegisterFacades"
4 => "Illuminate\Foundation\Bootstrap\RegisterProviders"
5 => "Illuminate\Foundation\Bootstrap\BootProviders"
]
/var/www/html/ApolloMarketplace/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php
$this->app['events']->dispatch(
new RequestHandled($request, $response)
);
return $response;
}
/**
* Send the given request through the middleware / router.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
protected function sendRequestThroughRouter($request)
{
$this->app->instance('request', $request);
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
}
/**
* Bootstrap the application for HTTP requests.
*
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
/var/www/html/ApolloMarketplace/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php
public function __construct(Application $app, Router $router)
{
$this->app = $app;
$this->router = $router;
$this->syncMiddlewareToRouter();
}
/**
* Handle an incoming HTTP request.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function handle($request)
{
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
$this->app['events']->dispatch(
new RequestHandled($request, $response)
);
return $response;
}
/**
* Send the given request through the middleware / router.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
protected function sendRequestThroughRouter($request)
Arguments
Illuminate\Http\Request {#43
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: Symfony\Component\HttpFoundation\ParameterBag {#45}
+request: Symfony\Component\HttpFoundation\InputBag {#51}
+query: Symfony\Component\HttpFoundation\InputBag {#51}
+server: Symfony\Component\HttpFoundation\ServerBag {#47}
+files: Symfony\Component\HttpFoundation\FileBag {#48}
+cookies: Symfony\Component\HttpFoundation\InputBag {#46}
+headers: Symfony\Component\HttpFoundation\HeaderBag {#49}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: null
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-preferredFormat: null
-isHostValid: true
-isForwardedValid: true
-isSafeContentPreferred: null
pathInfo: "/gigs/animation-and-multimedia/logo-animation"
requestUri: "/gigs/animation-and-multimedia/logo-animation"
baseUrl: ""
basePath: ""
method: "GET"
format: "html"
}
/var/www/html/ApolloMarketplace/public/index.php
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request using
| the application's HTTP kernel. Then, we will send the response back
| to this client's browser, allowing them to enjoy our application.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Kernel::class);
$response = $kernel->handle(
$request = Request::capture()
)->send();
$kernel->terminate($request, $response);
Arguments
Illuminate\Http\Request {#43
#json: null
#convertedFiles: null
#userResolver: null
#routeResolver: null
+attributes: Symfony\Component\HttpFoundation\ParameterBag {#45}
+request: Symfony\Component\HttpFoundation\InputBag {#51}
+query: Symfony\Component\HttpFoundation\InputBag {#51}
+server: Symfony\Component\HttpFoundation\ServerBag {#47}
+files: Symfony\Component\HttpFoundation\FileBag {#48}
+cookies: Symfony\Component\HttpFoundation\InputBag {#46}
+headers: Symfony\Component\HttpFoundation\HeaderBag {#49}
#content: null
#languages: null
#charsets: null
#encodings: null
#acceptableContentTypes: array:1 [
0 => "*/*"
]
#pathInfo: null
#requestUri: null
#baseUrl: null
#basePath: null
#method: null
#format: null
#session: null
#locale: null
#defaultLocale: "en"
-preferredFormat: null
-isHostValid: true
-isForwardedValid: true
-isSafeContentPreferred: null
pathInfo: "/gigs/animation-and-multimedia/logo-animation"
requestUri: "/gigs/animation-and-multimedia/logo-animation"
baseUrl: ""
basePath: ""
method: "GET"
format: "html"
}