larajs/core

There is no license information available for the latest version (2.0.0) of this package.

2.0.0 2025-06-08 07:50 UTC

This package is auto-updated.

Last update: 2025-07-08 08:09:18 UTC


README

Latest Version PHP Version Total Downloads

LaraJS Core is a PHP package providing core functionalities for Laravel applications, designed to streamline development and integrate seamlessly with JavaScript frontends.

Overview

This package includes:

  • Base controller (BaseLaraJSController)
  • Helper functions (Helper.php)
  • Middleware for language handling (LangMiddleware) and request/response logging (LogRequestResponse)
  • File service (FileService)
  • Traits for actions (Action.php) and user signatures (UserSignature.php)
  • Artisan commands for generating boilerplate code.

Installation

You can install the package via composer:

composer require larajs/core

The package will automatically register its service provider.

Usage

Service Provider

The package's service provider LaraJS\Core\LaraJSCoreServiceProvider is auto-discovered and registered.

Available Artisan Commands

This package provides several Artisan commands to help you generate common classes:

  • php artisan larajs:generate-action {name} - Generates a new action class.
  • php artisan larajs:generate-controller {name} - Generates a new controller class.
  • php artisan larajs:generate-repository {name} - Generates a new repository class.
  • php artisan larajs:setup - Sets up the necessary files and configurations for LaraJS Core.

Controllers

Extend LaraJS\Core\Controllers\BaseLaraJSController for your controllers to leverage base functionalities.

Helpers and Services

Utilize helpers and services provided in the LaraJS\Core\Helpers and LaraJS\Core\Services namespaces.

Contributing

Please see CONTRIBUTING for details. (You might want to create a CONTRIBUTING.md file)

License

The MIT License (MIT). Please see License File for more information.