Laravel desktop application


Some of the users still prefer Desktop application. As a Laravel developer, building a desktop application of your existing laravel application with another language or framework is a difficult and time-consuming task. If you are looking for converting your Laravel application into exe (desktop application) then it's for you. Here I'll show you how you can make laravel desktop application with php desktop. Let's know a little bit about php desktop.

 

PHP Desktop

PHP Desktop is an open-source project founded by Czarek Tomczak in 2012 to provide a way for developing native desktop GUI applications using web technologies such as PHP, HTML5, JavaScript and SQLite.

 

Make desktop application with Laravel Framework

  1. Download php desktop
  2. Setup the settings.json file
  3. Put your developed Laravel application
  4. Test Laravel desktop application

 

1. Download php desktop

Download the php desktop from GitHub PHP desktop repository and extract the php desktop. This package includes php version 7.1.3 and chrome 57.

 

2. Setup settings.json file

After extraction php desktop, you will get some files and folders. Now open the settings.json file from the root directory and change the settings at web_server section.

"web_server": {
      "listen_on": ["127.0.0.1", 0],
      "www_directory": "www/public",
      "index_files": ["index.php"],
      "cgi_interpreter": "php/php-cgi.exe",
      "cgi_extensions": ["php"],
      "cgi_temp_dir": "",
      "404_handler": "/index.php",
      "hide_files": []
}

Note: PHP desktop does not support htaccess so that here we have configured 404_handler to index.php as a laravel htaccess equivalent.

 

3. Put your developed Laravel application

Delete everything from the www directory and put your Laravel application into www directory. Keep in mind in this php desktop package includes php 7.1.3. If your laravel version does not support php 7.1.3 then download the required php version and include into php folder.

 

4. Test Laravel desktop application

To run the Laravel application as a desktop application, click on phpdesktop-chrome.exe file from the root directory of PHP desktop.

Example: Download the sample project of Laravel Desktop Application GitHub repository.

Hope this step by step tutorial post helps you to make a desktop application using PHP desktop with Laravel Framework. If you think this post helpful for you then share it with others.

 


Share on



Social Links


Related Post - Latest Post


Laravel Barcode generation tutorial

Laravel 8 authentication tutorial

What's new in Laravel 8

Laravel PDF generation tutorial

Laravel 7 Http facade

Laravel Validation Cheat Sheet