PHPackages                             devil999/solidgenerator - 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. [Framework](/categories/framework)
4. /
5. devil999/solidgenerator

ActiveLibrary[Framework](/categories/framework)

devil999/solidgenerator
=======================

Solid Generator generates solid code with controller api resources, custom request, with repo pattern, migrations based on model\_schema\_json file with admin panel for blade etc..

v1.1(1y ago)00MITJavaScript

Since Feb 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/kaushalbro/solid-generator)[ Packagist](https://packagist.org/packages/devil999/solidgenerator)[ RSS](/packages/devil999-solidgenerator/feed)WikiDiscussions master Synced 1mo ago

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

Package: devil999/solidgenerator:

```
 Solid Generator generates solid code with controller api resources, custom request, with repo pattern, migrations based on model_schema_json file  with admin panel for blade etc..
 Note: For better result:
        Think to design software and write your schema
        according in model_schema_json.json file formate stored in root path and run solid:make commands
    AdminLte is being used for admin panel/dashboard:
    Laravel breeze for Auth is necessary:
    Analyse the output files and complete your project with ease.

```

#### For collaboration or contribution: Mail to:

[](#for-collaboration-or-contribution-mail-to-officialkaushalgdevilgmailcom)

Initial Required packages:

```
laravel breeze, spatie (for roles, logs, etc,)
installation:
        composer require laravel/breeze --dev  OR php artisan breeze:install blade
        composer require spatie/laravel-permission

```

Register Service Provider :

```
Laravel 11 :
        Add :    SolidPrincipleServiceProvider::class to bootstrap/providers.php
    Laravel 10 : Find you self

Public solid-generator assets :    php artisan vendor:publish --tag=solid-app
Globle :   php artisan solid:make --publish

Help: php artisan solid:make -h

```

Operations:

```
Role and permission (options)
Steps: 1)(Optional): Add:
        the below code in app/Providers/AuthServiceProvider.php inside boot function at last
        Gate::before(function ($user, $ability) {
            return ($user->super_admin == 1 && $user->status == 1) ? true : null;
       });

    For laravel 10:
        Steps: 2): Add: following inside app/Kernel inside: protected $routeMiddleware = [] at last, like
        protected $routeMiddleware = [
        '...'=>'...',
        '...'=>'...',
        '...'=>'...',
        'role' => \Spatie\Permission\Middlewares\RoleMiddleware::class,
        'permission' => \Spatie\Permission\Middlewares\PermissionMiddleware::class,
        'role_or_permission' => \Spatie\Permission\Middlewares\RoleOrPermissionMiddleware::class,
        ]
    For laravel 11: find spatie way to add middleware alias

        Steps: 3) Add: trait 'HasRoles' in User Model;

        Steps: 5) Seed:  UserRolePermissionSeeder; command here   php artisan db:seed --class=UserRolePermissionSeeder

```

First test command after setup :

```
php artisan solid:make --crud

// This will Generates Following files: Example for api enabled and repo design patter, Vary in Configuration you provides

1. Traits FileManager.php . // to manage file uploading
2. Traits Api_Response.php . // to manage api response
3. Interfaces SolidInterface.php File.
4. Repositories SolidBaseRepository.php File.
5. Models DemoProduct.php File.
6. Repositories DemoProductRepository.php File.
7. API CreateDemoProductRequest.php File.
8. Controllers DemoProductController.php File.
9. migrations 2025_02_02_070024_create_demoproducts_table.php File.
Resources:
    10. DemoProductListResource.php File.
    11. DemoProductCreateResource.php File.
    12. DemoProductShowResource.php File.
    13. DemoProductEditResource.php File.

Notice incide configuration file:   'design_pattern'=> "repository", //Design patterns are : none or repository

```

Global function :

```
app('sidebar')

```

`Commands: (depends on solid configuration file)`

```
  php artisan solid:make {model_name? : Optional model_name parameter}

             {--config|config : Generate Package configuration }
             {--crud|crud : Generate Plain CRUD files }
             {--api|api : Generate api resources}
             {--repo-crud|repo-crud : Generate CRUD files for Repository design pattern }
             {--m|model : Generate model}
             {--view|view : Generate model}
             {--c|controller : Generate Controller }
             {--i|interface : Generate interface}
             {--re|repo  : Generate repository}
             {--mi|migration  : Generate migration}
             {--r|request : Generate custom request}
             {--ro|route : Generate routes}
             {--layout|layout  } layout_type? : Generate Layout}
             {--newAdminPanel|new-admin-panel : Generate fresh Admin panel}
             {--publish|publish : Generate Publish files }
             {--h|help}
             {--t|test}

```

`Config : config/solid.php`

```
////////////////////////////////////////////////////////////////////////////
//                                                                        //
//                   WARNING :  DEVIL000/SOLID - PACKAGE                  //
//            DO NO ALTER DEFAULT CONFIGURATION UNLESS REQUIRED           //
//                   ALTERING HERE MAY CAUSE MALFUNCTION                  //
//                                                                        //
////////////////////////////////////////////////////////////////////////////
//--NOTE:NOTE--//
////////////////////////////////////////////////////////////////////////////
//                                                                        //
//         All Directory Name pattern should match the pattern below      //
//                                                                        //
////////////////////////////////////////////////////////////////////////////

'modular_app'=>false, // If the app is built on top of module based system design. (Coming soon...)
'model_schema_json_path' => base_path("model_schema_json.json"),  // root path/base_path
'is_api' => true,  // Is this application is developing an api's.
'api_with_resource_classes'=>true,  // Depends on is_api, This will create an api resources for models if is_api is true.
'react_with_inertia'=>false, // coming soon...
'model_path' => "app/Models",
'controller_path' => "app/Http/Controllers",
'api_resources_path' => "app/Http/Resources",
'request_path'=>"app/Http/Requests",
'view_path' =>"resources/views",  // When is_api is true this will be disabled automatically.
'migration_path'=>"database/migrations", // Migration Path
'seeder_path'=>"database/seeders",   // Seeder Path
'backend_admin_view_path' => "resources/views/backend/admin",  // Storage for View files of Admin/backend.
'frontend_view_path' => "resources/views/frontend",  // Storage for View files of Frontend.
// Configuration for Repository design pattern
'design_pattern'=> "repository", //Design patterns are : none or repository
'interface_path' => "app/Interfaces",  // Interface Path
'repo_path' => "app/Repositories",   // Repository Path
'base_interface_name' => "SolidInterface",  // Base Interface name
'base_repository_name' => "SolidBaseRepository",  // Base Repository name
// Other Configuration
'show_file_already_exists_warning' => false,  //
'show_folder_already_exists_warning' => false,
// Override created file : This may delete the contents of previous file generated by SOLID (Not applied Yet)
'override_previous_file_data' => false,
"carbon_immutable" => true

```

Bugs:
=====

[](#bugs)

```
1. By default, the middlware function are applied in Controller files
   you need to remove it manually if you dont use auth and spatie permission package

```

Sidebar Configuration Documentation
===================================

[](#sidebar-configuration-documentation)

This documentation describes how to use the `SideBar::add() OR route: localhost://sidebar` method to create a custom sidebar configuration with multiple options, including sub-links, icons, visibility, permissions, and active routes.

Sidebar Configuration Example
-----------------------------

[](#sidebar-configuration-example)

### Adding a Sidebar

[](#adding-a-sidebar)

The following example demonstrates how to add a "Product" on sidebar with its associated sub-links:

php

```
SideBar::add('Product', Product::class) //$model is optional
    ->icon('fa-brands fa-product-hunt')
    ->route('') //optional
    ->title('Product')
    ->group('Purchase') // group under the 'Purchase' category # default is core
    ->hide(true)
    ->permission(true)
    ->activeOnRoutes('admin/products/mainSidebar')
    ->subLinks(
        SubLink::add('Add Product')
            ->icon('fa-solid fa-plus')
            ->route('/admin/products/create')
            ->hide(true)
            ->permission(true)
            ->activeOnRoutes('/products/other_route'),
        SubLink::add('List Products')
            ->icon('fa-solid fa-list')
            ->route('/admin/products')
            ->hide(true)
            ->permission(true)
            ->activeOnRoutes(['admin/products\other_list])
    );

```

### Breakdown of the Configuration

[](#breakdown-of-the-configuration)

#### Adding Sidebar:

[](#adding-sidebar)

- `SideBar::add('Product')`: This creates a new sidebar item titled "Product".

#### Sidebar Properties:

[](#sidebar-properties)

- `->group('Purchase')`: Sets the sidebar item’s icon using Font Awesome. Here, it uses the "fa-product-hunt" icon.
- `->icon('fa-brands fa-product-hunt')`: Sets the sidebar item’s icon using Font Awesome. Here, it uses the "fa-product-hunt" icon.
- `->route('')`: Defines the route for the sidebar item. In this case, the route is left blank, which can be configured based on your needs.
- `->title('Product')`: The title that appears on the sidebar. It is set as "Product".
- `->hide(true)`: Specifies that the sidebar item is visible. Set to `true` to make it visible.
- `->permission(true)`: Specifies that the sidebar item is available for users with permission. Set to `true` to allow access.
- `->activeOnRoutes('admin/products/mainSidebar')`: Defines the route(s) where this sidebar item should be marked as active. In this case, it is active when the route matches `admin/products/mainSidebar`.

### Sub Links

[](#sub-links)

The sidebar item can have multiple sub-links. These sub-links are defined using the `subLinks()` method.

#### Add Product Sub-Link:

[](#add-product-sub-link)

php

```
SubLink::add('Add Product')
    ->icon('fa-solid fa-plus')
    ->route('/admin/products/route_create11')
    ->hide(true)
    ->permission(true)
    ->activeOnRoutes('/kaushala/products/active_on_create1')

```

- `SubLink::add('Add Product')`: Creates a sub-link titled "Add Product".
- `->icon('fa-solid fa-plus')`: Sets the icon for the sub-link. In this case, it's a plus icon.
- `->route('/admin/products/route_create11')`: Specifies the route for this sub-link.
- `->hide(true)`: Makes the sub-link visible.
- `->permission(true)`: Grants permission for the sub-link.
- `->activeOnRoutes('/kaushala/products/active_on_create1')`: Marks the sub-link as active for the specified route.

#### List Products Sub-Link:

[](#list-products-sub-link)

php

```
SubLink::add('List Products')
    ->icon('fa-solid fa-list')
    ->route('/admin/products/route_create')
    ->hide(true)
    ->permission(true)
    ->activeOnRoutes(['hari/admin/products+a'])

```

- `SubLink::add('List Products')`: Creates another sub-link titled "List Products".
- `->icon('fa-solid fa-list')`: Sets the icon for the sub-link as a list icon.
- `->route('/admin/products/route_create')`: Specifies the route for the "List Products" sub-link.
- `->hide(true)`: Ensures the sub-link is visible.
- `->permission(true)`: Grants permission for the sub-link.
- `->activeOnRoutes(['hari/admin/products+a'])`: Marks the sub-link as active for the specified route(s).

Method Details
--------------

[](#method-details)

### `SideBar::add($name)`

[](#sidebaraddname)

- **Description**: Adds a new sidebar item.
- **Parameters**:
    - `$name`: The title of the sidebar item (e.g., 'Product').

### `->icon($icon)`

[](#-iconicon)

- **Description**: Sets the icon for the sidebar item.
- **Parameters**:
    - `$icon`: The Font Awesome class for the icon (e.g., 'fa-brands fa-product-hunt').

### `->route($route)`

[](#-routeroute)

- **Description**: Defines the route for the sidebar item.
- **Parameters**:
    - `$route`: The route URL for the sidebar item (can be a string or a route name).

### `->title($title)`

[](#-titletitle)

- **Description**: Sets the title text that will be displayed for the sidebar item.
- **Parameters**:
    - `$title`: The title of the sidebar item (e.g., 'Product').

### `->hide($hide)`

[](#-hidehide)

- **Description**: Controls the hide of the sidebar item.
- **Parameters**:
    - `$hide`: `true` to make the item visible, `false` to hide it.

### `->permission($permission)`

[](#-permissionpermission)

- **Description**: Determines whether the sidebar item is accessible based on user permissions.
- **Parameters**:
    - `$permission`: `true` if the item is accessible, `false` if not.

### `->activeOnRoutes($routes)`

[](#-activeonroutesroutes)

- **Description**: Defines the routes where the sidebar item will be marked as active.
- **Parameters**:
    - `$routes`: A string or an array of route names or URLs.

### `subLinks($subLinks)`

[](#sublinkssublinks)

- **Description**: Adds sub-links to the sidebar item.
- **Parameters**:
    - `$subLinks`: An array of `SubLink` instances, each representing a sub-link.

SubLink Configuration
---------------------

[](#sublink-configuration)

### Example SubLink Method:

[](#example-sublink-method)

php

```
SubLink::add('Link Name')
    ->icon('fa-solid fa-icon')
    ->route('/link/route')
    ->hide(true)
    ->permission(true)
    ->activeOnRoutes('/route/active_on_link');

```

### SubLink Method Details:

[](#sublink-method-details)

- `SubLink::add($name)`: Adds a sub-link with the specified name.
- `->icon($icon)`: Sets the icon for the sub-link.
- `->route($route)`: Defines the route for the sub-link.
- `->hide($hide)`: Controls the visibility of the sub-link.
- `->permission($permission)`: Specifies whether the sub-link is available based on permissions.
- `->activeOnRoutes($routes)`: Marks the sub-link as active for the given route(s).

### Blade Code for Frontend here:

[](#blade-code-for-frontend-here)

```
@foreach(app('sidebar') as $key_1 => $group)
    @if($key_1 != 'core')

        {{ $key_1 }}
        // Handle other logic here
    @endif

    @foreach(app('sidebar')[$key_1] as $key => $main_link)
        @if( $main_link['hide'] && $main_link['permission'])
            // Handle main link logic here

            @if(count($main_link['sub_links']) > 0)
                @foreach($main_link['sub_links'] as $key_sub_link => $sub_link)
                    @if($sub_link['hide'] && $sub_link['permission'])
                        // Handle sub-link logic here
                    @endif
                @endforeach
            @endif
        @endif
    @endforeach
@endforeach

```

### JS Code for frontend

[](#js-code-for-frontend)

```
const sidebar = app('sidebar'); // Assuming 'sidebar' is available in your app context

Object.keys(sidebar).forEach(key_1 => {
    if (key_1 !== 'core') {

        // Handle group logic here
    }

    sidebar[key_1].forEach(main_link => {
        if (main_link.hide && main_link.permission) {
            // Handle main link logic here

            if (main_link.sub_links && main_link.sub_links.length > 0) {
                main_link.sub_links.forEach(sub_link => {
                    if (sub_link.hide && sub_link.permission) {
                        // Handle sub-link logic here
                    }
                });
            }
        }
    });
});

```

```

This version includes more detailed descriptions and is structured for better readability.
Let me know if you need any further enhancements!

```

### Future Implementation Grouping like this. coming soon...

[](#future-implementation-grouping-like-this-coming-soon)

```
On App :
    Generate factory generator for every model.
On sidebar:
         SideBar::group('setting',function(){
                     SideBar::add('User Management')
                         ->icon('fa-solid fa-users')
                         ->subLinks(
                             SubLink::add('Users', User::class)
                                 ->icon('fa-solid fa-user ')
                                 ->route('/admin/users'),
                             SubLink::add('Roles', Role::class)
                                 ->icon('fa-solid fa-user ')
                                 ->route('/admin/roles')
                         );
                     SideBar::add('User Management')
                         ->icon('fa-solid fa-users')
                         ->subLinks(
                             SubLink::add('Users', User::class)
                                 ->icon('fa-solid fa-user ')
                                 ->route('/admin/users'),
                             SubLink::add('Roles', Role::class)
                                 ->icon('fa-solid fa-user ')
                                 ->route('/admin/roles')
                         );
         });

```

`Data formate`

```
[
  {
    "model_name": "DemoProduct",
    "model_attributes": {
      "db_rules": [
        "product_code:string|required|unique",
        "type:enum(inventory,service)|required",
        "name:string|required",
        "category_id:foreign_key|required",
        "sku_code:string|nullable|unique",
        "brand:string|nullable",
        "unit:string|required",
        "units:string|nullable",
        "description:text|nullable",
        "status:enum(active,inactive)|required",
        "variation:boolean|default:false",
        "image:file|nullable",
        "supplier_id:foreign_key",
        "purchase_unit:string|nullable|required",
        "reorder_threshold_quantity:float|nullable",
        "selling_price:float|required",
        "selling_unit:string|nullable|required",
        "discount_amount:float|nullable"
      ],
      "request_rules": [
        "product_code:required|string|min:2|max:50",
        "type:required|in:inventory,service",
        "name:required|string|min:2|max:255",
        "category_id:required|int",
        "sku_code:nullable|string|min:2|max:50",
        "brand:nullable|string|max:100",
        "unit:required|string|max:50",
        "units:nullable|string|max:255",
        "description:nullable|string",
        "status:required|in:active,inactive",
        "variation:nullable|boolean",
        "image:nullable|file|mimes:jpeg,png,jpg|max:2048",
        "supplier_id:nullable|integer|exists:suppliers,id",
        "purchase_unit:nullable|string|max:50",
        "reorder_threshold_quantity:nullable|numeric|min:0",
        "selling_price:required|numeric|min:0",
        "selling_unit:nullable|string|max:50",
        "discount_amount:nullable|numeric|min:0"
      ]
    }
  }
]

```

For local development
---------------------

[](#for-local-development)

```
 Add second line for psr-4 in composer.json file:

    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/",
            "Devil\\Solidprinciple\\": "packages/solid-generator/src"
        }
    },

 Then :
    php artisan clear-compiled
    composer dump-autoload
    php artisan optimize

```

### Filter params required from frontend

[](#filter-params-required-from-frontend)

```
 {
  "results": "10", //limit
  "page": "1",
  "search": "cat", //searched term
  "columns": [  // colums for search term  like: $query->where("$col","LIKE", "%$search%");
    "name",
    "description",
    null
  ],
  "pagination": {   // Pagination Info
    "current": "1",
    "pageSize": "10",
    "pageSizeOptions": [
      "10",
      "20",
      "25",
      "50",
      "100",
      "1000"
    ],
    "showSizeChanger": "true",
    "tooltip": "false",
    "total": "514254"  // total data: comes from server
  },
  "sortOrder": "descend",   //sort by
  "sortField": "name"       //sorting field
}

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance44

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~10 days

Total

2

Last Release

460d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc664058bd0eb2b11a56db77fbce1f1ce686cc3397cb04b8ff200e6f9af5f33a?d=identicon)[kaushal ghimire](/maintainers/kaushal%20ghimire)

---

Top Contributors

[![kaushalbro](https://avatars.githubusercontent.com/u/60461681?v=4)](https://github.com/kaushalbro "kaushalbro (20 commits)")

### Embed Badge

![Health badge](/badges/devil999-solidgenerator/health.svg)

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

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