DEV Community

Emma Ngo
Emma Ngo

Posted on • Originally published at Medium on

Native PHP: How to Start?

I’m a web developer, and the main language that I use is PHP. As you know, actually, more than 70–80 percent of the current website you can see is PHP.

Before NativePHP, there was a lot of technical help needed to build PHP into an application (example: PHP Desktop). One of the most famous PHP frameworks currently is Laravel, and in Laracon 2023 day 2 the event of Laravel, Marcel Pociot introduced us to NativePHP with the topic "Writing Desktop Apps with PHP.”

Actually, I tried it, and it was really easy. You just need 3 commands, and you will have an application based on a standard Laravel project. It looks like a package for Laravel, so don’t worry if you are a PHP player.

How do I start?

If you have run the project with Laravel before, I believe you only need to run three commands before you can work with nativePHP

Installation

composer require nativephp/electron

You can run your current Laravel project or create a new one.

Run the installer

php artisan native:install

With the two commands above, nativePHP was successfully set up.

The last thing is to run it.

php artisan native:serve

Then, you will get an application like this:

What is special?

nativePHP has 5 highlight features; you can read more here.

  • Window management
  • Menu management
  • File management
  • Database support (SQLite)
  • Native notifications

But the thing that impresses me is “Menu Bar

I really think that it gives me an application, not a web application anymore.

Menu bar label

Menu bar Context Menu

End.

This topic might be late because nativePHP was introduced in April 2023.

But I believe that not many people know about the interesting features of nativePHP.

As before, PHP has other technical support PHP to make an application like “PHP Desktop”.

There are a lot of opportunities for PHP developers like me to build our product from the ground up.

Let's try; I'm impressed by what you can do with your application!!

Have a nice day :))))

Top comments (0)