PHPackages                             rush-app/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. rush-app/core

ActiveLibrary

rush-app/core
=============

Library for simplifying development on Laravel.

0.0.2(5y ago)12821PHPPHP ^7.3|^8.0

Since Mar 28Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Rush-App/laravel-core)[ Packagist](https://packagist.org/packages/rush-app/core)[ RSS](/packages/rush-app-core/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

RushApp Core package
--------------------

[](#rushapp-core-package)

Extending Laravel Model and Controller to simplify setup CRUD operations.

Installation guide:
-------------------

[](#installation-guide)

1. Install "Core" package with composer: `composer require rush-app/core`
2. Run installation command (this will publish config and language files): `php artisan core:install`
3. Run migrations: `php artisan migrate`

Example for creating CRUD operations with translation:
------------------------------------------------------

[](#example-for-creating-crud-operations-with-translation)

1. Create endpoint for entity (you can use Laravel resource routes):

```
Route::resource('posts', 'PostController');
```

2. Create migration:

2.1. Create posts table:

```
Schema::create('posts', function (Blueprint $table) {
   $table->id();
   $table->boolean('published')->default(false);
   $table->timestamp('published_at')->nullable();
   $table->foreignId('user_id');
   $table->timestamps();
});
```

2.2. Create post\_translations table (IMPORTANT: name of translation table should be set in format: \_translations) Note that you should use "language\_id" key for relation with languages table:

```
Schema::create('post_translations', function (Blueprint $table) {
   $table->id();
   $table->string('title')->nullable();
   $table->string('description')->nullable();
   $table->foreignId('post_id')->constrained()->onDelete('cascade');
   $table->foreignId('language_id');
});
```

3. Create model (with translation model): 3.1. Post model:

```
    class Post extends RushApp\Core\Models\BaseModel
    {
       use HasFactory;

       protected $fillable = [
          'published',
          'published_at',
          'user_id',
       ];

       protected $dates = [
            'published_at',
       ];

       public function user(): BelongsTo
       {
            return $this->belongsTo(User::class);
       }
    }
```

3.2. PostTranslation model (IMPORTANT: use name for translation model in format: model class with suffix "Translation") Note that you should use "language\_id" key for relation with languages table.

```
    class PostTranslation extends RushApp\Core\Models\BaseModel
    {
       use HasFactory;

       protected $fillable = [
          'title',
          'description',
          'post_id',
          'language_id',
       ];

       public $timestamps = false;
    }
```

4. Create CRUD controller:

```
    class PostController extends RushApp\Core\Controllers\BaseController
    {

       // The name of the model must be indicated in each controller
       protected string $modelClassController = Post::class;

       // FormRequest class for validation store process.
       protected ?string $storeRequestClass = StorePostRequest::class;

       // FormRequest class for validation update process.
       protected ?string $updateRequestClass = UpdatePostRequest::class;

       // Relations of model that can be attached to response (available for 'index' and 'show' method).
       // NOTE: this names should be the same with method in model (Eloquent relations).
       protected array $withRelationNames = [
            'user',
       ];
    }
```

Role management system
----------------------

[](#role-management-system)

IMPORTANT: To use role management system you need to define middleware "check-user-action" for route. There are such tables that are responsible for role management system:

1. roles - Contains role names which available for users. Roles can be attach to user with user\_role table.
2. actions - Contains action\_name and entity\_name. Action name defined as config rushapp\_core.action\_names and they match for CRUD operation names. Entity name - name of entity tables (example: posts, categories, etc.). Actions can be attached to roles with role\_action table. Example: If role "Admin" contains action with action\_name "index", "show", "store" and entity\_name "posts" this means that user with such role can get all posts and create new post. And any other CRUD operations ("update", "destroy") are forbidden.
3. properties - Contains columns for custom permission logic. There is one property predefined and provides by package: "is\_owner". This property used to mark that CRUD operation can be performed only by owner By default it will check "user\_id" as owner identifier. Example: If is\_owner is true and linked to action this means that CRUD operations can be performed only by owner (except "store" operation), but if is\_owner is false this means that ownership will be not checked for CRUD operations. This can be used, for "Admin" roles, which can perform CRUD operations for any entity. NOTE: If is\_owner is true for "index" operation this means that user will get only entities where he set as owner.

Additional abilities for requests
---------------------------------

[](#additional-abilities-for-requests)

1. To perform CRUD operations with specified language, you need to set "Language" key in request header.
2. Filtering abilities for "index" or "show" requests:

- "paginate" Example: [http://127.0.0.1:8000/posts?paginate=2&amp;page=1](http://127.0.0.1:8000/posts?paginate=2&page=1)
- "order\_by\_field" Example: [http://127.0.0.1:8000/posts?order\_by\_field=year:desc](http://127.0.0.1:8000/posts?order_by_field=year:desc)
- "with" Example: [http://127.0.0.1:8000/posts?with=user:id,email|categories:id,title](http://127.0.0.1:8000/posts?with=user:id,email%7Ccategories:id,title) . Where "user" and "categories" are model relation names and all parameters after ":" are relation fields. NOTE: If you want to get specified fields "id" field is required or you can keep it without any specific fields to get all entity fields
- "limit" Example:
- "selected\_fields" Example: [http://127.0.0.1:8000/posts?selected\_fields=year,id,name](http://127.0.0.1:8000/posts?selected_fields=year,id,name)
- "where\_not\_null" Example: [http://127.0.0.1:8000/posts?where\_not\_null=year,id,name](http://127.0.0.1:8000/posts?where_not_null=year,id,name)
- "where\_null" Example: [http://127.0.0.1:8000/posts?where\_null=year,id,name](http://127.0.0.1:8000/posts?where_null=year,id,name)
- "where\_between" Example: [http://127.0.0.1:8000/posts?where\_between=year:2018,2020|create\_at:2020-01-01,2021-01-01](http://127.0.0.1:8000/posts?where_between=year:2018,2020%7Ccreate_at:2020-01-01,2021-01-01)
- "where\_in" Example: [http://127.0.0.1:8000/posts?where\_in=year:2018,2014,2020|user\_id:2,2,5,6](http://127.0.0.1:8000/posts?where_in=year:2018,2014,2020%7Cuser_id:2,2,5,6)
- "where\_not\_in" Example: [http://127.0.0.1:8000/posts?where\_not\_in=year:2018,2014,2020|user\_id:2,2,5,6](http://127.0.0.1:8000/posts?where_not_in=year:2018,2014,2020%7Cuser_id:2,2,5,6)
- "offset" Example:

Registration and authorization
------------------------------

[](#registration-and-authorization)

1. Registration example. Returns JWT token (\['token' =&gt; 'test-token'\]) // TODO
2. To perform authorization you can add route with BaseAuthController, example: `php Route::post('login', [\RushApp\Core\Controllers\BaseAuthController:class,'login']);`It returns JWT token (\['token' =&gt; 'test-token'\]). To perform authorization request you need to set "email" and "password" fields.

P.S.
----

[](#ps)

Detailed examples can be found here:

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% 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

2

Last Release

1877d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e6d9d44c074266619a53f1a438297df3ff5f624bf6720645b131b0a956e41ed?d=identicon)[Rush-App](/maintainers/Rush-App)

---

Top Contributors

[![bokoch](https://avatars.githubusercontent.com/u/9802540?v=4)](https://github.com/bokoch "bokoch (25 commits)")[![Alexander-Kochubei](https://avatars.githubusercontent.com/u/32341377?v=4)](https://github.com/Alexander-Kochubei "Alexander-Kochubei (19 commits)")[![Rush-App](https://avatars.githubusercontent.com/u/81528312?v=4)](https://github.com/Rush-App "Rush-App (1 commits)")

### Embed Badge

![Health badge](/badges/rush-app-core/health.svg)

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

PHPackages © 2026

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