PHPackages                             p4scu41/basecrudapi - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. p4scu41/basecrudapi

ActivePackage[HTTP &amp; Networking](/categories/http)

p4scu41/basecrudapi
===================

Base clases to API RESTful.

1.0.2(7y ago)06MITPHPPHP ^7.1.3

Since Jun 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/p4scu41/basecrudapi)[ Packagist](https://packagist.org/packages/p4scu41/basecrudapi)[ Docs](https://github.com/p4scu41/basecrudapi)[ RSS](/packages/p4scu41-basecrudapi/feed)WikiDiscussions master Synced 2mo ago

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

BaseCRUDApi
===========

[](#basecrudapi)

Base clases to API RESTful.

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

[](#installation)

Install via composer

```
composer require p4scu41/basecrudapi
```

### Register Service Provider

[](#register-service-provider)

**Note! This and next step are optional if you use laravel&gt;=5.5 with package auto discovery feature.**

Add service provider to `config/app.php` in `providers` section

```
p4scu41\BaseCRUDApi\BaseCRUDApiServiceProvider::class,
```

### Publish Configuration File

[](#publish-configuration-file)

```
php artisan vendor:publish --provider="p4scu41\BaseCRUDApi\BaseCRUDApiServiceProvider" --tag="config"
```

### Config Vendors

[](#config-vendors)

```
* Laravel Activitylog [https://github.com/spatie/laravel-activitylog]
    - php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider"
    - Take a look at config/activitylog.php before run migration
    - php artisan migrate
    - Add in .env ACTIVITY_LOGGER_ENABLED=true
* Laravel 5 Repositories [https://github.com/andersao/l5-repository]
    - In your config/app.php add Prettus\Repository\Providers\RepositoryServiceProvider::class to the end of the providers array
    - php artisan vendor:publish --provider "Prettus\Repository\Providers\RepositoryServiceProvider"
    - Take a look at config/repository.php
* PHP Performance tool [https://github.com/bvanhoekelen/performance]
    - In app/Http/Kernel.php add \p4scu41\BaseCRUDApi\Http\Middleware\PerformanceLoggerFinish::class, at the end of the $middleware array
    - You can handle the performance logger in the controller with is_tracking_performance = true, you can add exceptions with except_track_performance array and enable the queries log with is_query_log = true
* LERN (Laravel Exception Recorder and Notifier) [https://github.com/tylercd100/lern#lern-laravel-exception-recorder-and-notifier]
    - php artisan vendor:publish --provider="Tylercd100\LERN\LERNServiceProvider"
    - Take a look at config/lern.php before run migration
    - php artisan migrate
* Laravel Stats Tracker [https://github.com/antonioribeiro/tracker]
    - In your config/app.php add PragmaRX\Tracker\Vendor\Laravel\ServiceProvider::class to the end of the providers array
    - php artisan vendor:publish --provider=PragmaRX\\Tracker\\Vendor\\Laravel\\ServiceProvider
    - By default everything is disabled you need to decide what you want to log. Take a look at config/tracker.php and eneable some options:
    ```php
        'enabled' => true,
        'use_middleware' => true,
        'do_not_track_paths' => [
            // 'api/*',
        ],
        'do_not_track_ips' => [
            '127.0.0.0/24', // Local: range 127.0.0.1 - 127.0.0.255
            '192.168.0.0/24', // Megacable
            '192.168.1.0/24', // Infinitum
        ],
        'log_untrackable_sessions' => false,
        'log_enabled' => true,
        'console_log_enabled' => true,
        'geoip_database_path' => storage_path('geoip'),
        'log_geoip' => true,
        'log_user_agents' => true,
        'log_users' => true,
        'log_devices' => true,
        'log_languages' => true,
        'log_referers' => true,
        'log_paths' => true,
        'log_queries' => true,
        'log_routes' => true,
        'user_model' => p4scu41\BaseCRUDApi\Models\User::class,
        'stats_panel_enabled' => true,
    ```
    - Add \PragmaRX\Tracker\Vendor\Laravel\Middlewares\Tracker::class to the array $middleware in app/Http/Kernel.php
    - Create a database connection called tracker in config/database.php
    - php artisan tracker:tables
    - php artisan migrate
    - composer require geoip2/geoip2
    - php artisan tracker:updategeoip
    - sudo chmod -R 777 storage/geoip/
    - git clone https://github.com/BlackrockDigital/startbootstrap-sb-admin-2.git public/templates/sb-admin-2
    - cd public/templates/sb-admin-2
    - git checkout tags/v3.3.7+1
    - git checkout -b v3.3.7+1
    - sudo npm install -g bower
    - bower install
    - sudo npm install --global gulp-cli
    - gulp
* CORS Middleware for Laravel 5 [https://github.com/barryvdh/laravel-cors]
* JSON Web Token Authentication for Laravel & Lumen [https://github.com/tymondesigns/jwt-auth]
    - In your app/Http/Kernel.php add 'jwt.validation' => \p4scu41\BaseCRUDApi\Http\Middleware\JWTAuthValidation::class to the end of the routeMiddleware array

```

### Configuration

[](#configuration)

In your config/app.php add p4scu41\\BaseCRUDApi\\Providers\\ResponseMacroServiceProvider::class to the end of the providers array

If you would like to add the JWT incorporated, change all the references to the model User to p4scu41\\BaseCRUDApi\\Models\\User::class in the directory config

Usage
-----

[](#usage)

CHANGE ME

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

3

Last Release

2899d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/79585a15108357d2dac9e47fbebdccd45b0a1e157cce69f93b46978c28e92d43?d=identicon)[p4scu41](/maintainers/p4scu41)

---

Tags

api-restlaravelphpapilaravelrestrestfulp4scu41basecrudapi

### Embed Badge

![Health badge](/badges/p4scu41-basecrudapi/health.svg)

```
[![Health](https://phpackages.com/badges/p4scu41-basecrudapi/health.svg)](https://phpackages.com/packages/p4scu41-basecrudapi)
```

###  Alternatives

[lomkit/laravel-rest-api

A package to build quick and robust rest api for the Laravel framework.

59152.2k](/packages/lomkit-laravel-rest-api)[francescomalatesta/laravel-api-boilerplate-jwt

An API Boilerplate to create a ready-to-use REST API in seconds.

1.2k7.5k](/packages/francescomalatesta-laravel-api-boilerplate-jwt)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[guanguans/laravel-api-response

Normalize and standardize Laravel API response data structure. - 规范化和标准化 Laravel API 响应数据结构。

485.6k](/packages/guanguans-laravel-api-response)[xtend-packages/rest-presenter

REST API Presenter &amp; Generator for Laravel

771.5k](/packages/xtend-packages-rest-presenter)

PHPackages © 2026

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