Download the PHP package ozankurt/laravel-modules-core without Composer

On this page you can find all versions of the php package ozankurt/laravel-modules-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-modules-core

laravel-modules-core

tests

Shared bootstrap kit for KurtModules Laravel packages.

Requirements

Installation

What it provides

Configuration

Publish the config file:

Command & enum helpers

Guard demo/destructive Artisan commands so they cannot run in production without --force:

Give a string-backed enum Filament-ready labels/colors without Core depending on Filament (the enum declares the contracts, the trait supplies the bodies):

API kit

A config-convention-driven foundation for a module's out-of-the-box REST API. It generalises the loyalty.http.mode pattern so every module exposes a JSON API the same way, safe-by-default: nothing is registered until a consumer opts in, and write routes require auth + a Policy.

Config convention

Every consuming module reads these per-module keys (module slug = the value returned by the provider's module()):

Key Default Purpose
{slug}.http.mode headless headless | api | ui. API routes register only for api/ui.
{slug}.http.prefix api/{slug} URL prefix for the route group.
{slug}.http.middleware ['api'] Base middleware for every API route.
{slug}.http.auth_middleware ['auth'] Appended to write (authenticated) routes.
{slug}.http.rate_limit '60,1' maxAttempts,decayMinutes for the {slug}-api throttle.

Every group is throttled by a named limiter {slug}-api (keyed by user id, or client IP for guests). A module's config/{slug}.php therefore ships:

Base classes

Resources vs envelope helpers

The envelope's top-level key is data, matching Laravel API Resources. Use Laravel resources directly (Core ships no resource base) and hand the result of a resource to the envelope helpers so the payload is wrapped exactly once:

Do not return a bare JsonResource from a route and also call respond() — that double-wraps as {"data":{"data":…}}.

How a module exposes an API

  1. Config — add the http block above to config/{slug}.php; keep mode defaulting to headless.
  2. Resources — define App-style JsonResource classes for your models.
  3. Controller — extend ApiController; keep controllers thin over domain services. use HandlesApiQuery on index controllers for sort/filter/paginate. Enforce a Policy on every write ($this->authorize(...)).
  4. Routes — routes/api.php, read vs write split via ApiRouteGroup::attributes():

  5. Provider — wire it in packageBooted(); it is a no-op in headless mode and registers the rate limiter + route group otherwise:

The outer group (prefix, base middleware, throttle, "{slug}.api." name prefix) is applied by registerModuleApi(); the route file only distinguishes read vs write.

Testing

CI runs the same checks on every push and pull request (.github/workflows/tests.yml), against PHP 8.4 / Laravel 13. Static analysis is held at PHPStan level 8; the suite runs on Pest 5.

License

MIT © Ozan Kurt


All versions of laravel-modules-core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/contracts Version ^13.0
illuminate/database Version ^13.0
illuminate/support Version ^13.0
spatie/laravel-package-tools Version ^1.93
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ozankurt/laravel-modules-core contains the following files

Loading the files please wait ...