A Big Step for PHP Developers: NativePHP’s Windows Support

Behlül Bozal
2 min readMay 14, 2024

NativePHP has announced Windows support, bringing a significant innovation for PHP developers. You can now build applications for the Windows platform. This update ensures that PHP works with new versions across all platforms. Here are the exciting details of this development and a guide on how to use it.

Why is Windows Support So Important?

Windows support is a big step for PHP developers. PHP is typically optimized to run on Linux and macOS. However, Windows users also want to develop powerful and efficient PHP applications. NativePHP’s Windows support meets this need.

Using NativePHP on Windows

With Windows support, you can now update and start using NativePHP. First, update NativePHP via Composer:

composer require nativephp/electron

This command will install the latest version of NativePHP on your system.

Building Applications for Windows

You can now build applications for Windows even while on another OS using the OS argument via the build command:

php artisan native:build win

This command will compile your application to run on Windows, allowing you to develop applications without switching between different platforms.

Building Applications for macOS and Linux

NativePHP also allows you to build applications for macOS and Linux platforms. Here are the details on how to build applications for these platforms:

Building for macOS

php artisan native:build mac

Building for Linux

php artisan native:build linux

Support for Laravel and PHP Versions

This release supports multiple PHP versions. It is fully compatible with Laravel 11, allowing you to develop your applications using PHP 8.2 or PHP 8.3. This version of NativePHP provides more flexibility and power in your Laravel projects.

Directory Structure

A project created with NativePHP follows a specific directory structure. Here is the typical structure of a NativePHP project:

my-native-app/
├── app/
│ ├── Console/
│ ├── Exceptions/
│ ├── Http/
│ ├── Models/
│ └── Providers/
├── bootstrap/
├── config/
├── database/
│ ├── factories/
│ ├── migrations/
│ └── seeders/
├── public/
├── resources/
│ ├── css/
│ ├── js/
│ ├── views/
│ └── ...
├── routes/
├── storage/
│ ├── app/
│ ├── framework/
│ └── logs/
├── tests/
├── vendor/
├── artisan
└── composer.json

In this structure, different components of your application are placed in specific folders. For example, the app folder contains the main code of your application, the config folder contains configuration files, and the resources folder contains frontend assets.

By following these steps, you can create powerful Laravel applications that run on different platforms.

Conclusion

NativePHP’s support for Windows, macOS, and Linux is a significant innovation for PHP developers. You can now develop powerful and efficient PHP applications on these platforms. By following this guide, you can easily configure and compile your projects to run on different platforms.

Reach me with links below:

--

--