My recent works

I wanted to sum up some of my works from the last years, so I’ve listed the public ones here. Please take a look 🙂

  • chickenbanana.com: Fullstack development of the public and the management site. Lot of integrations done: ingenico, paypal, neverbounce, kickbox, invoiceocean, etc). Based on Laravel 5.3.
    In the management site, they are administering escape rooms from the booking, until the players leave the escape room. They have monitors in the escape rooms, where the Game Masters can send real time messages, images, sounds to the players. I have used pubnub.com for the real time communication.
    It is also planned to integrate to wheniwork.com, to manage the Game Masters time spent with work, and to dynamically change the opening times and open room number to the active Game Masters.
    They are also planning to open franchise in several cities, so the application must work locally, and globally too.
  • franchise.roomescape.game: Fullstack development of the franchise site for Chicken Banana, Laravel 5.3 site
  • v3.managementorapp.com: Fullstack development of the backend, and also the frontend. Laravel 5.5 application. Managementor is a mentoring application for company owners, hr, and other middle and top leaders.
  • Managementor App: Mobile app based on PhoneGap. Working on the following platforms: browser, ios, andorid; The v3 version of the application will go public in the middle of May 2018.
  • profits-network.com: Fullstack development of the public site, and also the management site, based on Laravel 5.5
  • tinylottery.com: Fullstack development, with my framework developed around 2013.
  • xwin24.com: Fullstack development based on my old framework from 2013. Got audited by the Malta Gaming Authority in 2015, and got a gambling license. Log of integrations made to payment processors, MGA, and other companies.
  • CDS 1.x: Not public project. It is a Customer Directing System based on PHP and Delphi, for big clients like Raiffeisen Bank, CIB Bank, Hungarian Electric Company, Vodafone Hungary and others. Worked locally in branches, and globally in the centre of the partner. I’ve used MSSQL, MSSQL Reporting and Analysis Services for reporting, and built several web based applications to collect data from all branches of the companies. Built on my own framework.

Laravel 5.3+ don’t load .env file

It was s strange situation… My JS and CSS files are versioned using an own method. In the asset() links a config value is included, which comes from the .env file, but after changing the needed value in the .env, nothing happened, the old file was loaded, instead of the new one…
So I’ve started to search for the reason.

My asset link looks like the following:

1
<link rel="stylesheet" href="{{ asset('/assets/css/occupancy_editor_v' . config('app.AssetFileVersion') . '.css') }}"/>

My .htaccess have one rewrite role:

1
2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule "^(.+)_v\d\d\d+\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$" "$1.$2" [L]

This ensures, that the _vxxx string will be rewritten to the original file name, but upon change of the file, the browser won’t load it from cache, because it gets the link with the _vxxx suffix…
In the _vxxx suffix, the xxx part comes from the .env file.

Checked the .htaccess, it was okay. Cleared the browser cache, nothing…

After some examination made on the dotenv library, it comes out, that values containing space required to put between ” signs. I’ve also had values containing ‘/’ sign, and it is a good thing to put them between “”-s too.

ArrowChat integration to Laravel 5.3+

Recently I’ve bought Arrowchat (https://www.arrowchat.com) for one of my customers. During the installation of arrowchat, you have to set up some users table values like:

  • Table name
  • user id field name
  • user name field name

This works correctly, but Arrowchat can not read the logged in user id, because usually Laravel encrypts the cookies, just like session cookie.

To solve this, we should bootstrap Laravel in the integration file of Arrowchat.

So the start of the integration.php should be start like this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$base_path = dirname(dirname(dirname(dirname(__FILE__))));
require_once($base_path . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');
require_once($base_path . DIRECTORY_SEPARATOR . 'bootstrap' . DIRECTORY_SEPARATOR . 'autoload.php');
$app = require_once($base_path . DIRECTORY_SEPARATOR . 'bootstrap' . DIRECTORY_SEPARATOR . 'app.php');
 
try {
    $app->make('Illuminate\Contracts\Http\Kernel')->handle(Illuminate\Http\Request::capture());
 
    $id = $app['encrypter']->decrypt($_COOKIE[$app['config']['session.cookie']]);
 
     $app['session']->driver()->setId($id);
     $app['session']->driver()->start();
 
} catch(\Exception $ex) {
}

 

This bootstraps the Laravel app. But to receive the correct user id from Laravel we should rewrite the get_user_id function to the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function get_user_id() {
    $userid = NULL;
    global $app;
 
    $app->make('Illuminate\Contracts\Http\Kernel')->handle(Illuminate\Http\Request::capture());
 
    $id = $app['encrypter']->decrypt($_COOKIE[$app['config']['session.cookie']]);
    $app['session']->driver()->setId($id);
    $app['session']->driver()->start();
 
    if($app['auth']->user()!= NULL){
         $userid = $app['auth']->user()->id;
    }
 
    return $userid;
}

And that’s it! Arrowchat now can read the user id from the session, and can display logged in users correctly!