{"id":28999932,"url":"https://github.com/xsanisty/silexstarter","last_synced_at":"2025-06-25T08:09:29.148Z","repository":{"id":25947891,"uuid":"29389453","full_name":"xsanisty/SilexStarter","owner":"xsanisty","description":"Starter app based on Silex framework with mvc and modular arch, scaffold generator, and admin panel","archived":false,"fork":false,"pushed_at":"2020-06-19T22:38:43.000Z","size":3670,"stargazers_count":11,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-22T23:22:05.753Z","etag":null,"topics":["admin-dashboard","composer","crud","mvc","php","scaffold","silex","silex-framework","silex-skeleton"],"latest_commit_sha":null,"homepage":"http://xsanisty.com/project/silex-starter","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xsanisty.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-17T11:45:37.000Z","updated_at":"2019-08-26T16:49:24.000Z","dependencies_parsed_at":"2022-08-24T14:17:59.758Z","dependency_job_id":null,"html_url":"https://github.com/xsanisty/SilexStarter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xsanisty/SilexStarter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsanisty%2FSilexStarter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsanisty%2FSilexStarter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsanisty%2FSilexStarter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsanisty%2FSilexStarter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xsanisty","download_url":"https://codeload.github.com/xsanisty/SilexStarter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xsanisty%2FSilexStarter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261832976,"owners_count":23216500,"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-dashboard","composer","crud","mvc","php","scaffold","silex","silex-framework","silex-skeleton"],"created_at":"2025-06-25T08:09:26.527Z","updated_at":"2025-06-25T08:09:29.138Z","avatar_url":"https://github.com/xsanisty.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://scrutinizer-ci.com/g/xsanisty/SilexStarter/badges/build.png?b=develop)]\n(https://scrutinizer-ci.com/g/xsanisty/SilexStarter/build-status/develop)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/xsanisty/SilexStarter/badges/quality-score.png?b=develop)]\n(https://scrutinizer-ci.com/g/xsanisty/SilexStarter/?branch=develop)\n[![Code Coverage](https://scrutinizer-ci.com/g/xsanisty/SilexStarter/badges/coverage.png?b=develop)]\n(https://scrutinizer-ci.com/g/xsanisty/SilexStarter/?branch=develop)\n[![SensioLabsInsight](https://insight.sensiolabs.com/projects/a30a66f9-8110-40c5-8a35-f3c1697dde55/mini.png)]\n(https://insight.sensiolabs.com/projects/a30a66f9-8110-40c5-8a35-f3c1697dde55)\n\n![screenshot](https://github.com/xsanisty/SilexStarter/blob/develop/screenshot.png)\n\n\n# SilexStarter\n\nSilexStarter is a starter application built on the top of Silex framework, Laravel's Eloquent, Cartalyst Sentry,\nand some other third party and built in components.\nSilexStarter aim to help building simple application faster, it built with MVC and modular approach in mind,\nand comes with some basic admin module, including user manager, and module manager.\n\n## Installation\nFor now, the installable branch is only develop branch, you can easily install it using composer by using following command\n\n```\ncomposer create-project xsanisty/silexstarter target_dir dev-develop -s dev\n```\n\nonce composer install is completed, you can initialize the app using following command\n```\n$cd target_dir\n$./xpress app:init\n```\n\nModule can be developed directly inside the ```app/modules``` directory and create module on its own namespace\nor build it as separate composer package, module can be enabled or disabled by registering it in ```app/config/modules.php```\n\n## Route\n```file : app/routes.php```\nRoute configuration can be created like normal Silex route, or using route builder using similar syntax like Laravel's route.\n\nSilex routing style\n```php\n/* the application instance is available as $app in context of route.php */\n\n$app-\u003eget('/page', function(){\n    return 'I am in a page';\n});\n\n$app-\u003epost('/save', function(){\n   return 'Ok, all data is saved!';\n});\n\n/* grouping */\n$app-\u003egroup('prefix', function() use ($app) {\n    $app-\u003egroup('page', function() use ($app) {\n        $app-\u003eget('index', function(){\n            return 'I am in prefix/page/index';\n        });\n    });\n});\n\n/* resourceful controller */\n$app-\u003eresource('prefix', 'SomeController');\n\n/* route controller */\n$app-\u003econtroller('prefix', 'SomeController');\n\n```\n\nLaravel routing style\n```php\n/* route can be built using the Route static proxy */\n\nRoute::get('/page', function(){\n    return 'I am in a page';\n});\n\nRoute::post('/save', function(){\n   return 'Ok, all data is saved!';\n});\n\n/* grouping */\nRoute::group('prefix', function() {\n    Route::group('page', function() {\n        Route::get('index', function(){\n            return 'I am in prefix/page/index';\n        });\n    });\n});\n\n/* resourceful controller */\nRoute::resource('prefix', 'SomeController');\n\n/* route controller */\nRoute::controller('prefix', 'SomeController');\n```\n\n## Controller\n```file: app/controllers/*```\n\nController basically can be any classes that reside in controllers folder, it will be registered as service\nwhen enabled, and will be properly instantiated when needed, with all dependency injected.\n\nAssume we have ```PostRepository``` and ```CommentRepository```, we should register it first before it can be\nproperly injected into controller.\n\n```file: app/services/RepositoryServiceProvider.php```\n\n```php\n\u003c?php\n\nuse Silex\\Application;\nuse Silex\\ServiceProviderInterface;\n\nclass RepositoryServiceProvider implements ServiceProviderInterface\n{\n    public function register(Application $app)\n    {\n        $app['PostRepository'] = $app-\u003eshare(function (Application $app) {\n            return new PostRepository\n        });\n\n        $app['CommentRepository'] = $app-\u003eshare(function (Application $app) {\n            return new PostRepository\n        });\n    }\n\n    public function boot(Application $app)\n    {\n\n    }\n}\n```\n\n```file: app/config/services.php```\n```php\n\u003c?php\n\nreturn [\n    'common' =\u003e [\n        'RepositoryServiceProvider',\n    ]\n]\n```\n\n```file: app/controllers/PostController.php```\n```php\n\u003c?php\n\nclass PostController{\n\n    protected $postRepo;\n    protected $commentRepo;\n\n    public function __construct(PostRepository $postRepo, CommentRepository $commentRepo)\n    {\n        $this-\u003epostRepo = $postRepo;\n        $this-\u003ecommentRepo = $commentRepo;\n    }\n\n    public function index(){\n        return Response::view('post/index', $this-\u003epostRepo-\u003eall());\n    }\n}\n```\n\nand now, we should able to create route map to this controller\n\n```php\nRoute::get('/post', 'PostController:index');\n```\n\n## Model\n```file: app/models/*```\n\nSilexStarter use Eloquent ORM as database abstraction layer, so you can extends it to create model classJeyac.\nThe configuration of the database can be found in ```app/config/database.php```\n\n```php\n\u003c?php\n\nclass Post extends Model{\n    protected $table = 'posts';\n\n    public function comments(){\n        return $this-\u003ehasMany('Comment');\n    }\n}\n```\n\n## View\n```file: app/views/*```\n\n## Middleware\n```file: app/middlewares.php```\n\n## Service Provider\n```file: src/Providers/*```\n\n## Module\n```file: app/modules/*```\n\n### Register module\n```file: app/config/modules.php```\n\n### Module Provider\n```file: app/modules/**/ModuleProvider.php```\n\n## Menu\n\n## Asset\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsanisty%2Fsilexstarter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxsanisty%2Fsilexstarter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxsanisty%2Fsilexstarter/lists"}