PHPackages                             smart-till/core - 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. [Admin Panels](/categories/admin)
4. /
5. smart-till/core

ActiveLibrary[Admin Panels](/categories/admin)

smart-till/core
===============

SMART TiLL core Filament modules

v1.1.7(4w ago)0379↓80.7%MITPHPPHP ^8.2

Since Mar 26Pushed 2w agoCompare

[ Source](https://github.com/byhussain/core)[ Packagist](https://packagist.org/packages/smart-till/core)[ RSS](/packages/smart-till-core/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (38)Versions (20)Used By (0)

smart-till/core
===============

[](#smart-tillcore)

`smart-till/core` is the shared business/domain layer for SMART TiLL Server and SMART TiLL POS.

This package centralizes:

- Filament Resources, Pages, Relation Managers, and Widgets
- Core Eloquent Models
- Domain Enums
- Domain Observers
- Shared Services (geo bootstrap, permissions bootstrap, settings bootstrap, units bootstrap)
- Shared routes/views used by both server and POS
- Shared schema migrations for core tables/columns

The goal is one implementation for both projects so behavior stays aligned.

What This Package Actually Does
-------------------------------

[](#what-this-package-actually-does)

When installed in a host Laravel app, this package:

1. Registers `SmartTill\Core\Providers\CoreServiceProvider`
2. Loads package migrations from `database/migrations` inside this package
3. Loads package views (`resources/views`)
4. Loads package routes from `routes/web.php` (only if `public.receipt` route is not already registered)
5. Registers Livewire component: `product-search`
6. Registers morph-map compatibility for core/app aliases
7. Attaches core observers to core models
8. Provides installer commands to bootstrap required data

Compatibility Matrix
--------------------

[](#compatibility-matrix)

- PHP: `^8.2`
- Laravel: `^12.0`
- Filament: `^5.0`
- Livewire: `^4.0`

From package `composer.json`:

- `filament/filament`
- `laravel/framework`
- `laravel/sanctum`
- `league/iso3166`
- `livewire/livewire`
- `pragmarx/countries`

Host App Requirements
---------------------

[](#host-app-requirements)

Before installation:

1. Host app has `App\Models\Store`
2. `stores` table exists
3. Host app uses Filament tenancy with `Store` tenant model
4. Host app has a `Store` panel that discovers package resources/pages

If these are missing, install command will fail fast with explicit errors.

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

[](#installation)

Option A: VCS (Recommended for staging/production)
--------------------------------------------------

[](#option-a-vcs-recommended-for-stagingproduction)

In host app `composer.json`:

```
{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/SMART-DADDY/core"
    }
  ],
  "require": {
    "smart-till/core": "^1.0"
  }
}
```

Then:

```
composer update smart-till/core --with-all-dependencies --no-interaction
php artisan core:install --no-interaction
php artisan optimize:clear
```

Option B: Local Path (development only)
---------------------------------------

[](#option-b-local-path-development-only)

In host app `composer.json`:

```
{
  "repositories": [
    {
      "type": "path",
      "url": "../core",
      "options": {
        "symlink": true
      }
    }
  ],
  "require": {
    "smart-till/core": "*@dev"
  }
}
```

Then:

```
composer update smart-till/core --no-interaction
php artisan core:install --no-interaction
```

Installer Commands
------------------

[](#installer-commands)

`php artisan core:install`
--------------------------

[](#php-artisan-coreinstall)

Runs on default DB connection and does:

1. Validates `App\Models\Store`
2. Validates `stores` table exists
3. Runs `php artisan migrate --force --no-interaction`
4. Bootstraps countries/currencies/timezones
5. Bootstraps store settings defaults
6. Bootstraps universal units
7. Bootstraps core permissions and super-admin role mapping

`php artisan native:core:install`
---------------------------------

[](#php-artisan-nativecoreinstall)

For NativePHP sqlite runtime:

1. Validates `App\Models\Store`
2. Validates `native:migrate` command exists
3. Runs `php artisan native:migrate --force --no-interaction`
4. Validates `stores` exists on `nativephp` connection
5. Runs same bootstrap services on `nativephp` connection

Host Panel Wiring (Required)
----------------------------

[](#host-panel-wiring-required)

Your Filament Store panel must discover package resources/pages.

Example pattern:

```
use ReflectionClass;
use SmartTill\Core\Providers\CoreServiceProvider;
use SmartTill\Core\Http\Middleware\SetTenantTimezone as CoreSetTenantTimezone;

$coreSrcPath = dirname((new ReflectionClass(CoreServiceProvider::class))->getFileName(), 2);

->discoverResources(in: $coreSrcPath.'/Filament/Resources', for: 'SmartTill\\Core\\Filament\\Resources')
->discoverPages(in: $coreSrcPath.'/Filament/Pages', for: 'SmartTill\\Core\\Filament\\Pages')
->tenantMiddleware([CoreSetTenantTimezone::class], isPersistent: true)
```

Without tenant timezone middleware, `created_at/updated_at` can render in wrong timezone.

Config
------

[](#config)

The package reads:

- `config('smart_till.reference_on_create', true)`

If true:

- Store-scoped reference values are auto-assigned for resources having `reference` columns.

Recommended host config file:

```
