PHPackages                             pittacusw/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. [Framework](/categories/framework)
4. /
5. pittacusw/core

ActiveLibrary[Framework](/categories/framework)

pittacusw/core
==============

Core modifications for laravel

v2(2mo ago)02101PHPPHP ^8.2

Since Mar 28Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/PittacusW/core)[ Packagist](https://packagist.org/packages/pittacusw/core)[ RSS](/packages/pittacusw-core/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (14)Versions (5)Used By (1)

Pittacusw Core
==============

[](#pittacusw-core)

Shared Laravel package for Pittacusw projects.

This package currently provides:

- a default GitHub webhook endpoint at `/api/github`
- a queued deployment job that runs `git pull` and `composer install`
- safe, configurable security headers middleware
- `RememberTrait` for model query caching with automatic cache invalidation
- artisan helpers for `git:add`, `git:pull`, and `composer:install`
- package translations

Compatibility
-------------

[](#compatibility)

- PHP: `^8.2`
- Laravel: `^9.26|^10.0|^11.0|^12.0|^13.0`

The runtime package keeps Laravel compatibility in its own constraints. For package tests, use the matching `orchestra/testbench` major for the Laravel version under test.

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

[](#installation)

```
composer require pittacusw/core
```

Publish the package config if you want to override the defaults:

```
php artisan vendor:publish --tag="pittacusw-core-config"
```

If you use the GitHub webhook endpoint, you must also configure the webhook secret in the host application:

```
GITHUB_WEBHOOK_SECRET=your-webhook-secret
```

Configuration
-------------

[](#configuration)

The package config file is `config/pittacusw-core.php`.

### Deployment

[](#deployment)

These settings control the queued `push` webhook handler:

- `PITTACUSW_CORE_DEPLOYMENT_ENABLED`
- `PITTACUSW_CORE_DEPLOYMENT_LOCK_SECONDS`
- `PITTACUSW_CORE_DEPLOYMENT_RETRY_DELAY_SECONDS`

Behavior:

- the package registers `Pittacusw\Core\Jobs\HandlePushWebhook` as the default `push` job only when `github-webhooks.jobs.push` is not already defined by the host app
- deployment runs under a cache lock to prevent overlapping `git pull` and `composer install` executions
- command failures throw, so the queue worker marks the job as failed instead of silently continuing

### Security Headers

[](#security-headers)

These settings control the global middleware registered by the package:

- `PITTACUSW_CORE_SECURITY_HEADERS_ENABLED`
- `PITTACUSW_CORE_SECURITY_HEADERS_FRAME_OPTIONS`
- `PITTACUSW_CORE_SECURITY_HEADERS_REFERRER_POLICY`
- `PITTACUSW_CORE_SECURITY_HEADERS_HSTS_ENABLED`
- `PITTACUSW_CORE_SECURITY_HEADERS_HSTS_MAX_AGE`
- `PITTACUSW_CORE_SECURITY_HEADERS_HSTS_INCLUDE_SUBDOMAINS`
- `PITTACUSW_CORE_SECURITY_HEADERS_HSTS_PRELOAD`

Default headers:

- `X-Content-Type-Options: nosniff`
- `X-Frame-Options: DENY`
- `Referrer-Policy: no-referrer`
- `Strict-Transport-Security` on secure requests only

The middleware intentionally does not emit deprecated headers such as `X-XSS-Protection` or `Public-Key-Pins-Report-Only`.

GitHub Webhooks
---------------

[](#github-webhooks)

The package registers:

- `POST /api/github`

This route points to Spatie's GitHub webhook controller. The route is always available when the package service provider is loaded.

Important notes:

- signature validation is handled by `spatie/laravel-github-webhooks`
- the host application still owns the authoritative `github-webhooks` config
- if you need a custom `push` job, define `github-webhooks.jobs.push` in the host app and the package will not override it
- the webhook route does not publish or own the Spatie migration anymore; the webhook storage table should come from `spatie/laravel-github-webhooks`

RememberTrait
-------------

[](#remembertrait)

`RememberTrait` adds model-wide query caching and cache invalidation.

Example:

```
