{"id":13828476,"url":"https://github.com/yyx990803/laravel-vue-cli-3","last_synced_at":"2025-04-23T14:19:11.542Z","repository":{"id":41225822,"uuid":"142342441","full_name":"yyx990803/laravel-vue-cli-3","owner":"yyx990803","description":"Example project using Vue CLI 3 with Laravel","archived":false,"fork":false,"pushed_at":"2019-04-24T07:45:14.000Z","size":558,"stargazers_count":846,"open_issues_count":14,"forks_count":181,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-04-23T14:18:58.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/yyx990803.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":"2018-07-25T19:06:40.000Z","updated_at":"2025-03-20T19:49:53.000Z","dependencies_parsed_at":"2022-08-28T01:00:56.077Z","dependency_job_id":null,"html_url":"https://github.com/yyx990803/laravel-vue-cli-3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yyx990803%2Flaravel-vue-cli-3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yyx990803%2Flaravel-vue-cli-3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yyx990803%2Flaravel-vue-cli-3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yyx990803%2Flaravel-vue-cli-3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yyx990803","download_url":"https://codeload.github.com/yyx990803/laravel-vue-cli-3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250447981,"owners_count":21432166,"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":[],"created_at":"2024-08-04T09:02:48.471Z","updated_at":"2025-04-23T14:19:11.523Z","avatar_url":"https://github.com/yyx990803.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# Laravel + Vue CLI 3\n\nThis demo assumes you are serving this Laravel app via Valet at `laracon.test`. If you are serving the laravel app at a different local URL, modify it accordingly in `frontend/vue.config.js`.\n\n### To Run the Frontend\n\n``` sh\ncd frontend\nyarn # OR npm install\nyarn serve # OR npm run serve\n\n# build for production:\nyarn build # OR npm run build\n```\n\n### Steps for Scaffolding From Scratch\n\n1. Create Laravel Project\n\n    ``` sh\n    laravel new my-project\n    cd my-project\n\n    # remove existing frontend scaffold\n    rm -rf package.json webpack.mix.js yarn.lock resources/assets\n    ```\n\n2. Create a Vue CLI 3 project in the Laravel app\n\n    ``` sh\n    vue create frontend\n    # pick router\n    ```\n\n3. Configure Vue project\n\n    Create `frontend/vue.config.js`:\n\n    ``` js\n    module.exports = {\n      // proxy API requests to Valet during development\n      devServer: {\n        proxy: 'http://laracon.test'\n      },\n\n      // output built static files to Laravel's public dir.\n      // note the \"build\" script in package.json needs to be modified as well.\n      outputDir: '../public',\n\n      // modify the location of the generated HTML file.\n      // make sure to do this only in production.\n      indexPath: process.env.NODE_ENV === 'production'\n        ? '../resources/views/index.blade.php'\n        : 'index.html'\n    }\n    ```\n\n    Edit `frontend/package.json`:\n\n    ``` diff\n    \"scripts\": {\n      \"serve\": \"vue-cli-service serve\",\n    - \"build\": \"vue-cli-service build\",\n    + \"build\": \"rm -rf ../public/{js,css,img} \u0026\u0026 vue-cli-service build --no-clean\",\n      \"lint\": \"vue-cli-service lint\"\n    },\n    ```\n\n4. Configure Laravel for single-page app.\n\n    **routes/web.php**\n\n    ``` php\n    \u003c?php\n\n    Route::get('/{any}', 'SpaController@index')-\u003ewhere('any', '.*');\n    ```\n\n    **app/Http/Controllers/SpaController.php**\n\n    ``` php\n    \u003c?php\n\n    namespace App\\Http\\Controllers;\n\n    use Illuminate\\Http\\Request;\n\n    class SpaController extends Controller\n    {\n        public function index()\n        {\n            return view('index');\n        }\n    }\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyyx990803%2Flaravel-vue-cli-3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyyx990803%2Flaravel-vue-cli-3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyyx990803%2Flaravel-vue-cli-3/lists"}