Skip to content

Commit

Permalink
1. Modified Axios Base URL to be can customizable in .env
Browse files Browse the repository at this point in the history
2. Modified SMTP credentials to be can customizable in .env
  • Loading branch information
Abdurozzaq committed Jan 7, 2021
1 parent 733e418 commit e31b0f9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
7 changes: 5 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_URL=http://localhost:8000

FRONT_APP=http://localhost:8000
FRONT_APP="${APP_URL}"
FRONT_RESET_PASSWORD=/reset-password
FRONT_VERIFIED_EMAIL=/verification-success

MIX_APP_NAME="${APP_NAME}"
MIX_APP_URL="${APP_URL}"

LOG_CHANNEL=stack

DB_CONNECTION=mysql
Expand Down
10 changes: 5 additions & 5 deletions config/mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => 'smtp.gmail.com',
'port' => '465',
'encryption' => 'ssl',
'username' => 'abdurozzaq627@gmail.com',
'password' => 'zoowwcxfiybsuqcj',
'host' => env('MAIL_HOST'),
'port' => env('MAIL_PORT'),
'encryption' => env('MAIL_ENCRYPTION'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'timeout' => null,
],

Expand Down
9 changes: 6 additions & 3 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -158472,7 +158472,7 @@ var routes = [{

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _vuetify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vuetify */ "./resources/js/vuetify/index.js");
/* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _vuetify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vuetify */ "./resources/js/vuetify/index.js");
/* harmony import */ var _App_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./App.vue */ "./resources/js/App.vue");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js");
/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_2__);
Expand All @@ -158497,11 +158497,13 @@ window.Vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.
// For Vuelidate

// For AXIOS DEFAULT HEADERS
// axios.defaults.withCredentials = true

axios__WEBPACK_IMPORTED_MODULE_3___default.a.defaults.withCredentials = true;
axios__WEBPACK_IMPORTED_MODULE_3___default.a.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
axios__WEBPACK_IMPORTED_MODULE_3___default.a.defaults.headers.common['Content-Type'] = 'application/json';
axios__WEBPACK_IMPORTED_MODULE_3___default.a.defaults.baseURL = 'http://localhost:8000';
axios__WEBPACK_IMPORTED_MODULE_3___default.a.defaults.headers.common['Access-Control-Allow-Origin'] = '*';
axios__WEBPACK_IMPORTED_MODULE_3___default.a.defaults.headers.common['Access-Control-Allow-Credentials'] = true;
axios__WEBPACK_IMPORTED_MODULE_3___default.a.defaults.baseURL = process.env.MIX_APP_URL;
var token = localStorage.getItem('userToken');

if (token) {
Expand All @@ -158523,6 +158525,7 @@ var app = new vue__WEBPACK_IMPORTED_MODULE_2___default.a({
el: '#app',
router: router
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/process/browser.js */ "./node_modules/process/browser.js")))

/***/ }),

Expand Down
6 changes: 4 additions & 2 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ import Vuelidate from 'vuelidate'


// For AXIOS DEFAULT HEADERS
axios.defaults.withCredentials = true
// axios.defaults.withCredentials = true
axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
axios.defaults.headers.common['Content-Type'] = 'application/json';
axios.defaults.baseURL = 'http://localhost:8000';
axios.defaults.headers.common['Access-Control-Allow-Origin'] = '*';
axios.defaults.headers.common['Access-Control-Allow-Credentials'] = true;
axios.defaults.baseURL = process.env.MIX_APP_URL;

const token = localStorage.getItem('userToken')
if (token) {
Expand Down

0 comments on commit e31b0f9

Please sign in to comment.