Skip to content

Published Files

When you run an install command, Cubeta Starter publishes a set of base classes, traits, and helpers into your application. This page explains what each file is and why it's there, so you know exactly what lives in your codebase.

All published files become part of your app — you own them and can edit them freely. The package does not hide logic in vendor/.


Published by cubeta:install api and cubeta:install web

Configuration

FilePurpose
config/cubeta-starter.phpPackage configuration — paths, namespaces, locales, version. See Configuration
pint.jsonLaravel Pint formatting preset

Core Modules

FilePurpose
app/Modules/ApiResponse.phpStandardized API response builder. Used via the rest() helper. See ApiResponse
app/Helpers/helpers.phpGlobal helper functions, including rest()

Base Classes (Repository + Service pattern)

FilePurpose
app/Repositories/Contracts/BaseRepository.phpAbstract repository with CRUD, search, filtering, ordering, pagination, and Excel import/export. See BaseRepository
app/Services/Contracts/BaseService.phpAbstract service delegating to a repository. See BaseService

Resources

FilePurpose
app/Http/Resources/BaseResource/BaseResource.phpBase JSON resource all generated resources extend. See BaseResource
app/Http/Resources/BaseResource/AnonymousResourceCollection.phpCustom collection wrapper for consistent pagination formatting

Casts & Serializers

FilePurpose
app/Casts/Translatable.phpEloquent cast for translatable (multi-locale) columns
app/Casts/MediaCast.phpEloquent cast for file/media columns — handles storage and cleanup
app/Serializers/Translatable.phpValue object for reading/writing localized strings ($model->title->en). See Translatable
app/Serializers/SerializedMedia.phpValue object representing a stored file (path, url, existence)

Validation Rules

FilePurpose
app/Rules/ValidTranslatableJson.phpEnsures translatable input is flat JSON matching your configured locales
app/Rules/MediaValidationRule.phpValidates uploaded files

Excel Import/Export

FilePurpose
app/Excel/BaseExporter.phpBase exporter used by export(). See BaseExporter
app/Excel/BaseImporter.phpBase importer used by import(). See BaseImporter

Bulk Actions

FilePurpose
app/BulkAction/BaseBulkAction.phpBase class for bulk operations on multiple records. See BaseBulkAction

Middleware & Controllers

FilePurpose
app/Http/Middleware/AcceptedLanguagesMiddleware.phpSets the app locale from the Accept-Language header. Registered as the locale alias in bootstrap/app.php
app/Http/Controllers/ApiController.phpBase API controller (api install)
app/Http/Controllers/WebController.phpBase web controller (web install)
app/Http/Controllers/SetLocaleController.phpEndpoint to switch the active locale

Additionally published by cubeta:install web

The Blade stack also publishes:

FilePurpose
app/Providers/CubetaStarterServiceProvider.phpRegisters the published Blade components. Added to bootstrap/providers.php
resources/views/components/*Reusable Blade form and layout components
resources/views/includes/*Shared Blade partials
resources/views/layout.blade.phpBase dashboard layout
resources/js/*, resources/css/*Blade stack assets
.prettierignorePrettier ignore rules
lang/en/site.phpTranslation strings used by generated messages

Published by cubeta:install react-ts

The Inertia/React/TypeScript stack publishes a full dashboard toolkit under resources/js/:

PathPurpose
resources/js/components/dashboard/*Dashboard shell components
resources/js/components/datatable/*Data table with sorting, search, and pagination
resources/js/components/form/*Form field components (inputs, selects, file uploads, etc.)
resources/js/components/layouts/*Page layouts
resources/js/components/ui/*UI primitives (gallery, image preview, page cards, detail items)
resources/js/hooks/*, resources/js/providers/*, resources/js/models/*Hooks, context providers, and TypeScript models
resources/js/cubeta-starter.tsx, global.d.ts, vite-env.d.ts, helper.tsEntry point, types, and helpers
vite.config.jsVite configuration for the stack
app/Http/Middleware/HandleInertiaRequestsMiddleware.phpInertia middleware, registered in bootstrap/app.php

It also publishes the same casts, serializers, rules, base resource, ApiResponse, and Excel classes listed above.


Published by cubeta:install auth

See Usage → Install Auth Command for the full list. In summary:

FilePurpose
app/Http/Controllers/.../BaseAuthController.phpBase authentication controller you extend per actor
app/Http/Requests/AuthRequests/*Login, register, reset-password, and update-user requests
app/Http/Resources/UserResource.phpUser JSON resource
app/Models/User.phpOverwrites your User model
app/Services/User/UserService.phpAuthentication business logic (api + web)
app/Notifications/ResetPasswordCodeEmail.phpPassword-reset notification
database/migrations/..._create_users_table.phpOverwrites the users migration
Auth routes & viewsRegistered for your chosen stack

Published by cubeta:install permissions

A lightweight, self-contained authorization system (no external package). See Permissions Usage.

FilePurpose
app/Models/Role.phpRole model
app/Models/ModelHasRole.php, app/Models/ModelHasPermission.phpPivot models
app/Traits/HasRoles.phpAdds role methods (assignRole, hasRole, byRole scope, …) to a model
app/Traits/HasPermissions.phpAdds permission methods (assignPermission, hasPermission, abilities, …)
app/Interfaces/ActionsMustBeAuthorized.phpInterface for models with authorized actions
app/Exceptions/RoleDoesNotExistException.phpThrown for unknown roles
database/migrations/*Roles, permissions, and pivot tables

The Config State File

NOTE

Separate from config/cubeta-starter.php, a cubeta-starter.config.json file is created at your project root after the first generation. It records your generated tables, chosen frontend stack, and which features you've installed. The package reads it to power the GUI and make smarter generation decisions. Keep it in version control; don't edit it by hand.

Released under the MIT License.