{"id":13764227,"url":"https://github.com/pvtl/voyager-frontend","last_synced_at":"2025-05-10T19:30:45.466Z","repository":{"id":57046039,"uuid":"120848665","full_name":"pvtl/voyager-frontend","owner":"pvtl","description":"The Missing Front-end for The Missing Laravel Admin 🔥","archived":true,"fork":false,"pushed_at":"2021-07-08T04:39:26.000Z","size":533,"stargazers_count":205,"open_issues_count":1,"forks_count":90,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-04-24T06:48:13.821Z","etag":null,"topics":["laravel","laravel-5-package","laravel-package","php","voyager"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"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/pvtl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-09T02:58:27.000Z","updated_at":"2025-01-23T15:50:16.000Z","dependencies_parsed_at":"2022-08-24T03:40:29.347Z","dependency_job_id":null,"html_url":"https://github.com/pvtl/voyager-frontend","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvtl%2Fvoyager-frontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvtl%2Fvoyager-frontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvtl%2Fvoyager-frontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvtl%2Fvoyager-frontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvtl","download_url":"https://codeload.github.com/pvtl/voyager-frontend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253470593,"owners_count":21913699,"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":["laravel","laravel-5-package","laravel-package","php","voyager"],"created_at":"2024-08-03T16:00:16.936Z","updated_at":"2025-05-10T19:30:44.744Z","avatar_url":"https://github.com/pvtl.png","language":"PHP","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"**This repository is no longer actively maintained**\n\n# Voyager Frontend\n\n![Voyager Frontend Screenshot](/readme-intro.jpg)\n\n__The Missing Frontend for The Missing Laravel Admin.__\n\nThis [Laravel](https://laravel.com/) package adds frontend views, routes and assets to a [Voyager](https://laravelvoyager.com/) project.\n\nIt comes with a basic structure for frontend layouts (eg. header, footer, etc) and theme assets using the [Foundation](https://foundation.zurb.com) framework.\n\nBuilt by [Pivotal Agency](https://pivotal.agency/).\n\n---\n\n## Prerequisites\n\n- PHP \u003e= 7.1.3\n    - PHP extension `sqlite3` (required for `teamtnt/tntsearch`)\n- Node \u0026 NPM\n- Composer\n- [Laravel Requirements](https://laravel.com/docs/installation)\n\n---\n\n## Installation\n\n__1. Install Laravel + Voyager__\n_(Replace the $VARs with your own values)_\n\n```bash\n# 1.0 Install Laravel\ncomposer create-project --prefer-dist laravel/laravel $DIR_NAME\n\n# 1.1 Require Voyager\ncd $DIR_NAME \u0026\u0026 composer require tcg/voyager\n\n# 1.2 Copy .env.example to .env and update the DB \u0026 App URL config\ncp .env.example .env\n\n# 1.3 Generate a Laravel key\nphp artisan key:generate\n\n# 1.4 Install Laravel frontend - Only on Laravel 7+\nphp artisan ui bootstrap --auth\n\n# 1.5 Run the Voyager Installer\nphp artisan voyager:install\n\n# 1.6 Create a Voyager Admin User\nphp artisan voyager:admin $YOUR_EMAIL --create\n```\n\n__2. Install Voyager Frontend__\n\n```bash\n# 2.0 Require this Package in your fresh Laravel/Voyager project\ncomposer require pvtl/voyager-frontend\n\n# 2.1 Run the Installer\ncomposer dump-autoload \u0026\u0026 php artisan voyager-frontend:install\n\n# 2.3 Build the front-end theme assets\nnpm install\nnpm run dev\n\n# 2.4 Set the Laravel search driver in your .env\necho \"SCOUT_DRIVER=tntsearch\" \u003e\u003e .env\n```\n\n_Any issues? See [the troubleshooting section](#toubleshooting) below._\n\n### 'Got Cron'?\n\nThis is a just a reminder to setup the standard Laravel cron on your server. The Voyager Frontend package has a few scheduled tasks, so relies on the cron running.\n\n```\n* * * * * php /path-to-your-project/artisan schedule:run \u003e\u003e /dev/null 2\u003e\u00261\n```\n\n---\n\n## Theme Development\n\n#### SCSS \u0026 JS\n\nWhen you're ready to start styling your frontend, you can use the following commands after making updates to SCSS and/or JS files:\n\n| Command | Description |\n| --- | --- |\n| `npm run watch` | Watches your `/resources/assets` for any changes and builds immediately |\n| `npm run dev` | Builds SCSS/JS on demand |\n| `npm run prod` | Builds SCSS/JS on demand, but this time, outputs minified results |\n\n#### Overriding Views\n\nLet's say you want to update the layout of the frontend header:\n\n1. Create the directory `resources/views/vendor/voyager-frontend`\n    - Any files you place in here will replace the default views that comes with this package\n1. Copy the respective file from `vendor/pvtl/voyager-frontend/resources/views/` (in this case, the `partials/header.blade.php`) into the matching file structure and update\n\nSo now you'll have:\n\n```\n    /resources\n        /views\n            /vendor\n                /voyager-frontend\n                    /partials\n                        /header.blade.php\n```\n\nAnd any changes made to `header.blade.php` reflect automatically on the site.\n\n---\n\n## Thumbnails / Image Resizing\n\nThis package comes with an automatic image resize function. When you reference an image in your front-end blade templates, simply call something like:\n\n```html\n{{ imageUrl($pathToImage, $width, $height, $config = ['crop' =\u003e false, 'quality' =\u003e 100] ) ?: '/default.png' }}\n\n\u003c!-- For example for a 300px wide thumbnail scaled down (i.e. no cropping) --\u003e\n\u003cimg src=\"{{ imageUrl($blockData-\u003eimage, 300, null, ['crop' =\u003e false]) ?: '/default.png' }}\" /\u003e\n\n\u003c!-- Or a 200px by 100px cropped thumbnail --\u003e\n\u003cimg src=\"{{ imageUrl($blockData-\u003eimage, 200, 100) ?: '/default.png' }}\" /\u003e\n```\n\n### \"CDN\" your images\n\nThe function will output an absolute URL, where the hostname will be `APP_URL` - however you can add a `ASSET_URL` variable to your `.env` file to use a different hostname.\n\n---\n\n## Search\n\n#### Generating Indices\nThis module contains a scheduled job to regenerate indices which will run automatically once you setup jobs for Laravel. If you need to test and re-generate search indices you can manually run the command `php artisan voyager-frontend:generate-search-indices`.\n\n#### Configuring Search (Using Laravel Scout)\nBy default this module includes \"searching\" the \"Pages\" and \"Posts\" Models out-of-the-box once you have defined the following variable in your `.env` file - [check out the Laravel Scout documentation](https://laravel.com/docs/5.5/scout):\n\n```\nSCOUT_DRIVER=tntsearch\n```\n \n You can however extend and define your own \"Searchable\" Models to include in your search results by attaching the \"Searchable\" trait to them.\n\n```php\nclass Page extends Model\n{\n    use Searchable;\n\n    public $asYouType = false;\n\n    /**\n     * Get the indexed data array for the model.\n     * @return array\n     */\n    public function toSearchableArray()\n    {\n        $array = $this-\u003etoArray();\n\n        // customise the searchable array\n        \n        return $array\n    }\n}\n```\n\nThen you'll be able to hook into the search config and _merge_ your \"Searchable\" Models in with the config key (preferably using a Servie Provider): `scout.tntsearch.searchableModels`.\n```php\n$this-\u003emergeConfigFrom(self::PACKAGE_DIR . 'path/to/config/scout.php', 'scout.tntsearch.searchableModels');\n```\n\nYour configuration file should contain values similar to this modules scout.php configuration:\n```php\n\u003c?php\n\nreturn [\n    '\\My\\Searchable\\Models\\Namespace',\n];\n```\n\n## Testing\n\nYou can test the Pvtl/Test package switching to the packages directory and running tests via composer scripts:\n\n```\n  cd packages/pivotal/test;\n  composer run test\n```\n\n---\n\n## Toubleshooting\n\n#### Error: `Class VoyagerFrontendDatabaseSeeder does not exist`\n\nSimply run `php artisan voyager-frontend:install` again\n\n#### Error: `The command \"npm i ...\" failed.`\n\nRun `npm install` and then try `php artisan voyager-frontend:install` again\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvtl%2Fvoyager-frontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvtl%2Fvoyager-frontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvtl%2Fvoyager-frontend/lists"}