{"id":21107425,"url":"https://github.com/typerocket/laravel","last_synced_at":"2025-09-12T20:43:11.243Z","repository":{"id":57074234,"uuid":"42956791","full_name":"TypeRocket/laravel","owner":"TypeRocket","description":"Add some of the TypeRocket magic to Laravel.","archived":false,"fork":false,"pushed_at":"2020-10-06T00:25:27.000Z","size":374,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-03T01:56:53.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/typerocket/laravel","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TypeRocket.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}},"created_at":"2015-09-22T19:43:46.000Z","updated_at":"2023-09-09T10:30:42.000Z","dependencies_parsed_at":"2022-08-24T14:54:49.537Z","dependency_job_id":null,"html_url":"https://github.com/TypeRocket/laravel","commit_stats":null,"previous_names":[],"tags_count":61,"template":false,"template_full_name":null,"purl":"pkg:github/TypeRocket/laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeRocket%2Flaravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeRocket%2Flaravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeRocket%2Flaravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeRocket%2Flaravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TypeRocket","download_url":"https://codeload.github.com/TypeRocket/laravel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeRocket%2Flaravel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274873613,"owners_count":25365824,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-20T00:39:14.303Z","updated_at":"2025-09-12T20:43:11.223Z","avatar_url":"https://github.com/TypeRocket.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## TypeRocket for Laravel 5.3\n\nOriginally for WordPress, TypeRocket makes building advanced forms and fields easy for Laravel too.\n\nSee http://typerocket.com for documentation (mainly for WordPress).\n\n### Installing\n\n```\ncomposer require typerocket/laravel\n```\n\n[Laravel Service Providers](https://laravel.com/docs/5.3/providers#registering-providers) make a way for extending Laravel. TypeRocket Laravel 2.0 is a service provider for Laravel. In your `config/app.php` file add:\n\n```php\n'providers' =\u003e [\n    // Other Service Providers\n\n    TypeRocket\\Service::class,\n],\n```\n\nThen form the command line:\n\n```\nphp artisan vendor:publish --provider=\"TypeRocket\\Service\"\n```\n\nYou can now access the `config/typerocket.php`.\n\nFinally, add uploads to public folder. From your site root directory run:\n\n```\nln -s ../storage/uploads uploads\n```\n\n*Note: Routes, views, and controller will be adding for you.*\n\n## JS and CSS init\n\nIn blade templates such master templates.\n\n```\n{!! \\TypeRocket\\Assets::getHeadString() !!}\n{!! \\TypeRocket\\Assets::getFooterString() !!}\n```\n\n### Adding assets\n\n```php\n$paths = Config::getPaths();\n\n// type ( js || css), id, path\nAssets::addToFooter('js', 'typerocket-core', $paths['urls']['js'] . '/typerocket.js');\nAssets::addToHead('js', 'typerocket-global', $paths['urls']['js'] . '/global.js');\n```\n\n## Forms\n\n```php\n// model, action ( create || update ), id, path\n$form = new \\TypeRocket\\Form('Post', 'update', $id, '/posts/' . $id);\n```\n\n```php\n\u003cdiv class=\"typerocket-container\"\u003e\n    {!! $form-\u003eopen() !!}\n    {!! $form-\u003etext('title')-\u003esetLabel('Post Title') !!}\n    {!! $form-\u003echeckbox('publish')-\u003esetText('Published') !!}\n    {!! $form-\u003eclose('Submit') !!}\n\u003c/div\u003e\n```\n\n## Request Old Input\n\nTo load old input into the form set the request.\n\n```php\nclass PostController extends Controller\n{\n    public function create(Request $request)\n    {\n        $form = new \\TypeRocket\\Form('Post', 'create', null, '/posts/');\n        $form-\u003esetRequest($request); // set request\n        return view('posts.create', ['form' =\u003e $form]);\n    }\n}\n```\n\n## Validate\n\n```php\nclass PostController extends Controller\n{\n\n    public function store(Request $request)\n    {\n        $tr = $request-\u003einput('tr');\n\n        $validator = \\Validator::make($tr, [\n            'title' =\u003e 'required|max:255'\n        ]);\n\n        if ($validator-\u003efails()) {\n            return redirect(\"posts/create\")\n                -\u003ewithErrors($validator)\n                -\u003ewithInput();\n        }\n\n        $post = new Fabric();\n        $post-\u003etitle = $tr['title'];\n        $post-\u003esave();\n\n        header('Location: /posts/');\n    }\n\n}\n```\n\n## Matrix route.\n\nWorking with matrix fields the service provider will add this for you.\n\n```php\nRoute::post('matrix_api/{group}/{type}', function($group, $type) {\n    (new TypeRocket\\Matrix())-\u003eroute($group, $type);\n});\n```\n\n### CSFR for matrix\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken as BaseVerifier;\n\nclass VerifyCsrfToken extends BaseVerifier\n{\n    /**\n     * The URIs that should be excluded from CSRF verification.\n     *\n     * @var array\n     */\n    protected $except = [\n        'matrix_api/*' // added\n    ];\n}\n```\n\n## Matrix Assets\n\nAssets will not be loaded form fields because the view is already loaded. Include the possible assets in the controller.\n\nFor example a Matrix field that uses an image field will need to include `image.js`.\n\n```php\n$paths = \\TypeRocket\\Config::getPaths();\n\\TypeRocket\\Assets::addToFooter('js', 'typerocket-image', $paths['urls']['js'] . '/image.js');\n```\n\n## Media\n\nTyperocket Media uses https://github.com/eventviva/php-image-resize to create thumbnails.\n\n### [Unsplash](https://unsplash.com/developers)\n\nTo enable, set the `typerocket.media.unsplash.enabled` to `true`, and set the the Unsplash client ID in `typerocket.media.unsplash.client_id`.\n\nTo add the Unsplash button and modal anywhere, use the custom Blade directive `@tr_unsplash`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyperocket%2Flaravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyperocket%2Flaravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyperocket%2Flaravel/lists"}