{"id":14974540,"url":"https://github.com/g0ld3lux/laravel-starter","last_synced_at":"2025-10-27T09:30:39.534Z","repository":{"id":126829608,"uuid":"84703127","full_name":"g0ld3lux/laravel-starter","owner":"g0ld3lux","description":"laravel 5.4 , vue 2 , SPA and API ready","archived":false,"fork":false,"pushed_at":"2017-03-13T04:41:11.000Z","size":2852,"stargazers_count":46,"open_issues_count":1,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-02-01T04:31:41.505Z","etag":null,"topics":["dingo","element-ui","jwt","laravel","laravel54","vue","vue2","vuejs2"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/g0ld3lux.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}},"created_at":"2017-03-12T05:46:22.000Z","updated_at":"2019-12-30T09:29:17.000Z","dependencies_parsed_at":"2023-06-18T06:00:31.673Z","dependency_job_id":null,"html_url":"https://github.com/g0ld3lux/laravel-starter","commit_stats":null,"previous_names":["g0ld3lux/laravel-starter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g0ld3lux%2Flaravel-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g0ld3lux%2Flaravel-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g0ld3lux%2Flaravel-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g0ld3lux%2Flaravel-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g0ld3lux","download_url":"https://codeload.github.com/g0ld3lux/laravel-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238471970,"owners_count":19478138,"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":["dingo","element-ui","jwt","laravel","laravel54","vue","vue2","vuejs2"],"created_at":"2024-09-24T13:50:42.807Z","updated_at":"2025-10-27T09:30:38.140Z","avatar_url":"https://github.com/g0ld3lux.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Starter For SPA and REST API\n\n[Laravel](https://laravel.com/) as Api Back End\n\n[Vue](https://vuejs.org//) and [Element](https://github.com/ElemeFE/element) For Front END\n\n## Implements the Following\n\n - [x] Uses Laravel Version [5.4]\n\n - [x] Uses Vue Version  [2.2]\n\n - [x] Uses Various ES6 Presets (.babelrc)\n\n - [x] ES Lint Ready (.eslintrc and styleint.config.js)\n\n - [x] Uses [Element](http://element.eleme.io/#/en-US) for UI\n\n - [ ] Vuex State Management Ready\n\n - [ ] SPA Using Vue Router\n\n - [x] [JWT Auth](https://github.com/tymondesigns/jwt-auth) (auth_scaffold : login,signup, recover,reset)\n\n - [x] [Dingo Api](https://github.com/dingo/api) (REST API)\n\n - [ ] ACL Ready using [Bouncer](https://github.com/JosephSilber/bouncer) \n\n - [x] [Webpack](https://webpack.github.io/) / [Laravel Mix](https://github.com/JeffreyWay/laravel-mix) For Asset Management\n\n - [x] CORS\n\n - [ ] Vue Server Side Rendering\n\n## Dev Machine Requirements :\n\n - [x] Prefered OS Windows 10/Linux/MacOS\n\n - [x] Terminal: WSL Bash on Ubuntu or Mintty\n\n - [x] VSCODE for Various Extension to help us In Our Development\n\n ### List of VSCODE Extensions\n\n - Auto Rename Tag\n - Docker\n - ESLint\n - HTML Class Suggestions\n - HTML CSS Support\n - HTML Snippets\n - Instant Markdown\n - ES6 Snippets\n - Laravel 5 Snippets\n - Laravel Blade Snippets\n - Material Theme\n - Vetur\n - VueHelper\n\n \n - [x] Windows Docker Native for Easily provisioning Servers\n\n\n\n## Installation\n\nInstall all Dependencies\n\n```\ngit clone https://github.com/g0ld3lux/laravel-starter\ncomposer install\nnpm install\nphp artisan key:generate\nphp artisan jwt:generate\n```\n\n## Setting Your .env\n\n\nNote You May Choose 3 types of .env file\n\n- .env.dev - basic (no need db uses sqlite, logs, filesystem) \n  \n  Note: You Only Need to Set Here Your Mail Driver Preferabbly [Mailtrap.io](https://mailtrap.io/)\n\n- .env.production - (all important ENV var is here that you need to set up in your production)\n\n- .env.docker - if your using laradock or docker ***RECOMMENDED***\n\n   \n\n\n## Running Using the Basic .env.dev\n\n### Add Your Mailtrap Credentials in .env\n\n```\nMAIL_DRIVER=smtp\nMAIL_HOST=smtp.mailtrap.io\nMAIL_PORT=2525\nMAIL_USERNAME=\nMAIL_PASSWORD=\n\n```\n\n\n### Create Database in Sqlite\n\n- Go to Database folder then\n\n```\ntouch database.sqlite\n```\n\n### Log in Sqlite\n\n```\nsqlite3 database.sqlite\n```\n\n\n### Migrate and Seed\n\n```\nphp artisan migrate --seed\n```\n\n### Serve Site on localhost:8000\n\n```\nphp artisan serve\n```\n\n### Your Api End Point\n\n```\nlocalhost:8000/api/*\n```\n\n\n## Dev Workflow\n\n- Note : I Assume you have NODE in your Machine as well as NPM \n\n### Enable BrowserSync\n\n```\nnpm run watch or npm run watch poll\n```\n\n### Enable Hot Reloading \u0026 Browserync\n\n```\nnpm run hot\n```\n\n### Visit Site\n\n```\nlocalhost:3000 or laravel.dev:3000\n```\n\n\n## Laradock Workflow\n\n### Folder Structuring\n\n```\ncode\n- laradock\n- api\n```\n\n### Setting Your App Folder\n\n- Edit docker-compose.yml\n\n```\n applications:\n        image: tianon/true\n        volumes:\n\n        - ../api/:/var/www/api //\u003c-- Add Your Site Folder to be Shared\n```\n\n### Configuring Nginx\n\n- Go to laradock/nginx/sites\n\n```\ncp sample.conf.example api.laravel.conf\n```\nEdit it to use api and laravel.dev as your Site Domain\n\n\n\n```\nserver {\n\n    listen 80;\n    listen [::]:80;\n\n    server_name api.laravel.dev laravel.dev;  // \u003c-- Our App Domain\n    root /var/www/api/public;  //\u003c-- Our App Root Folder\n    index index.php index.html index.htm;\n\n    location / {\n         try_files $uri $uri/ /index.php$is_args$args;\n    }\n\n    location ~ \\.php$ {\n        try_files $uri /index.php =404;\n        fastcgi_pass php-upstream;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n\n    location ~ /\\.ht {\n        deny all;\n    }\n}\n\n```\n\n### Starting Server\n\n\n```\ndocker-compose up -d nginx redis mysql beanstalkd\n```\n\n### Setting ENV\n\n- [x] Use a .env.docker as your .env\n\n\n### Task Scheduler\n\n\n- Go to this folder\n\n```\nworkspace/crontab/root\n```\n\nAnd Add your Cron Job\n```\n* * * * * php /var/www/api/artisan schedule:run \u003e\u003e /dev/null 2\u003e\u00261\n```\n\n### Accessing Containers\n\n\n#### SSH to Container Name\n\n```\ndocker exec -it laradock_workspace_1\ndocker exec -it laradock_mysql_1\ndocker exec -it laradock_redis_1\n```\n\n#### Install PHP Quer Driver Extension at Workspace Container\n- At your App folder\n```\ncomposer require pda/pheanstalk\n```\n\n#### Install Redis Driver Extension at Workspace Container\n- At your App folder\n```\ncomposer require predis/predis\n```\n\n\n#### Migration at Workspace Container\n\n- At your App folder\n```\nphp artisan tinker\n```\n\n\n## Extras\n\n\nSince it is Configure for laravel.dev/api/* for the basic .env.dev\n\njust remove that route\n\n```\n// api/* -\u003eremove this \n```\n\n- editing hosts file\n```\n127.0.0.1 laravel.dev\n127.0.0.1 api.laravel.dev\n```\n\n- creating DB inside a Docker Container\n```\ndocker exec -it laradock_mysql_1\nmysql -u root -p\npassword: root\ncreate database api;\nexit\n```\n## Visit Site and Api Endpoints\n\n```\nlaravel.dev\napi.laravel.dev\n```\n\n## Use Post Man To Test Endpoint\n\n- Open [Postman](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en)\n\n- add to header ,where YOUR_SUBTYPE is define in our .env (Use for Accessing Specific Api Version)\n\n```\nAccept: application/vnd.YOUR_SUBTYPE.v1+json\n```\n\n- Make Post Request to login\n\n```\nhttp://api.laravel.dev/auth/login\n```\n\n- Add to Body\n```\nemail = admin@laravel.dev\npassword = password\n```\n\n- You will see Response something like this\n```\n{\n  \"status\": \"ok\",\n  \"token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2FwaS5sYXJhdmVsLmRldlwvYXV0aFwvbG9naW4iLCJpYXQiOjE0ODkzMzI1OTcsImV4cCI6MTQ4OTM5NzM5NywibmJmIjoxNDg5MzMyNTk3LCJqdGkiOiJjODMxNTMzZjkzMGFiOTkzMGExMzhkMGNkOTI5NGI3ZCJ9.3v-cGtXA-ySmL67pp4kZ4U4Mf3v7ge_CzUEdWIRKSeM\"\n}\n```\n\n- Returning a response with cookie\n\nNote: our SESSION_DOMAIN=.laravel.dev\n```\n\n$name = 'samplecookie';\n$value = 'my-cookie';\n$minutes = 60;\n$path = '/';\n$domain = 'api.laravel.dev';\n$secure = false;\n$httpOnly =false;\nreturn response()\n-\u003ejson([\n    'status' =\u003e 'ok',\n    'token' =\u003e $token,\n    'firstName' =\u003e $firstname,\n    'lastName' =\u003e $lastname,\n    'email' =\u003e $email\n])-\u003eheader('Authorization','Bearer ' . $token)\n-\u003ewithCookie($name, $value, $minutes, $path, $domain, $secure, $httpOnly);\n```\n\n## STATE MANAGEMENT (VUEX)\n\n### To Enable Namespacing with Vuex add namespace in store module object\n\n```\nnamespaced: true\n\n```\n\n### Maping With Vuex in Components with Module Namespacing\n```\ncomputed: {\n  ...mapState('account', {\n    firstName: state =\u003e state.firstName,\n    lastName: state =\u003e state.lastName,\n    email: state =\u003e state.email\n  })\n},\nmethods: {\n  ...mapActions('account', [\n    'login'\n  ])\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg0ld3lux%2Flaravel-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg0ld3lux%2Flaravel-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg0ld3lux%2Flaravel-starter/lists"}