PHPackages                             matildevoldsen/quick-actions - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. matildevoldsen/quick-actions

ActiveNativephp-plugin[Utility &amp; Helpers](/categories/utility)

matildevoldsen/quick-actions
============================

Home screen quick actions (iOS) and launcher shortcuts (Android) for NativePHP Mobile

1.0.0(3w ago)12↓100%MITPHPPHP ^8.3

Since May 18Pushed 3w agoCompare

[ Source](https://github.com/Matildevoldsen/quick-actions)[ Packagist](https://packagist.org/packages/matildevoldsen/quick-actions)[ RSS](/packages/matildevoldsen-quick-actions/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

matildevoldsen/quick-actions
============================

[](#matildevoldsenquick-actions)

Home screen quick actions for [NativePHP Mobile](https://nativephp.com) apps, with iOS home screen shortcuts and Android launcher shortcuts driven from Laravel.

This package is a Composer package named **`matildevoldsen/quick-actions`**. It is built for **iOS and Android**, requires **`nativephp/mobile`**, and is maintained by **Matilde Enevoldsen**.

What it does
------------

[](#what-it-does)

- Registers shortcut items from Laravel
- Syncs those items to iOS and Android through the NativePHP bridge
- Supports route-based shortcuts and signed event-dispatch shortcuts
- Can publish selected items into Spotlight and App Shortcuts so users can launch them from search
- Ships a NativePHP post-compile hook for the generated iOS project
- Includes Boost guidelines and a small JavaScript bridge helper for advanced SPA use

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel
- `nativephp/mobile` ^3.0
- Android SDK **29+**
- iOS **18.0+**

Installation
------------

[](#installation)

```
composer require matildevoldsen/quick-actions

# First-time setup in the host app
php artisan vendor:publish --tag=nativephp-plugins-provider

# Register the plugin so NativePHP compiles the native code
php artisan native:plugin:register zinxan/quick-actions

# Verify registration
php artisan native:plugin:list

# Build / refresh the native projects
php artisan native:install --no-interaction
```

The package service provider is auto-discovered by Laravel. Plugin registration is still required so the native Swift and Kotlin code is compiled into your app.

Permissions and native configuration
------------------------------------

[](#permissions-and-native-configuration)

This plugin does **not** request any extra Android permissions and does **not** add any iOS `Info.plist` usage descriptions.

Platform configuration shipped in `nativephp.json`:

- Android `min_version`: `29`
- iOS `min_version`: `18.0`
- Android init function: `com.zinxan.plugins.quickactions.bootstrapQuickActions`
- iOS init function: `QuickActionsPlugin.bootstrap`
- iOS post-compile hook: `nativephp:quick-actions:post-compile`

Usage (PHP)
-----------

[](#usage-php)

Register quick actions during application boot so they are present before the response is finalized.

```
use ZinXan\QuickActions\QuickActions;
use ZinXan\QuickActions\Shortcut;

Shortcut::create('scan', 'Scan')
    ->icon('camera')
    ->dispatch(\App\Events\OpenScanner::class, [
        'source' => 'shortcut',
        'redirectTo' => '/scanner',
    ]);

QuickActions::addItem('Images')
    ->icon('photo')
    ->route('gallery.index');

Shortcut::create('ask-ai', 'Ask AI')
    ->icon('search')
    ->addToQuickActions()
    ->openRoute('ai.index');
```

`QuickActions` is launcher/app-icon first. `Shortcut` is Spotlight/App Shortcuts first. Either builder can opt into both surfaces.

### Where to register items

[](#where-to-register-items)

Typical places to register items:

- a service provider `boot()` method
- route bootstrapping for app-wide shortcuts
- request-specific UI flows before the response finishes

The package syncs the registry after the application has booted and again at middleware termination, so request-specific shortcuts can still be finalized safely.

### API reference

[](#api-reference)

#### `QuickActions::addItem(string $title, ?string $id = null): QuickActionItem`

[](#quickactionsadditemstring-title-string-id--null-quickactionitem)

Creates a launcher quick action definition. If no ID is passed, the package derives a stable slug from the title so installed shortcuts keep working across restarts.

#### `Shortcut::create(string $id, string $title): QuickActionItem`

[](#shortcutcreatestring-id-string-title-quickactionitem)

Creates a Spotlight/App Shortcuts definition using the explicit ID API.

```
use ZinXan\QuickActions\Shortcut;

Shortcut::create('ask-ai', 'Ask AI')
    ->icon('search')
    ->openRoute('ai.index');
```

#### Separate surfaces, with opt-in crossover

[](#separate-surfaces-with-opt-in-crossover)

```
use ZinXan\QuickActions\QuickActions;
use ZinXan\QuickActions\Shortcut;

QuickActions::addItem('Camera')
    ->icon('camera')
    ->addToShortcuts()
    ->route('camera.index');

Shortcut::create('ask-ai', 'Ask AI')
    ->icon('search')
    ->addToQuickActions()
    ->openRoute('ai.index');
```

#### `QuickActionItem::icon(?string $symbolName): self`

[](#quickactionitemiconstring-symbolname-self)

Sets the icon alias used by both platforms.

```
QuickActions::addItem('Search')
    ->icon('search')
    ->route('search');
```

#### `QuickActionItem::route(string $name, array $parameters = []): self`

[](#quickactionitemroutestring-name-array-parameters---self)

Resolves a named Laravel route and stores the resulting in-app path.

```
QuickActions::addItem('Orders')
    ->icon('home')
    ->route('orders.index', ['status' => 'open']);
```

#### `QuickActionItem::action(string $eventClass, array $payload = []): self`

[](#quickactionitemactionstring-eventclass-array-payload---self)

Creates a signed internal dispatch URL that resolves the given event class from the container using the payload as named constructor parameters.

```
QuickActions::addItem('Scan')
    ->icon('camera')
    ->action(\App\Events\OpenScanner::class, [
        'source' => 'quick-action',
        'redirectTo' => '/scanner',
    ]);
```

The payload may include `redirectTo`; if omitted, the internal dispatch route redirects to `/`.

#### Surface methods

[](#surface-methods)

- `QuickActionItem::addToQuickActions(bool $enabled = true): self`
- `QuickActionItem::addToShortcuts(bool $enabled = true): self`
- `QuickActionItem::addToSpotlight(): self` (alias of `addToShortcuts()`)
- `QuickActionItem::spotlight(bool $enabled = true): self` (alias of `addToShortcuts()`)

#### `QuickActionItem::addToSpotlight(): self`

[](#quickactionitemaddtospotlight-self)

Opt-in shortcuts surfaces for a launcher quick action.

```
QuickActions::addItem('Ask AI')
    ->icon('search')
    ->addToSpotlight()
    ->route('ai.index');
```

Only items marked with `->addToSpotlight()` or `->addToShortcuts()` are indexed into Spotlight/App Shortcuts when they start from `QuickActions::addItem()`.

#### Fluent aliases

[](#fluent-aliases)

- `QuickActionItem::openRoute(string $name, array $parameters = []): self`
- `QuickActionItem::dispatch(string $eventClass, array $payload = []): self`

#### `QuickActionsSync::sync(): void`

[](#quickactionssyncsync-void)

Low-level sync service exposed through the `QuickActionsSync` facade alias. Most applications do **not** need to call this directly because the package syncs automatically.

```
use QuickActionsSync;

QuickActionsSync::sync();
```

Usage (JavaScript)
------------------

[](#usage-javascript)

This package also ships a small JavaScript helper in `resources/js/index.js` for advanced SPA-side bridge calls. The **preferred** and durable integration is still the PHP API above, because PHP registration is what persists and rehydrates shortcuts across app launches.

Re-export the helper from your frontend build:

```
// resources/js/nativephp-quick-actions.js
export { QuickActionsBridge } from '../../vendor/zinxan/quick-actions/resources/js/index.js';
```

Then use it from Vue, React, or another SPA entrypoint:

```
import { QuickActionsBridge } from '@/nativephp-quick-actions';

await QuickActionsBridge.sync([
    QuickActionsBridge.item({
        id: 'scan',
        title: 'Scan',
        icon: 'camera',
        urlPath: '/scanner',
        quickAction: true,
        shortcut: true,
    }),
]);
```

`QuickActionsBridge.sync()` calls the same `QuickActions.Sync` bridge function used by the PHP synchronizer.

Events
------

[](#events)

This package does **not** dispatch its own fixed NativePHP event classes.

Instead, `->action()` dispatches **your event class** when the signed quick-action URL is opened. The payload array is passed to Laravel as named constructor parameters.

Example:

```
namespace App\Events;

class OpenScanner
{
    public function __construct(
        public string $source,
        public string $redirectTo = '/scanner',
    ) {}
}
```

Icon mapping
------------

[](#icon-mapping)

The package accepts a shared icon vocabulary and maps it to SF Symbols on iOS and framework drawables on Android.

`icon()` valueiOSAndroid`photo`, `image`, `images`, `gallery`, `picture``photo``ic_menu_gallery``camera`, `photo.camera``camera``ic_menu_camera``search`, `find`, `magnifyingglass``magnifyingglass``ic_menu_search``share`, `action`, `export``square.and.arrow.up``ic_menu_share``settings`, `gear`, `preferences``gearshape``ic_menu_preferences``home``house``ic_menu_compass``star`, `favorite``star``star_big_on``bell`, `notification``bell`fallbackUnknown iOS icons are attempted as raw SF Symbols before falling back. Unknown Android icons log a warning and fall back to `ic_menu_gallery`.

Platform notes
--------------

[](#platform-notes)

- iOS shows at most **four** dynamic quick actions.
- iOS only indexes items into **Spotlight / App Shortcuts** when they belong to the shortcuts surface.
- Spotlight entries use the item title plus app-name keywords so searching for the app can surface opted-in actions more reliably.
- The package persists shortcut payloads in `storage/app/zinxan/quick-actions.json`.
- Action dispatch payloads are mirrored to `storage/app/zinxan/quick-actions-dispatch.json` so they still work when cache is empty or split across workers.
- The iOS post-compile hook patches generated `AppDelegate.swift` and `ContentView.swift` to support cold-start and scene-based shortcut handling.
- Only one plugin should own iOS scene shortcut wiring in `application(_:configurationForConnecting:options:)`.

If you regenerate native iOS sources and shortcut handling stops working, rerun:

```
php artisan nativephp:quick-actions:post-compile \
  --platform=ios \
  --build-path=/absolute/path/to/nativephp/ios \
  --no-interaction
```

Validation and testing
----------------------

[](#validation-and-testing)

Recommended release checks:

```
php artisan native:plugin:validate
php artisan test --compact
php artisan native:install --no-interaction
```

For this package itself:

```
cd plugins/quick-actions
composer dump-autoload
composer test
```

Boost guidelines
----------------

[](#boost-guidelines)

The package includes Boost guidance in `resources/boost/guidelines/core.blade.php` so AI tooling can discover the supported PHP and JavaScript patterns.

Local development
-----------------

[](#local-development)

When developing this package locally in a NativePHP app, add it as a path repository:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "plugins/quick-actions",
            "options": {
                "symlink": true
            }
        }
    ],
    "require": {
        "zinxan/quick-actions": "@dev"
    }
}
```

With `"symlink": false`, refresh the mirrored vendor copy after edits:

```
rm -rf vendor/zinxan/quick-actions && composer install
```

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance95

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

22d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23423701?v=4)[Matildeene](/maintainers/Matildeene)[@Matildeene](https://github.com/Matildeene)

---

Top Contributors

[![Matildevoldsen](https://avatars.githubusercontent.com/u/30376875?v=4)](https://github.com/Matildevoldsen "Matildevoldsen (3 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/matildevoldsen-quick-actions/health.svg)

```
[![Health](https://phpackages.com/badges/matildevoldsen-quick-actions/health.svg)](https://phpackages.com/packages/matildevoldsen-quick-actions)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
