PHPackages                             corecaching/core-caching - 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. corecaching/core-caching

ActiveLibrary

corecaching/core-caching
========================

Reusable CRM login, Telegram backup and email-credit services for Laravel applications.

v1.1.6(yesterday)06↑2900%MITPHPPHP &gt;=7.3

Since Aug 1Pushed yesterdayCompare

[ Source](https://github.com/dev-raj-shekhar/core-caching)[ Packagist](https://packagist.org/packages/corecaching/core-caching)[ RSS](/packages/corecaching-core-caching/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (10)Used By (0)

&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD

Core Caching
============

[](#core-caching)

Reusable Laravel services for the common platform features used by the projects:

- signed CRM login on the application's existing `/login` route;
- Laravel database backups sent to Telegram;
- email-credit updates through the application's existing `settings()` / `configg()` helpers.

The package requires `spatie/laravel-backup` and runs its backup command with Spatie notifications disabled, because Telegram is the delivery channel and the consuming application's mail service may not be available.

Install
-------

[](#install)

```
composer require corecaching/core-caching
php artisan vendor:publish --tag=core-caching-config
```

The only package-specific value required in `.env` is the CRM secret. It can reuse the application's existing `code` value:

```
CORE_CACHING_CRM_SECRET="${code}"
```

The legacy backup endpoint is registered by the package itself at `POST /api/v2/license/bckp`; it is no longer defined in the application's `routes/api.php`. For this endpoint, Telegram credentials are intentionally read from the request, matching the existing API contract:

```
{
    "code": "your-code-value",
    "token": "telegram-bot-token",
    "chat_id": "telegram-chat-id",
    "type": 1
}
```

The `type` field is accepted for backward compatibility. The package uses the configured backup service to create and send the database backup and assets archive. Direct `CoreCaching::backup()` calls require Telegram credentials in the published package config; this legacy HTTP endpoint does not, because it reads `token` and `chat_id` from the request.

For applications that already expose `settings($key)` and `configg($key, $value)`, the CRM secret and email credits use those helpers by default. Otherwise, set `CORE_CACHING_CRM_SECRET`; implement equivalent persistence for email credits before using `updateEmailCredit()`.

CRM login automatically uses `App\Models\User` when that class exists. If an application uses another model, set `CORE_CACHING_USER_MODEL` to its fully qualified class name.

Student-credit updates are optional. If the consuming application does not have a `students_credit` table, the endpoint safely reports that tracking is not configured without attempting a database insert or query.

Usage
-----

[](#usage)

Keep the normal GET `/login` route and call this at the beginning of its controller:

```
if ($response = CoreCaching::sync()) {
    return $response;
}
```

The method returns `null` for an ordinary login request. For a valid CRM request (`crm_login`, `timestamp`, `signature`) it logs in the first admin/user and redirects to the configured route. Existing signature format is preserved: `HMAC-SHA256(timestamp|host, nirmanam_key)`.

Other entry points are `CoreCaching::backup()` and `CoreCaching::updateEmailCredit($delta)`.

Private publishing
------------------

[](#private-publishing)

Public Packagist is for public packages. For private access, use Private Packagist with a private GitHub/GitLab/Bitbucket repository. Private Packagist can read private Git repositories using SSH or HTTP credentials, then exposes the package to only the organization/team members you grant access to. See the [Private Packagist private-package guide](https://packagist.com/features/private-vcs-packages).

1. Create a private repository whose root contains this directory's files.
2. Push the repository and create a release tag such as `v1.0.0`.
3. In Private Packagist, add the private repository URL and configure the stored Git credentials.
4. Add the organization's Composer repository to each consuming project:

```
{
    "repositories": [
        {"type": "composer", "url": "https://repo.packagist.com/YOUR_ORGANIZATION/"}
    ]
}
```

5. Authenticate each developer machine or CI runner. Use a read-only token for installs from an existing lock file; use an update-capable token when running `composer update`.

```
composer config --global --auth http-basic.repo.packagist.com token YOUR_PRIVATE_PACKAGIST_TOKEN
composer require corecaching/core-caching
```

For CI, prefer the `COMPOSER_AUTH` secret rather than committing credentials:

```
export COMPOSER_AUTH='{"http-basic":{"repo.packagist.com":{"username":"token","password":"YOUR_PRIVATE_PACKAGIST_TOKEN"}}}'
composer install --no-interaction
```

Private Packagist's setup guide recommends adding the organization's repository URL and disabling the public Packagist repository when Private Packagist is configured to mirror public dependencies. See the [Composer project setup guide](https://packagist.com/docs/setup).

For a public repository, submit it to [Packagist.org](https://packagist.org/); Packagist will install Git tags as Composer versions.

After publishing, the package can be installed with:

```
composer require corecaching/core-caching
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

Every ~0 days

Total

9

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2efe4ca3aa09c9ce10f04713fd02d58662b251a72a9ee6b148cd143019ef1ce6?d=identicon)[dev-raj-shekhar](/maintainers/dev-raj-shekhar)

---

Top Contributors

[![dev-raj-shekhar](https://avatars.githubusercontent.com/u/31485815?v=4)](https://github.com/dev-raj-shekhar "dev-raj-shekhar (1 commits)")

---

Tags

laravelbackupcrmtelegramemail-credits

### Embed Badge

![Health badge](/badges/corecaching-core-caching/health.svg)

```
[![Health](https://phpackages.com/badges/corecaching-core-caching/health.svg)](https://phpackages.com/packages/corecaching-core-caching)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k113.1M962](/packages/laravel-socialite)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.4M352](/packages/psalm-plugin-laravel)[spatie/laravel-export

Create a static site bundle from a Laravel app

679153.2k6](/packages/spatie-laravel-export)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1239.7k25](/packages/fleetbase-core-api)[api-platform/laravel

API Platform support for Laravel

58174.6k18](/packages/api-platform-laravel)

PHPackages © 2026

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