-
Environment $ php -v
PHP 8.3.14 (cli) (built: Nov 21 2024 08:25:00) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.14, Copyright (c) Zend Technologies
with Zend OPcache v8.3.14, Copyright (c), by Zend Technologies INIT$ composer create-project laravel/laravel todo-native
$ cd todo-native
$ cp .env.example .env
$ php artisan key:generate
$ composer require nativephp/electron
$ php artisan native:install WARNING deprecatedphp artisan native:install
Publishing NativePHP Service Provider...
INFO Publishing [nativephp-provider] assets.
Copying file [vendor/nativephp/laravel/resources/stubs/NativeAppServiceProvider.php.stub] to [app/Providers/NativeAppServiceProvider.php] ... DONE
INFO Publishing [nativephp-config] assets.
Copying file [vendor/nativephp/laravel/config/nativephp.php] to [config/nativephp.php] ...................................................... DONE
Installing `composer native:dev` script alias...
native:dev script installed!
┌ Would you like to install the NativePHP NPM dependencies? ───┐
│ Yes │
└──────────────────────────────────────────────────────────────┘
Installing NPM dependencies (This may take a while)...
Installing NPM dependencies using the npm package manager...
Fetching latest dependencies…
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options. change version$ composer update nativephp/electron:^0.6 -W
$ php artisan native:install
$ php artisan native:migrate
INFO Preparing database.
Creating migration table ............................................................................................................. 1.62ms DONE
INFO Running migrations.
0001_01_01_000000_create_users_table ................................................................................................. 1.18ms DONE
0001_01_01_000001_create_cache_table ................................................................................................. 0.36ms DONE
0001_01_01_000002_create_jobs_table .................................................................................................. 0.90ms DONE
run$ npm install
$ php artisan native:install
$ php artisan native:serve servephp artisan native:serve
Starting NativePHP dev server…
Fetching latest dependencies…
Installing NPM dependencies (This may take a while)...
Installing NPM dependencies using the npm package manager...
Fetching latest dependencies…
> [email protected] postinstall
> node ./node_modules/electron-builder/cli.js install-app-deps
• electron-builder version=24.13.3
Arch: arm64
Platform: darwin
• loaded configuration file=/Users/Tacks/Code/MoChi-Coder/todo-native/vendor/nativephp/electron/resources/js/electron-builder.js
up to date in 808ms
96 packages are looking for funding
run `npm fund` for details
Starting NativePHP app
Running the dev script with npm...
Fetching latest dependencies…
> [email protected] dev
> cross-env node php.js && electron-vite dev --watch
Binary Source: /Users/Tacks/Code/MoChi-Coder/todo-native/vendor/nativephp/php-bin/bin/mac/arm64/php-8.3.zip
Binary Filename: php
PHP version: 8.3
Unzipping PHP binary from /Users/Tacks/Code/MoChi-Coder/todo-native/vendor/nativephp/php-bin/bin/mac/arm64/php-8.3.zip to /Users/Tacks/Code/MoChi-Coder/todo-native/vendor/nativephp/electron/resources/js/resources/php
Copied certificate file to /Users/Tacks/Code/MoChi-Coder/todo-native/vendor/nativephp/electron/resources/js/resources/cacert.pem
Copied PHP binary to /Users/Tacks/Code/MoChi-Coder/todo-native/vendor/nativephp/electron/resources/js/resources/php/php
vite v4.5.3 building for development...
watching for file changes...
build started...
✓ 3 modules transformed.
out/main/index.js 0.62 kB
built in 31ms.
build the electron main process successfully
-----
vite v4.5.3 building for development...
watching for file changes...
build started...
"contextBridge" and "ipcRenderer" are imported from external module "electron" but never used in "src/preload/index.js".
✓ 1 modules transformed.
out/preload/index.js 0.70 kB
built in 7ms.
build the electron preload files successfully
-----
dev server running for the electron renderer process at:
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
start electron app...
API server started on port 4000
Starting PHP server... /Users/Tacks/Code/MoChi-Coder/todo-native/vendor/nativephp/electron/resources/js/resources/php/php artisan serve /Users/Tacks/Code/MoChi-Coder/todo-native []
Making sure app folders are available
Skipping Database migration while in development.
You may migrate manually by running: php artisan native:migrate
PHP Server started on port: 8104
PHP Server started on port: 8104
Skip checkForUpdates because application is not packed and dev update config is not forced
checkForUpdatesAndNotify called, downloadPromise is null
Running scheduler...
WEB![]() BUT electron is not work , The window is not open![]() ![]() Code
<?php
namespace App\Providers;
use Native\Laravel\Facades\Window;
use Native\Laravel\Contracts\ProvidesPhpIni;
class NativeAppServiceProvider implements ProvidesPhpIni
{
/**
* Executed once the native application has been booted.
* Use this method to open windows, register global shortcuts, etc.
*/
public function boot(): void
{
Window::open();
}
/**
* Return an array of php.ini directives to be set.
*/
public function phpIni(): array
{
return [
];
}
}
"require": {
"php": "^8.2",
"laravel/framework": "^11.31",
"laravel/tinker": "^2.9",
"nativephp/electron": "^0.6"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pail": "^1.1",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.1",
"phpunit/phpunit": "^11.0.1"
}, BUT Not Error msg
tail -f /Users/tacks/.npm/_logs/2024-12-08T06_53_5*
==> /Users/tacks/.npm/_logs/2024-12-08T06_53_50_958Z-debug-0.log <==
81 silly ADD
82 silly ADD
83 silly ADD
84 silly ADD
85 verbose cwd /Users/tacks/Code/MoChi-Coder/todo-native/vendor/nativephp/electron/resources/js
86 verbose os Darwin 24.0.0
87 verbose node v22.10.0
88 verbose npm v10.9.1
89 verbose exit 0
90 info ok
==> /Users/tacks/.npm/_logs/2024-12-08T06_53_51_855Z-debug-0.log <==
2 info using [email protected]
3 silly config load:file:/opt/homebrew/lib/node_modules/npm/npmrc
4 silly config load:file:/Users/tacks/Code/MoChi-Coder/todo-native/vendor/nativephp/electron/resources/js/.npmrc
5 silly config load:file:/Users/tacks/.npmrc
6 silly config load:file:/opt/homebrew/etc/npmrc
7 verbose title npm run dev
8 verbose argv "run" "dev"
9 verbose logfile logs-max:10 dir:/Users/tacks/.npm/_logs/2024-12-08T06_53_51_855Z-
10 verbose logfile /Users/tacks/.npm/_logs/2024-12-08T06_53_51_855Z-debug-0.log
11 silly logfile done cleaning log files
empty |
Beta Was this translation helpful? Give feedback.
Answered by
simonhamp
Dec 22, 2024
Replies: 1 comment
-
Closing as you've also raised this as an issue |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Tacks9
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Closing as you've also raised this as an issue