{"id":15016883,"url":"https://github.com/savannabits/charaza-ui","last_synced_at":"2025-10-18T12:37:20.889Z","repository":{"id":37520606,"uuid":"282232663","full_name":"savannabits/charaza-ui","owner":"savannabits","description":"Lightweight Laravel 8 Admin CRUD generator and Starter template with Jetstream, Livewire and Tailwindcss Frontend","archived":false,"fork":false,"pushed_at":"2023-04-19T20:15:31.000Z","size":35664,"stargazers_count":50,"open_issues_count":4,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-26T05:41:42.418Z","etag":null,"topics":["admin-generator","charaza","charaza-ui","laravel","laravel-framework","livewire","livewire-generator","savadmin","savannabits"],"latest_commit_sha":null,"homepage":"https://savannabits.github.io/charaza-ui/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/savannabits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-24T13:53:22.000Z","updated_at":"2025-01-11T15:09:25.000Z","dependencies_parsed_at":"2024-09-16T06:01:08.830Z","dependency_job_id":"d31a97a9-b8b0-4061-b493-8445a0b5e673","html_url":"https://github.com/savannabits/charaza-ui","commit_stats":{"total_commits":37,"total_committers":3,"mean_commits":"12.333333333333334","dds":"0.43243243243243246","last_synced_commit":"c8f6fad88cc7a4dd46f82276a06f122b713ef09a"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannabits%2Fcharaza-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannabits%2Fcharaza-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannabits%2Fcharaza-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannabits%2Fcharaza-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/savannabits","download_url":"https://codeload.github.com/savannabits/charaza-ui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248557610,"owners_count":21124160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admin-generator","charaza","charaza-ui","laravel","laravel-framework","livewire","livewire-generator","savadmin","savannabits"],"created_at":"2024-09-24T19:49:31.199Z","updated_at":"2025-10-18T12:37:20.807Z","avatar_url":"https://github.com/savannabits.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## About Charaza UI\n__Looking for a Jetstream Tailwindcss, Inertia and Vue3 CRUD generator? Checkout our sister project, [Jetstream Inertia Generator (Jig)](https://github.com/coolsam726/jetstream-inertia-generator)__\n\nCharaza UI is a Laravel Starter that is integrated with savannabits/savadmin Admin Generator to enable you kickstart and rapidly develop your next laravel project.\nEquipped with the latest laravel tools, Charaza UI doesn't leave much of the boilerplate work to you. The auth module is scaffolded for you. The templates are setup for you.\nThe routing is already set up for you. All you have to do is just start writing your modules' code. What is even better: you don't have to go through much trouble to generate fully operational modules \nincluding Models, API controllers, Datatable Controllers, API and backend routes, views for editing and showing, code for deleting... The savadmin generator does all this for you with a single command:\n```shell script\nphp artisan sv:generate table_name\n```\n![Screenshot](https://github.com/savannabits/charaza-ui/blob/master/storage/screenshots/Screenshot_20201120_092151.png?raw=false)\n![Screenshot](https://github.com/savannabits/charaza-ui/blob/master/storage/screenshots/Screenshot_20201120_092249.png?raw=false)\n![Screenshot](https://github.com/savannabits/charaza-ui/blob/master/storage/screenshots/Screenshot_20201120_091437.png?raw=false)\n## Features\n- Code Generation with savannabits/savadmin\n- Laravel 8 Scaffold\n- Laravel Jetstream Frontend\n- Livewire 2 Scaffold\n- Laravel Fortify User Management\n- Alpine.js working with Livewire to give you a true SPA experience with just Laravel blade!\n- Backend and API Generation with Laravel and Vue.js (using BootstrapVue)\n- Profile and Info and Update\n- API Keys using Jetstream and Laravel Sanctum\n- Optional DB cacheing\n- Fuzzy Search using Laravel TNTSearch\n## Installation\nCharaza UI is meant for easing your work when beginning new projects. To start an all powered-up new project, simply create it from charaza as follows:\n```\ncomposer create-project savannabits/charaza-ui my-project\n```\n## Usage\nThe package comes with an optional docker configuration. It is highly recommended to use this to experience the full power with minimal configuration.\nAfter setting your .env variables, run the following to build and spin-up the docker containers:\n```shell script\ndocker-compose build app\ndocker-compose up -d\n```\nThis will boot up the app server exposed under the port you configured in the env. To enter the container's shell, there is a simple shell script included to enable this:\n```shell script\nbash app-exec [yoru command]\nbash app-exec bash\n```\n\nHowever, if you don't wish to use docker, no worry! All you have to do is configure database variables as you see fit, then proceed to the next step\n\nNext, proceed with the normal laravel setup steps:\n```\ncomposer install\nyarn install\nphp artisan key:generate\nphp artisan migrate\nphp artisan optimize:clear\nyarn back-dev (or back-prod)\nyarn css-prod (or css-prod)\nyarn dev (or prod or watch)\n```\nThere you go! Your system is now setup and you are ready to create your next amazing app!\n\n### Code Generator:\nUsing the code generator to generate your commands is easy:\n1. Create your migration file and edit it accordingly\n2. Run the Migration\n3. Use the generator to generate the model, controllers, routes, Menus, views and js assets.\n4. Modify any of them as you wish (customize)\n5. If you are not running `yarn back-watch`, then run `yarn back-dev` to rebuild the assets\n\n### Example:\nLet us generate an `Articles` module from the `articles` table\n1. Create the `articles` table\n```shell script\nbash app-exec bash #(If you are using docker)\nphp artisan make:migration create_articles_table\n```\n2. Edit the articles migration as you wish:\n```php\n    /**\n     * Run the migrations.\n     *\n     * @return void\n     */\n    public function up()\n    {\n        Schema::create('articles', function (Blueprint $table) {\n            $table-\u003eid();\n            $table-\u003estring('title');\n            $table-\u003estring('description');\n            $table-\u003etext('body');\n            $table-\u003eforeignId('author_id')-\u003econstrained('users')-\u003erestrictOnDelete();\n            $table-\u003etimestamps();\n        });\n    }\n```\n3. Run the migration\n```shell script\nbash app-exec 'php artisan migrate' #(For docker users)\nphp artisan migrate #(Non-docker users)\n```\n4. Use the generator to generate the model, controller, routes, menus, views and assets\n```shell script\nbash app-exec bash #Enter the container's bash - for Docker users\nphp artisan sv:generate articles # The code generator\n```\n__NB__ If you already generated the files but would like to force overwrite use ```--force``,\n   ```shell script\n    php artisan sv:generate articles --force\n   ```\nOutput:\n![Articles](https://github.com/savannabits/charaza-ui/blob/master/storage/screenshots/Screenshot_20201120_091437.png?raw=false)\n![Articles](https://github.com/savannabits/charaza-ui/blob/master/storage/screenshots/Screenshot_20201120_092032.png?raw=false)\n![Articles](https://github.com/savannabits/charaza-ui/blob/master/storage/screenshots/Screenshot_20201120_092101.png?raw=false)\n### Generated files\n\n__app/Models/Article.php__\n```php\n\u003c?php\n\nnamespace App\\Models;\n/* Imports */\nuse DateTimeInterface;\nuse Illuminate\\Database\\Eloquent\\Model;\nuse Laravel\\Scout\\Searchable;\nuse Rennokki\\QueryCache\\Traits\\QueryCacheable;\n\nclass Article extends Model\n{\nuse Searchable;\n        use QueryCacheable;\n    public $cacheFor=60*60*24; //cache for 1 day\n    protected static $flushCacheOnUpdate=true; //invalidate the cache when the database is changed\nprotected $fillable = [\n        'title',\n        'description',\n        'body',\n        'author_id',\n    \n    ];\n    \nprotected $searchable = [\n            'id',\n            'title',\n            'description',\n            'body',\n            'author_id',\n    \n    ];\n    \n    \n    \n    protected $dates = [\n            'created_at',\n        'updated_at',\n    ];\n\n    protected $appends = [\"api_route\"];\n\n    public function toSearchableArray() {\n        return collect($this-\u003eonly($this-\u003esearchable))-\u003emerge([\n            // Add more keys here\n        ])-\u003etoArray();\n    }\n    \n    /* ************************ ACCESSOR ************************* */\n\n    public function getApiRouteAttribute() {\n        return route(\"api.articles.index\");\n    }\n    protected function serializeDate(DateTimeInterface $date) {\n        return $date-\u003eformat('Y-m-d H:i:s');\n    }\n\n    /* ************************ RELATIONS ************************ */\n    /**\n    * Many to One Relationship to \\App\\Models\\User::class\n    * @return \\Illuminate\\Database\\Eloquent\\Relations\\BelongsTo\n    */\n    public function author() {\n        return $this-\u003ebelongsTo(\\App\\Models\\User::class,\"author_id\",\"id\");\n    }\n}\n```\n__app/Http/Controllers/Api/ArticleController.php__\n```php\n\u003c?php\nnamespace App\\Http\\Controllers\\Api;\nuse App\\Http\\Controllers\\Controller;\nuse App\\Http\\Requests\\Api\\Article\\IndexArticle;\nuse App\\Http\\Requests\\Api\\Article\\StoreArticle;\nuse App\\Http\\Requests\\Api\\Article\\UpdateArticle;\nuse App\\Models\\Article;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Str;\nuse Savannabits\\Savadmin\\Helpers\\ApiResponse;\nuse Savannabits\\Savadmin\\Helpers\\SavbitsHelper;\nuse Yajra\\DataTables\\Facades\\DataTables;\n\nclass ArticleController  extends Controller\n{\n    private $api, $helper;\n    public function __construct(ApiResponse $apiResponse, SavbitsHelper $helper)\n    {\n        $this-\u003eapi = $apiResponse;\n        $this-\u003ehelper = $helper;\n    }\n\n    /**\n     * Display a listing of the resource (paginated).\n     *\n     * @return \\Illuminate\\Http\\JsonResponse\n     */\n    public function index(IndexArticle $request)\n    {\n        $data = $this-\u003ehelper::listing(Article::class, $request)-\u003ecustomQuery(function ($builder) use($request) {\n        /**@var  Article|Builder $builder*/\n        // Add custom queries here\n        })-\u003eprocess();\n        return $this-\u003eapi-\u003esuccess()-\u003emessage(\"List of Articles\")-\u003epayload($data)-\u003esend();\n    }\n\n    public function dt(Request $request) {\n        return DataTables::of(Article::query())\n            -\u003eaddColumn(\"actions\",function($model) {\n                $actions = '';\n                if (\\Auth::user()-\u003ecan('articles.show')) $actions .= '\u003cbutton class=\"btn btn-outline-primary btn-square action-button mr-2\" title=\"View Details\" data-action=\"show-article\" data-tag=\"button\" data-id=\"'.$model-\u003eid.'\"\u003e\u003ci class=\"mdi mdi-eye\"\u003e\u003c/i\u003e\u003c/button\u003e';\n                if (\\Auth::user()-\u003ecan('articles.edit')) $actions .= '\u003cbutton class=\"btn btn-outline-warning btn-square action-button mr-2\" title=\"Edit Item\" data-action=\"edit-article\" data-tag=\"button\" data-id=\"'.$model-\u003eid.'\"\u003e\u003ci class=\"mdi mdi-pencil\"\u003e\u003c/i\u003e\u003c/button\u003e';\n                if (\\Auth::user()-\u003ecan('articles.delete')) $actions .= '\u003cbutton class=\"btn btn-outline-danger btn-square action-button mr-2\" title=\"Delete Item\" data-action=\"delete-article\" data-tag=\"button\" data-id=\"'.$model-\u003eid.'\"\u003e\u003ci class=\"mdi mdi-delete\"\u003e\u003c/i\u003e\u003c/button\u003e';\n                return $actions;\n            })\n            -\u003erawColumns(['actions'])\n            -\u003emake();\n    }\n\n    /**\n     * Store a newly created resource in storage.\n     *\n     * @param StoreArticle $request\n     * @return \\Illuminate\\Http\\JsonResponse\n     */\n    public function store(StoreArticle $request)\n    {\n        try {\n            $array = $request-\u003esanitizedArray();\n            $article = new Article($array);\n            \n            // Save Relationships\n            $object = $request-\u003esanitizedObject();\n            if (isset($object-\u003eauthor)) {\n                $article-\u003eauthor()\n                    -\u003eassociate($object-\u003eauthor-\u003eid);\n            }\n                        \n\n            $article-\u003esaveOrFail();\n            return $this-\u003eapi-\u003esuccess()-\u003emessage('Article Created')-\u003epayload($article)-\u003esend();\n        } catch (\\Throwable $exception) {\n            \\Log::error($exception);\n            return $this-\u003eapi-\u003efailed()-\u003emessage($exception-\u003egetMessage())-\u003epayload([])-\u003ecode(500)-\u003esend();\n        }\n    }\n\n    /**\n     * Display the specified resource.\n     *\n     * @param Request $request\n     * @param Article $article\n     * @return \\Illuminate\\Http\\JsonResponse\n     */\n    public function show(Request $request, Article $article)\n    {\n        try {\n            //Fetch relationships\n            $article-\u003eload([\n            'author',\n        ]);\n            return $this-\u003eapi-\u003esuccess()-\u003emessage(\"Article $article-\u003eid\")-\u003epayload($article)-\u003esend();\n        } catch (\\Throwable $exception) {\n            return $this-\u003eapi-\u003efailed()-\u003emessage($exception-\u003egetMessage())-\u003esend();\n        }\n    }\n\n    /**\n     * Update the specified resource in storage.\n     *\n     * @param UpdateArticle $request\n     * @param {$modelBaseName} $article\n     * @return \\Illuminate\\Http\\JsonResponse\n     */\n    public function update(UpdateArticle $request, Article $article)\n    {\n        try {\n            $data = $request-\u003esanitizedArray();\n            $article-\u003eupdate($data);\n            \n            // Save Relationships\n                $object = $request-\u003esanitizedObject();\n            if (isset($object-\u003eauthor)) {\n                $article-\u003eauthor()\n                    -\u003eassociate($object-\u003eauthor-\u003eid);\n            }\n                        \n\n            $article-\u003esaveOrFail();\n            return $this-\u003eapi-\u003esuccess()-\u003emessage(\"Article has been updated\")-\u003epayload($article)-\u003ecode(200)-\u003esend();\n        } catch (\\Throwable $exception) {\n            \\Log::error($exception);\n            return $this-\u003eapi-\u003efailed()-\u003ecode(400)-\u003emessage($exception-\u003egetMessage())-\u003esend();\n        }\n    }\n\n    /**\n     * Remove the specified resource from storage.\n     *\n     * @param Article $article\n     * @return \\Illuminate\\Http\\JsonResponse\n     * @throws \\Exception\n     */\n    public function destroy(Article $article)\n    {\n        $article-\u003edelete();\n        return $this-\u003eapi-\u003esuccess()-\u003emessage(\"Article has been deleted\")-\u003epayload($article)-\u003ecode(200)-\u003esend();\n    }\n\n}\n```\n__Appended Routes:__\napi.php\n```php\n    /* Auto-generated articles api routes */\n    Route::group(['prefix' =\u003e $apiPrefix,'as' =\u003e 'api.', 'namespace' =\u003e $apiNamespace], function() {\n        Route::group(['middleware' =\u003e [\"auth:sanctum\",\"verified\"]], function() {\n            Route::group(['prefix' =\u003e \"articles\", 'as' =\u003e 'articles.'],function() {\n                Route::get(\"dt\", \"ArticleController@dt\")-\u003ename('dt');\n            });\n            Route::apiResource('articles',\"ArticleController\")-\u003eparameters([\"articles\" =\u003e \"article\"]);\n        });\n    });\n```\n\nweb.php\n```php\n    /* Auto-generated admin routes */\n    \n    Route::group([\"prefix\" =\u003e config('savadmin.app.prefix',''),\n        \"namespace\" =\u003e \"Admin\",\n        \"as\" =\u003e config('savadmin.app.prefix').\".\",'middleware' =\u003e ['auth','verified']],function() {\n        Route::group(['as' =\u003e \"articles.\", 'prefix' =\u003e \"articles\"], function() {\n            Route::get('','ArticleController@index')-\u003ename('index');\n        });\n    });\n```\n\n__You can check the rest of the files as follows:__\n\n- app/Http/Controllers/Admin/ArticleController.php\n- resources/js/backend/articles.js\n- resources/views/backend/articles/*\n\n## Contributing\n\nThank you for considering contributing to the CharazaUI! Please email Savannabits \u003csavannabits@gmail.com\u003e for more info.\n\n## Code of Conduct\n\nIn order to ensure that the Charaza community is welcoming to all, please review and abide by the [Code of Conduct](https://savannabits.com).\n\n## Security Vulnerabilities\n\nIf you discover a security vulnerability within Charaza, please send an e-mail to Sam Maosa via [maosa.sam@gmail.com](mailto:maosa.sam@gmail.com). All security vulnerabilities will be promptly addressed.\n\n## License\n\nThe Charaza UI Starter is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavannabits%2Fcharaza-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsavannabits%2Fcharaza-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavannabits%2Fcharaza-ui/lists"}