├── public ├── favicon.ico ├── robots.txt ├── .htaccess ├── web.config └── index.php ├── database ├── .gitignore ├── seeds │ ├── DatabaseSeeder.php │ ├── RoleTableSeeder.php │ └── ClientsTableSeeder.php ├── migrations │ ├── 2019_04_09_135344_create_roles_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_04_10_184823_create_brand_user_table.php │ ├── 2019_03_30_124750_create_clients_table.php │ ├── 2019_04_06_184415_alter_users_table.php │ ├── 2019_04_09_135532_alter_users_roles_table.php │ ├── 2019_04_07_114600_alter_campaigns_table.php │ ├── 2019_03_30_124940_create_brands_table.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2019_04_12_153507_create_verified_requests_table.php │ └── 2019_03_30_125721_create_campaigns_table.php └── factories │ └── UserFactory.php ├── resources ├── app │ ├── static │ │ └── .gitkeep │ ├── src │ │ ├── assets │ │ │ ├── scss │ │ │ │ ├── pages │ │ │ │ │ ├── campaigns │ │ │ │ │ │ ├── campaigns.scss │ │ │ │ │ │ └── details.scss │ │ │ │ │ ├── loading.scss │ │ │ │ │ └── login.scss │ │ │ │ ├── components │ │ │ │ │ ├── mixin.scss │ │ │ │ │ ├── modal.scss │ │ │ │ │ ├── leftMenu.scss │ │ │ │ │ └── inputs.scss │ │ │ │ ├── general.scss │ │ │ │ └── variables.scss │ │ │ ├── logo.png │ │ │ ├── fonts │ │ │ │ ├── Roboto-Bold.ttf │ │ │ │ ├── Roboto-Light.ttf │ │ │ │ └── Roboto-Regular.ttf │ │ │ └── img │ │ │ │ └── loading-animated.gif │ │ ├── store │ │ │ ├── index.js │ │ │ └── auth.js │ │ ├── libraries │ │ │ └── index.js │ │ ├── main.js │ │ ├── App.vue │ │ ├── main │ │ │ ├── AppView.vue │ │ │ ├── login │ │ │ │ └── LoginComponent.vue │ │ │ ├── campaigns │ │ │ │ ├── details │ │ │ │ │ ├── call.vue │ │ │ │ │ ├── sms.vue │ │ │ │ │ └── detailsData.vue │ │ │ │ └── CampaignDetails.vue │ │ │ └── assetRequest │ │ │ │ └── AssetRequest.vue │ │ ├── components │ │ │ └── Loading-view.vue │ │ ├── helpers │ │ │ └── http-helper.js │ │ └── router │ │ │ └── index.js │ ├── test │ │ ├── unit │ │ │ ├── setup.js │ │ │ ├── .eslintrc │ │ │ ├── specs │ │ │ │ └── HelloWorld.spec.js │ │ │ └── jest.conf.js │ │ └── e2e │ │ │ ├── specs │ │ │ └── test.js │ │ │ ├── custom-assertions │ │ │ └── elementCount.js │ │ │ ├── nightwatch.conf.js │ │ │ └── runner.js │ ├── build │ │ ├── logo.png │ │ ├── vue-loader.conf.js │ │ ├── build.js │ │ ├── check-versions.js │ │ ├── webpack.base.conf.js │ │ ├── utils.js │ │ └── webpack.dev.conf.js │ ├── config │ │ ├── prod.env.js │ │ ├── test.env.js │ │ ├── dev.env.js │ │ └── index.js │ ├── .editorconfig │ ├── .gitignore │ ├── .postcssrc.js │ ├── index.html │ ├── .babelrc │ └── README.md ├── views │ ├── email.blade.php │ ├── index.blade.php │ └── welcome.blade.php ├── sass │ ├── app.scss │ └── _variables.scss ├── lang │ └── en │ │ ├── pagination.php │ │ ├── auth.php │ │ └── passwords.php └── js │ ├── components │ └── ExampleComponent.vue │ ├── app.js │ └── bootstrap.js ├── bootstrap ├── cache │ └── .gitignore └── app.php ├── storage ├── logs │ └── .gitignore ├── app │ ├── public │ │ └── .gitignore │ └── .gitignore └── framework │ ├── testing │ └── .gitignore │ ├── views │ └── .gitignore │ ├── cache │ ├── data │ │ └── .gitignore │ └── .gitignore │ ├── sessions │ └── .gitignore │ └── .gitignore ├── .gitattributes ├── tests ├── TestCase.php ├── Unit │ └── ExampleTest.php ├── Feature │ └── ExampleTest.php └── CreatesApplication.php ├── .gitignore ├── app ├── Role.php ├── Tenant │ ├── ForTenant.php │ ├── TenantScope.php │ ├── TenantObserver.php │ └── BrandUserScope.php ├── Http │ ├── Middleware │ │ ├── EncryptCookies.php │ │ ├── CheckForMaintenanceMode.php │ │ ├── TrimStrings.php │ │ ├── TrustProxies.php │ │ ├── Authenticate.php │ │ ├── VerifyCsrfToken.php │ │ ├── RedirectIfAuthenticated.php │ │ └── CheckRole.php │ ├── Controllers │ │ ├── Controller.php │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── ResetPasswordController.php │ │ │ ├── VerificationController.php │ │ │ └── RegisterController.php │ │ ├── BrandController.php │ │ ├── ClientController.php │ │ ├── AuthController.php │ │ ├── CampaignController.php │ │ └── VerifiedRequestController.php │ ├── Requests │ │ ├── ClientSaveRequest.php │ │ ├── ClientUpdateRequest.php │ │ ├── LoginRequest.php │ │ ├── BrandSaveRequest.php │ │ ├── BrandUpdateRequest.php │ │ ├── CampaignSaveRequest.php │ │ ├── CampaignUpdateRequest.php │ │ ├── VerifiedRequestSaveRequest.php │ │ ├── VerifiedRequestDirectRequest.php │ │ ├── UserSaveRequest.php │ │ └── UserUpdateRequest.php │ └── Kernel.php ├── Providers │ ├── BroadcastServiceProvider.php │ ├── AuthServiceProvider.php │ ├── EventServiceProvider.php │ ├── AppServiceProvider.php │ └── RouteServiceProvider.php ├── VerifiedRequest.php ├── Client.php ├── Campaign.php ├── Listeners │ └── CampaignVerifiedListener.php ├── Services │ ├── ClientService.php │ ├── BrandService.php │ ├── UserService.php │ ├── CampaignService.php │ └── Impl │ │ ├── ClientServiceImpl.php │ │ ├── BrandServiceImpl.php │ │ ├── CampaignServiceImpl.php │ │ └── UserServiceImpl.php ├── Console │ └── Kernel.php ├── Events │ └── CampaignVerifiedEvent.php ├── Mail │ └── CampaignVerifiedMail.php ├── Filters │ ├── FilterConstants.php │ └── ApiRequest.php ├── User.php ├── Brand.php └── Exceptions │ └── Handler.php ├── .editorconfig ├── routes ├── web.php ├── channels.php ├── console.php └── api.php ├── webpack.mix.js ├── readme.md ├── server.php ├── .env.example ├── config ├── view.php ├── services.php ├── hashing.php ├── broadcasting.php ├── filesystems.php ├── queue.php ├── logging.php └── cache.php ├── phpunit.xml ├── artisan └── composer.json /public/favicon.ico: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /resources/app/static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /resources/app/src/assets/scss/pages/campaigns/campaigns.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /resources/app/src/assets/scss/components/mixin.scss: -------------------------------------------------------------------------------- 1 | @mixin a($height) { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /resources/app/test/unit/setup.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | Vue.config.productionTip = false 4 | -------------------------------------------------------------------------------- /resources/app/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/CVA/master/resources/app/build/logo.png -------------------------------------------------------------------------------- /resources/app/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /resources/app/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/CVA/master/resources/app/src/assets/logo.png -------------------------------------------------------------------------------- /resources/app/test/unit/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "jest": true 4 | }, 5 | "globals": { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /resources/app/src/assets/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/CVA/master/resources/app/src/assets/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /resources/app/src/assets/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/CVA/master/resources/app/src/assets/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /resources/app/src/assets/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/CVA/master/resources/app/src/assets/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /resources/app/src/assets/img/loading-animated.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bombcheck/CVA/master/resources/app/src/assets/img/loading-animated.gif -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /resources/views/email.blade.php: -------------------------------------------------------------------------------- 1 |

Campaign: {{$title}}


2 |

Client: {{$client_name}}


3 |

Brand: {{$brand_name}}


4 |

Has been verified

-------------------------------------------------------------------------------- /resources/app/config/test.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const devEnv = require('./dev.env') 4 | 5 | module.exports = merge(devEnv, { 6 | NODE_ENV: '"testing"' 7 | }) 8 | -------------------------------------------------------------------------------- /resources/app/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /resources/app/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | hasMany(User::class); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.yml] 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /resources/app/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | /dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | /test/unit/coverage/ 8 | /test/e2e/reports/ 9 | selenium-debug.log 10 | 11 | # Editor directories and files 12 | .idea 13 | .vscode 14 | *.suo 15 | *.ntvs* 16 | *.njsproj 17 | *.sln 18 | -------------------------------------------------------------------------------- /resources/app/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import url('https://fonts.googleapis.com/css?family=Nunito'); 4 | 5 | // Variables 6 | @import 'variables'; 7 | 8 | // Bootstrap 9 | @import '~bootstrap/scss/bootstrap'; 10 | 11 | .navbar-laravel { 12 | background-color: #fff; 13 | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); 14 | } 15 | -------------------------------------------------------------------------------- /resources/app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | app 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /resources/app/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | import persistedState from 'vuex-persistedstate' 5 | import authStore from './auth' 6 | 7 | 8 | Vue.use(Vuex) 9 | 10 | export const store = new Vuex.Store({ 11 | modules: { 12 | authStore: authStore, 13 | }, 14 | plugins: [persistedState()] 15 | }) 16 | -------------------------------------------------------------------------------- /app/Tenant/ForTenant.php: -------------------------------------------------------------------------------- 1 | make(TenantObserver::class) 16 | ); 17 | } 18 | } -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | call(RoleTableSeeder::class); 15 | $this->call(ClientsTableSeeder::class); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/Unit/ExampleTest.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /resources/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | 2 | // Body 3 | $body-bg: #f8fafc; 4 | 5 | // Typography 6 | $font-family-sans-serif: "Nunito", sans-serif; 7 | $font-size-base: 0.9rem; 8 | $line-height-base: 1.6; 9 | 10 | // Colors 11 | $blue: #3490dc; 12 | $indigo: #6574cd; 13 | $purple: #9561e2; 14 | $pink: #f66D9b; 15 | $red: #e3342f; 16 | $orange: #f6993f; 17 | $yellow: #ffed4a; 18 | $green: #38c172; 19 | $teal: #4dc0b5; 20 | $cyan: #6cb2eb; 21 | -------------------------------------------------------------------------------- /resources/app/test/unit/specs/HelloWorld.spec.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import HelloWorld from '@/components/HelloWorld' 3 | 4 | describe('HelloWorld.vue', () => { 5 | it('should render correct contents', () => { 6 | const Constructor = Vue.extend(HelloWorld) 7 | const vm = new Constructor().$mount() 8 | expect(vm.$el.querySelector('.hello h1').textContent) 9 | .toEqual('Welcome to Your Vue.js App') 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /resources/app/src/libraries/index.js: -------------------------------------------------------------------------------- 1 | import 'jquery/src/jquery.js' 2 | import 'bootstrap/dist/js/bootstrap.min.js' 3 | import 'sweetalert2/dist/sweetalert2.js' 4 | import 'sweetalert2/dist/sweetalert2.css' 5 | import 'bootstrap/dist/css/bootstrap.css' 6 | import 'font-awesome/css/font-awesome.css' 7 | // import "flat-icons/ecommerce.css" 8 | // import "flat-icons/interface.css" 9 | // import "flat-icons/technology.css" 10 | // import "flat-icons/creative.css" 11 | 12 | export default { 13 | } 14 | -------------------------------------------------------------------------------- /resources/app/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-vue-jsx", "transform-runtime"], 12 | "env": { 13 | "test": { 14 | "presets": ["env", "stage-2"], 15 | "plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | app
-------------------------------------------------------------------------------- /app/VerifiedRequest.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class, 'user_id'); 17 | } 18 | 19 | public function campaign() 20 | { 21 | return $this->belongsTo(Campaign::class, 'campaign_id'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | ' 22 | }) 23 | -------------------------------------------------------------------------------- /app/Client.php: -------------------------------------------------------------------------------- 1 | hasMany(Brand::class); 20 | } 21 | 22 | public function campaigns() 23 | { 24 | return $this->hasMany(Campaign::class); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 16 | }); 17 | -------------------------------------------------------------------------------- /app/Tenant/TenantScope.php: -------------------------------------------------------------------------------- 1 | user()) { 15 | if(!\Auth::user()->hasRole('super admin')) { 16 | return $builder->where('client_id', '=', \Auth::user()->getClientId()); 17 | } 18 | } 19 | return $builder; 20 | } 21 | } -------------------------------------------------------------------------------- /resources/app/src/assets/scss/general.scss: -------------------------------------------------------------------------------- 1 | .noPadding { 2 | padding: 0 !important; 3 | } 4 | 5 | .noMargin { 6 | margin: 0 !important; 7 | } 8 | 9 | .horizontal__line{ 10 | background-color: $borderMenu; 11 | height: 1px; 12 | float: left; 13 | width: calc(100% - 20px); 14 | margin: 0 10px; 15 | } 16 | 17 | .form-line { 18 | float: left; 19 | width: 100%; 20 | } 21 | 22 | ::placeholder { 23 | color: $placeholder !important; 24 | } 25 | 26 | .sweetalert-sm { 27 | font-size: 10px !important; 28 | } 29 | 30 | .cursorDedault { 31 | cursor: default !important; 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /resources/app/test/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // For authoring Nightwatch tests, see 2 | // http://nightwatchjs.org/guide#usage 3 | 4 | module.exports = { 5 | 'default e2e tests': function (browser) { 6 | // automatically uses dev Server port from /config.index.js 7 | // default: http://localhost:8080 8 | // see nightwatch.conf.js 9 | const devServer = browser.globals.devServerURL 10 | 11 | browser 12 | .url(devServer) 13 | .waitForElementVisible('#app', 5000) 14 | .assert.elementPresent('.hello') 15 | .assert.containsText('h1', 'Welcome to Your Vue.js App') 16 | .assert.elementCount('img', 1) 17 | .end() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Requests/ClientSaveRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Http/Requests/ClientUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /resources/app/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /resources/js/components/ExampleComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /resources/app/README.md: -------------------------------------------------------------------------------- 1 | # app 2 | 3 | > 'Client Asset Verification' 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | 20 | # run unit tests 21 | npm run unit 22 | 23 | # run e2e tests 24 | npm run e2e 25 | 26 | # run all tests 27 | npm test 28 | ``` 29 | 30 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 31 | -------------------------------------------------------------------------------- /app/Campaign.php: -------------------------------------------------------------------------------- 1 | belongsTo(Brand::class, 'brand_id'); 26 | } 27 | 28 | public function client() 29 | { 30 | return $this->belongsTo(Client::class, 'client_id'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /app/Http/Requests/LoginRequest.php: -------------------------------------------------------------------------------- 1 | 'required|string|email', 28 | 'password' => 'required|string', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Requests/BrandSaveRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 28 | 'client_id' => 'required|exists:clients,id', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Requests/BrandUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 28 | 'client_id' => 'required|exists:clients,id', 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Tenant/TenantObserver.php: -------------------------------------------------------------------------------- 1 | user() != null ) { 13 | if( \Auth::user()->getClientId() != null){ 14 | $model->setAttribute('client_id', \Auth::user()->getClientId()); 15 | } 16 | elseif (request()->has('client_id')) { 17 | $model->setAttribute('client_id', request('client_id')); 18 | } 19 | } 20 | elseif (request()->has('client_id')) { 21 | $model->setAttribute('client_id', request('client_id')); 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 18 | ]; 19 | 20 | /** 21 | * Register any authentication / authorization services. 22 | * 23 | * @return void 24 | */ 25 | public function boot() 26 | { 27 | $this->registerPolicies(); 28 | Passport::routes(); 29 | // 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /resources/app/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 36 | 37 | -------------------------------------------------------------------------------- /app/Http/Requests/CampaignSaveRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 28 | 'description' => 'required', 29 | 'brand_id' => 'required|exists:brands,id', 30 | 'client_id' => 'required|exists:clients,id', 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Requests/CampaignUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 28 | 'description' => 'required', 29 | 'brand_id' => 'required|exists:brands,id', 30 | 'client_id' => 'required|exists:clients,id', 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Requests/VerifiedRequestSaveRequest.php: -------------------------------------------------------------------------------- 1 | 'required|exists:campaigns,id', 29 | 'entity' => [ 'required', Rule::in(['SMS', 'EMAIL', 'CALL', 'CAMPAIGN']) ], 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Requests/VerifiedRequestDirectRequest.php: -------------------------------------------------------------------------------- 1 | 'required|exists:campaigns,id', 29 | 'entity' => [ 'required', Rule::in(['SMS', 'EMAIL', 'CALL', 'CAMPAIGN']) ], 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2019_04_09_135344_create_roles_table.php: -------------------------------------------------------------------------------- 1 | bigInteger('id')->unsigned(); 18 | $table->primary('id'); 19 | $table->string('name'); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('roles'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /resources/app/test/unit/jest.conf.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | 3 | module.exports = { 4 | rootDir: path.resolve(__dirname, '../../'), 5 | moduleFileExtensions: [ 6 | 'js', 7 | 'json', 8 | 'vue' 9 | ], 10 | moduleNameMapper: { 11 | '^@/(.*)$': '/src/$1' 12 | }, 13 | transform: { 14 | '^.+\\.js$': '/node_modules/babel-jest', 15 | '.*\\.(vue)$': '/node_modules/vue-jest' 16 | }, 17 | testPathIgnorePatterns: [ 18 | '/test/e2e' 19 | ], 20 | snapshotSerializers: ['/node_modules/jest-serializer-vue'], 21 | setupFiles: ['/test/unit/setup'], 22 | mapCoverage: true, 23 | coverageDirectory: '/test/unit/coverage', 24 | collectCoverageFrom: [ 25 | 'src/**/*.{js,vue}', 26 | '!src/main.js', 27 | '!src/router/index.js', 28 | '!**/node_modules/**' 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least eight characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 19 | 'App\Listeners\CampaignVerifiedListener' 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | parent::boot(); 31 | 32 | // 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Listeners/CampaignVerifiedListener.php: -------------------------------------------------------------------------------- 1 | cc('ces@tricycleltd.com')->send(new CampaignVerifiedMail($event->campaign)); 31 | Mail::to('triumf.maqedonci@gmail.com')->send(new CampaignVerifiedMail($event->campaign)); 32 | 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /database/migrations/2019_04_10_184823_create_brand_user_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id')->unsigned(); 18 | $table->bigInteger('brand_id')->unsigned(); 19 | $table->bigInteger('user_id')->unsigned(); 20 | $table->timestamps(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::dropIfExists('brand_user'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /resources/app/test/e2e/custom-assertions/elementCount.js: -------------------------------------------------------------------------------- 1 | // A custom Nightwatch assertion. 2 | // The assertion name is the filename. 3 | // Example usage: 4 | // 5 | // browser.assert.elementCount(selector, count) 6 | // 7 | // For more information on custom assertions see: 8 | // http://nightwatchjs.org/guide#writing-custom-assertions 9 | 10 | exports.assertion = function (selector, count) { 11 | this.message = 'Testing if element <' + selector + '> has count: ' + count 12 | this.expected = count 13 | this.pass = function (val) { 14 | return val === this.expected 15 | } 16 | this.value = function (res) { 17 | return res.value 18 | } 19 | this.command = function (cb) { 20 | var self = this 21 | return this.api.execute(function (selector) { 22 | return document.querySelectorAll(selector).length 23 | }, [selector], function (res) { 24 | cb.call(self, res) 25 | }) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=127.0.0.1 11 | DB_PORT=3306 12 | DB_DATABASE=homestead 13 | DB_USERNAME=homestead 14 | DB_PASSWORD=secret 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | QUEUE_CONNECTION=sync 19 | SESSION_DRIVER=file 20 | SESSION_LIFETIME=120 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | AWS_ACCESS_KEY_ID= 34 | AWS_SECRET_ACCESS_KEY= 35 | AWS_DEFAULT_REGION=us-east-1 36 | AWS_BUCKET= 37 | 38 | PUSHER_APP_ID= 39 | PUSHER_APP_KEY= 40 | PUSHER_APP_SECRET= 41 | PUSHER_APP_CLUSTER=mt1 42 | 43 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 44 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 45 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 19 | return [ 20 | 'name' => $faker->name, 21 | 'email' => $faker->unique()->safeEmail, 22 | 'email_verified_at' => now(), 23 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 24 | 'remember_token' => Str::random(10), 25 | ]; 26 | }); 27 | -------------------------------------------------------------------------------- /database/migrations/2019_03_30_124750_create_clients_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('name'); 19 | $table->string('iwinback_api_key')->nullable(); 20 | $table->string('iwinback_api_secret')->nullable(); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('clients'); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2019_04_06_184415_alter_users_table.php: -------------------------------------------------------------------------------- 1 | bigInteger('client_id')->unsigned()->nullable(); 18 | 19 | $table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::table('users', function (Blueprint $table) { 31 | $table->dropColumn('client_id'); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2019_04_09_135532_alter_users_roles_table.php: -------------------------------------------------------------------------------- 1 | bigInteger('role_id')->unsigned()->nullable(); 18 | 19 | $table->foreign('role_id')->references('id')->on('roles')->onDelete('cascade'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::table('users', function (Blueprint $table) { 31 | $table->dropColumn('role_id'); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /database/migrations/2019_04_07_114600_alter_campaigns_table.php: -------------------------------------------------------------------------------- 1 | bigInteger('client_id')->unsigned()->nullable(); 18 | 19 | $table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::table('campaigns', function (Blueprint $table) { 31 | $table->dropColumn('client_id'); 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Tenant/BrandUserScope.php: -------------------------------------------------------------------------------- 1 | role_id == 3 || \Auth::user()->role_id == 4) { 25 | $user_id = \Auth::user()->id; 26 | $brand_ids = Brand::whereHas('users', function ($q) use ($user_id) { 27 | $q->where('user_id', $user_id); 28 | })->pluck('id'); 29 | $builder->whereIn('id', $brand_ids); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /database/seeds/RoleTableSeeder.php: -------------------------------------------------------------------------------- 1 | id = 1; 19 | $role1->name = 'super admin'; 20 | $role1->save(); 21 | 22 | $role2 = new Role(); 23 | $role2->id =2; 24 | $role2->name = 'client admin'; 25 | $role2->save(); 26 | 27 | $role3 = new Role(); 28 | $role3->id =3; 29 | $role3->name = 'client user'; 30 | $role3->save(); 31 | 32 | $role4 = new Role(); 33 | $role4->id =4; 34 | $role4->name = 'client viewer'; 35 | $role4->save(); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /database/migrations/2019_03_30_124940_create_brands_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id')->unsigned(); 18 | $table->string('name'); 19 | $table->bigInteger('client_id')->unsigned(); 20 | 21 | $table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade'); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::dropIfExists('brands'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /resources/app/src/main/AppView.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 42 | -------------------------------------------------------------------------------- /app/Services/ClientService.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | $this->load(__DIR__.'/Commands'); 39 | 40 | require base_path('routes/console.php'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Services/BrandService.php: -------------------------------------------------------------------------------- 1 | campaign = $campaign; 27 | } 28 | 29 | /** 30 | * Get the channels the event should broadcast on. 31 | * 32 | * @return \Illuminate\Broadcasting\Channel|array 33 | */ 34 | public function broadcastOn() 35 | { 36 | return new PrivateChannel('channel-name'); 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /app/Http/Requests/UserSaveRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 28 | 'last_name' => 'required', 29 | 'username' => 'required|unique:users', 30 | 'email' => 'required|email|unique:users', 31 | 'password' => 'required', 32 | 'retype_password' => 'required|same:password', 33 | 'active' => 'required', 34 | 'role_id' => 'required', 35 | 'client_id' => 'exists:clients,id', 36 | 'brands' => 'array', 37 | ]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Services/UserService.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('first_name'); 19 | $table->string('last_name'); 20 | $table->string('username')->unique(); 21 | $table->string('email')->unique(); 22 | $table->string('password'); 23 | $table->boolean('active')->default(true); 24 | $table->rememberToken(); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('users'); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Requests/UserUpdateRequest.php: -------------------------------------------------------------------------------- 1 | 'required', 28 | 'last_name' => 'required', 29 | 'username' => 'required|unique:users,username,' . $this->id, 30 | 'email' => 'required|email|unique:users,email,'. $this->id, 31 | 'active' => 'required', 32 | 'password' => 'sometimes|required', 33 | 'retype_password' => 'required_with:password|same:password', 34 | 'role_id' => 'required', 35 | 'client_id' => 'exists:clients,id', 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Mail/CampaignVerifiedMail.php: -------------------------------------------------------------------------------- 1 | campaign = $campaign; 25 | } 26 | 27 | /** 28 | * Build the message. 29 | * 30 | * @return $this 31 | */ 32 | public function build() 33 | { 34 | return $this->view('email') 35 | ->with([ 36 | 'title' => $this->campaign->title, 37 | 'client_name' => $this->campaign->client->name, 38 | 'brand_name' => $this->campaign->brand->name, 39 | ]) 40 | ->subject("CAV: Campaign " .$this->campaign->title. " has been verified!"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Services/CampaignService.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | belongsTo(Role::class, 'role_id'); 35 | } 36 | 37 | public function brands() 38 | { 39 | return $this->belongsToMany(Brand::class); 40 | } 41 | 42 | public function getClientId() 43 | { 44 | return $this->client_id; 45 | } 46 | 47 | public function hasRole($role) 48 | { 49 | return $this->role->name == $role; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /app/Brand.php: -------------------------------------------------------------------------------- 1 | role_id == 3 || \Auth::user()->role_id == 4) { 26 | $user_id = \Auth::user()->id; 27 | $builder->whereHas('users', function ($q) use ($user_id) { 28 | $q->where('user_id', $user_id); 29 | }); 30 | } 31 | }); 32 | } 33 | 34 | public function client() 35 | { 36 | return $this->belongsTo(Client::class, 'client_id'); 37 | } 38 | 39 | public function campaigns() 40 | { 41 | return $this->hasMany(Campaign::class); 42 | } 43 | 44 | public function users() 45 | { 46 | return $this->belongsToMany(User::class); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * First we will load all of this project's JavaScript dependencies which 4 | * includes Vue and other libraries. It is a great starting point when 5 | * building robust, powerful web applications using Vue and Laravel. 6 | */ 7 | 8 | require('./bootstrap'); 9 | 10 | window.Vue = require('vue'); 11 | 12 | /** 13 | * The following block of code may be used to automatically register your 14 | * Vue components. It will recursively scan this directory for the Vue 15 | * components and automatically register them with their "basename". 16 | * 17 | * Eg. ./components/ExampleComponent.vue -> 18 | */ 19 | 20 | // const files = require.context('./', true, /\.vue$/i); 21 | // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)); 22 | 23 | Vue.component('example-component', require('./components/ExampleComponent.vue').default); 24 | 25 | /** 26 | * Next, we will create a fresh Vue application instance and attach it to 27 | * the page. Then, you may begin adding components to this application 28 | * or customize the JavaScript scaffolding to fit your unique needs. 29 | */ 30 | 31 | const app = new Vue({ 32 | el: '#app' 33 | }); 34 | -------------------------------------------------------------------------------- /resources/app/test/e2e/nightwatch.conf.js: -------------------------------------------------------------------------------- 1 | require('babel-register') 2 | var config = require('../../config') 3 | 4 | // http://nightwatchjs.org/gettingstarted#settings-file 5 | module.exports = { 6 | src_folders: ['test/e2e/specs'], 7 | output_folder: 'test/e2e/reports', 8 | custom_assertions_path: ['test/e2e/custom-assertions'], 9 | 10 | selenium: { 11 | start_process: true, 12 | server_path: require('selenium-server').path, 13 | host: '127.0.0.1', 14 | port: 4444, 15 | cli_args: { 16 | 'webdriver.chrome.driver': require('chromedriver').path 17 | } 18 | }, 19 | 20 | test_settings: { 21 | default: { 22 | selenium_port: 4444, 23 | selenium_host: 'localhost', 24 | silent: true, 25 | globals: { 26 | devServerURL: 'http://localhost:' + (process.env.PORT || config.dev.port) 27 | } 28 | }, 29 | 30 | chrome: { 31 | desiredCapabilities: { 32 | browserName: 'chrome', 33 | javascriptEnabled: true, 34 | acceptSslCerts: true 35 | } 36 | }, 37 | 38 | firefox: { 39 | desiredCapabilities: { 40 | browserName: 'firefox', 41 | javascriptEnabled: true, 42 | acceptSslCerts: true 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /resources/app/src/assets/scss/pages/campaigns/details.scss: -------------------------------------------------------------------------------- 1 | .campaign__new--details { 2 | width: 100%; 3 | float: left; 4 | } 5 | 6 | .html_text--details { 7 | float: left; 8 | width: 100%; 9 | } 10 | 11 | .ck-editor__editable { 12 | height: 300px; 13 | } 14 | 15 | .email { 16 | position: relative; 17 | 18 | .box__source{ 19 | position: absolute; 20 | border-left: 1px solid #c4c4c4; 21 | top: 31px; 22 | right: 0px; 23 | height: 40px; 24 | z-index: 1; 25 | 26 | } 27 | .btn_source-html{ 28 | background: transparent; 29 | border: none; 30 | height: 30px; 31 | font-size: 15px; 32 | margin: 5px; 33 | color: #333; 34 | font-weight: 600; 35 | padding: 0px 15px; 36 | border-radius: 2px; 37 | cursor: pointer; 38 | 39 | &:hover { 40 | background: #dedede; 41 | } 42 | &.active { 43 | background: #dedede; 44 | } 45 | } 46 | 47 | .email_html-code { 48 | position: absolute; 49 | background: #fefefe; 50 | border: none; 51 | top: 71px; 52 | left: 1px; 53 | width: 775px; 54 | z-index: 1; 55 | height: 298px; 56 | word-wrap: break-word; 57 | padding: 5px; 58 | overflow-x: auto; 59 | font-size: 15px; 60 | resize: none; 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/VerificationController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 38 | $this->middleware('signed')->only('verify'); 39 | $this->middleware('throttle:6,1')->only('verify', 'resend'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Unit 14 | 15 | 16 | 17 | ./tests/Feature 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /resources/app/src/components/Loading-view.vue: -------------------------------------------------------------------------------- 1 | 8 | 57 | -------------------------------------------------------------------------------- /app/Filters/ApiRequest.php: -------------------------------------------------------------------------------- 1 | allowedIncludes($includes) 23 | ->allowedFilters(self::constructFilters($filters)); 24 | return $query; 25 | } 26 | 27 | /** 28 | * Construct Filters 29 | * @param $filters 30 | * @return array 31 | */ 32 | private static function constructFilters($filters){ 33 | if($filters == []) 34 | return $filters; 35 | $exact = []; 36 | $custom = []; 37 | foreach ($filters['exact'] as $filter) { 38 | $exact[] = Filter::exact($filter); 39 | } 40 | if(array_key_exists('custom',$filters)){ 41 | foreach ($filters['custom'] as $key=>$value) { 42 | $custom[] = Filter::custom($key,$value); 43 | } 44 | } 45 | return array_merge($exact,$filters['partial'], $custom); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /resources/app/src/helpers/http-helper.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import {store} from '../store' 3 | 4 | export const Http = axios.create({ 5 | baseURL: 'api/' 6 | }) 7 | 8 | Http.interceptors.request.use(function (request) { 9 | request.headers.Authorization = 'Bearer ' + store.state.authStore.token.access_token 10 | 11 | return request 12 | }) 13 | 14 | Http.interceptors.response.use(response => { 15 | return response 16 | }, error => { 17 | // if (error.response.status == 409) { 18 | // store.dispatch('errorsStore/addError', {title: error.response.data.error, body: error.response.data.message, status: error.response.status}) 19 | // } else if (error.response.status == 401 && error.response.data.type == null) { 20 | // localStorage.setItem('vuex', '') 21 | // window.location.replace('/') 22 | // } else if (error.response.status == 500) { 23 | // if (error.response.data.errors != null) { 24 | // swal.fire({title: 'Server error!', text: error.response.data.errors.general, type: 'error'}) 25 | // } else { 26 | // swal.fire({title: 'Server error!', text: null, type: 'error'}) 27 | // } 28 | // } else { 29 | // console.log('Time !!') 30 | // } 31 | return Promise.reject(error) 32 | }) 33 | 34 | export const AuthHttp = axios.create({ 35 | headers: { 36 | 'Content-Type': 'multipart/form-data' 37 | } 38 | }) 39 | -------------------------------------------------------------------------------- /database/migrations/2019_04_12_153507_create_verified_requests_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('entity'); 19 | $table->bigInteger('user_id')->unsigned()->nullable(); 20 | $table->bigInteger('campaign_id')->unsigned()->nullable(); 21 | $table->bigInteger('client_id')->unsigned()->nullable(); 22 | 23 | 24 | $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); 25 | $table->foreign('campaign_id')->references('id')->on('campaigns')->onDelete('cascade'); 26 | $table->foreign('client_id')->references('id')->on('clients')->onDelete('cascade'); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | /** 32 | * Reverse the migrations. 33 | * 34 | * @return void 35 | */ 36 | public function down() 37 | { 38 | Schema::dropIfExists('verified_requests'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /resources/app/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind(ClientService::class,ClientServiceImpl::class); 27 | $this->app->bind(BrandService::class,BrandServiceImpl::class); 28 | $this->app->bind(CampaignService::class,CampaignServiceImpl::class); 29 | $this->app->bind(UserService::class,UserServiceImpl::class); 30 | } 31 | 32 | /** 33 | * Bootstrap any application services. 34 | * 35 | * @return void 36 | */ 37 | public function boot() 38 | { 39 | Schema::defaultStringLength(191); 40 | $this->app->singleton(TenantObserver::class, function (){ 41 | return new TenantObserver(); 42 | }); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /resources/app/src/assets/scss/variables.scss: -------------------------------------------------------------------------------- 1 | // Fonts 2 | $roboto: 'Roboto', sans-serif; 3 | 4 | 5 | // Main COLORS 6 | $header: #2548a6; 7 | $menu: #ffffff; 8 | 9 | 10 | // Text 11 | $alphabet: #f3f7fc; 12 | $alphabetMenu: rgba(0,0,0,.54); 13 | $alphabetContent: rgba(0,0,0,.64); 14 | $alphabetInput: rgb(73, 80, 87); 15 | 16 | 17 | // Link ------ 18 | $actions-color: #162B4D; 19 | $activeItemMenuColor: #2548a6; 20 | $activeItemMenuHover: #e3e5e6; 21 | 22 | // Border 23 | $borderMenu: rgba(0,0,0,.12); 24 | $borderInput: rgba(0,0,0,.60); 25 | $borderButton: rgba(0,0,0,.60); 26 | 27 | // Hover 28 | $hoverRowLink: rgba(0,0,0,.07); 29 | $hoverItemSubMenu: rgba(0,0,0,.04); 30 | 31 | 32 | // Colors 33 | $mainTextColor: #777; 34 | $mainGrey: #d9d9d9; 35 | $secGrey: #ecf0f1; 36 | $thirdGrey: #d4d8d8; 37 | $lightGrey: #f1f2f6; 38 | $clouds: #ecf0f1; 39 | $secCloud: #ececec; 40 | $labelColor: #69747d; 41 | $placeholder: #bdbdbd; 42 | 43 | //Success case colors 44 | $greenColor:#5cb85c; 45 | $greenAlphaColor: #90d09c; 46 | 47 | //Error case colors 48 | $redColor: #d9534f; 49 | $redAlphaColor: #de9492; 50 | 51 | // BEZIERS 52 | $firstBezier: cubic-bezier(.4,1,1,1); 53 | $secondBezier: cubic-bezier(0,.98,.53,.95); 54 | 55 | // SHADOWS 56 | $firstShadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24); 57 | $secondShadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); 58 | 59 | // TABLE COLORS 60 | $table-head: #646466; 61 | $table-cell: #f5f6f8; 62 | $table-cell-font: #9e9e9e; 63 | -------------------------------------------------------------------------------- /app/Http/Controllers/BrandController.php: -------------------------------------------------------------------------------- 1 | service = $brandService; 17 | } 18 | 19 | public function index() 20 | { 21 | return $this->service->findAll(); 22 | } 23 | 24 | public function show($id) 25 | { 26 | return $this->service->show($id); 27 | } 28 | 29 | public function store(BrandSaveRequest $request) 30 | { 31 | $brand = new Brand(); 32 | 33 | $brand->name = $request->json("name"); 34 | $brand->client_id = $request->json("client_id"); 35 | 36 | return $this->service->save($brand); 37 | } 38 | 39 | public function update(BrandUpdateRequest $request, $id) 40 | { 41 | $brand = Brand::findOrFail($id); 42 | 43 | $brand->name = $request->json("name"); 44 | $brand->client_id = $request->json("client_id"); 45 | 46 | return $this->service->update($brand); 47 | } 48 | 49 | public function destroy($id) 50 | { 51 | return $this->service->delete($id); 52 | } 53 | 54 | public function getByClientId($client_id) 55 | { 56 | return $this->service->getByClientId($client_id); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | 'sparkpost' => [ 34 | 'secret' => env('SPARKPOST_SECRET'), 35 | ], 36 | 37 | 'stripe' => [ 38 | 'model' => App\User::class, 39 | 'key' => env('STRIPE_KEY'), 40 | 'secret' => env('STRIPE_SECRET'), 41 | 'webhook' => [ 42 | 'secret' => env('STRIPE_WEBHOOK_SECRET'), 43 | 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), 44 | ], 45 | ], 46 | 47 | ]; 48 | -------------------------------------------------------------------------------- /resources/app/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /database/migrations/2019_03_30_125721_create_campaigns_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id')->unsigned(); 18 | $table->string('title'); 19 | $table->string('description'); 20 | $table->text('sms_script')->nullable(); 21 | $table->text('call_script')->nullable(); 22 | $table->text('email_subject')->nullable(); 23 | $table->text('email_html')->nullable(); 24 | $table->boolean('sms_verified')->default(false); 25 | $table->boolean('call_verified')->default(false); 26 | $table->boolean('email_verified')->default(false); 27 | $table->boolean('campaign_verified')->default(false); 28 | 29 | $table->bigInteger('brand_id')->unsigned(); 30 | 31 | $table->foreign('brand_id')->references('id')->on('brands')->onDelete('cascade'); 32 | $table->timestamps(); 33 | }); 34 | } 35 | 36 | /** 37 | * Reverse the migrations. 38 | * 39 | * @return void 40 | */ 41 | public function down() 42 | { 43 | Schema::dropIfExists('campaigns'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Http/Controllers/ClientController.php: -------------------------------------------------------------------------------- 1 | service = $clientService; 17 | } 18 | 19 | public function index() 20 | { 21 | return $this->service->findAll(); 22 | } 23 | 24 | public function show($id) 25 | { 26 | return $this->service->show($id); 27 | } 28 | 29 | public function store(ClientSaveRequest $request) 30 | { 31 | $client = new Client(); 32 | 33 | $client->name = $request->json("name"); 34 | $client->iwinback_api_key = $request->json("iwinback_api_key"); 35 | $client->iwinback_api_secret = $request->json("iwinback_api_secret"); 36 | 37 | return $this->service->save($client); 38 | } 39 | 40 | public function update(ClientUpdateRequest $request, $id) 41 | { 42 | $client = Client::findOrFail($id); 43 | 44 | $client->name = $request->json("name"); 45 | $client->iwinback_api_key = $request->json("iwinback_api_key"); 46 | $client->iwinback_api_secret = $request->json("iwinback_api_secret"); 47 | 48 | return $this->service->update($client); 49 | } 50 | 51 | public function destroy($id) 52 | { 53 | return $this->service->delete($id); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/Http/Middleware/CheckRole.php: -------------------------------------------------------------------------------- 1 | ['general' => [ 'You are not authorized' ]] ], 403); 22 | 23 | $roleName = $user->role->name; 24 | 25 | if($role == 'client viewer') 26 | return $next($request); 27 | 28 | if($roleName == 'super admin' ){ 29 | return $next($request); 30 | } 31 | switch($role) 32 | { 33 | case 'super admin': 34 | return response(['errors' => ['general' => [ 'You are not authorized' ]] ], 403); 35 | break; 36 | case 'client admin': 37 | if($roleName == $role) 38 | return $next($request); 39 | return response(['errors' => ['general' => [ 'You are not authorized' ]] ], 403); 40 | break; 41 | case 'client user': 42 | if($roleName == $role || $roleName == 'client admin') 43 | return $next($request); 44 | return response(['errors' => ['general' => [ 'You are not authorized' ]] ], 403); 45 | } 46 | return response(['errors' => ['general' => [ 'You are not authorized' ]] ], 403); 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /resources/app/src/store/auth.js: -------------------------------------------------------------------------------- 1 | import {AuthHttp} from '@/helpers/http-helper' 2 | import router from '@/router/index' 3 | 4 | const state = { 5 | token: { 6 | access_token: '', 7 | token_type: '', 8 | expires_in: '', 9 | scope: '', 10 | jti: '', 11 | test: '', 12 | loginUser: '', 13 | }, 14 | errors: { 15 | email: '', 16 | password: '' 17 | }, 18 | } 19 | 20 | const getters = { 21 | getToken: state => state.token, 22 | getErrors: state => state.errors 23 | } 24 | 25 | const mutations = { 26 | setToken (state, token) { 27 | state.token = token 28 | }, 29 | setError (state, errors) { 30 | state.errors = errors 31 | }, 32 | setUser (state, loginUser) { 33 | state.loginUser = loginUser 34 | } 35 | } 36 | 37 | const actions = { 38 | login ({ commit }, user) { 39 | let formData = new FormData() 40 | formData.set('email', user.email) 41 | formData.set('password', user.password) 42 | formData.set('grant_type', 'password') 43 | 44 | AuthHttp.post('api/auth/login', formData) 45 | .then(response => { 46 | commit('setToken', response.data) 47 | router.push({name: '/'}) 48 | }).catch(e => { 49 | commit('setError', e.response.data.errors) 50 | localStorage.setItem('vuex', '') 51 | }) 52 | }, 53 | user_ ({ commit }) { 54 | AuthHttp.get(`auth/details`) 55 | .then(response => { 56 | commit('setUser', response.data) 57 | console.log(response.data) 58 | }) 59 | } 60 | } 61 | 62 | export default { 63 | namespaced: true, 64 | 65 | state: state, 66 | getters: getters, 67 | mutations: mutations, 68 | actions: actions 69 | } 70 | -------------------------------------------------------------------------------- /resources/app/test/e2e/runner.js: -------------------------------------------------------------------------------- 1 | // 1. start the dev server using production config 2 | process.env.NODE_ENV = 'testing' 3 | 4 | const webpack = require('webpack') 5 | const DevServer = require('webpack-dev-server') 6 | 7 | const webpackConfig = require('../../build/webpack.prod.conf') 8 | const devConfigPromise = require('../../build/webpack.dev.conf') 9 | 10 | let server 11 | 12 | devConfigPromise.then(devConfig => { 13 | const devServerOptions = devConfig.devServer 14 | const compiler = webpack(webpackConfig) 15 | server = new DevServer(compiler, devServerOptions) 16 | const port = devServerOptions.port 17 | const host = devServerOptions.host 18 | return server.listen(port, host) 19 | }) 20 | .then(() => { 21 | // 2. run the nightwatch test suite against it 22 | // to run in additional browsers: 23 | // 1. add an entry in test/e2e/nightwatch.conf.js under "test_settings" 24 | // 2. add it to the --env flag below 25 | // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox` 26 | // For more information on Nightwatch's config file, see 27 | // http://nightwatchjs.org/guide#settings-file 28 | let opts = process.argv.slice(2) 29 | if (opts.indexOf('--config') === -1) { 30 | opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js']) 31 | } 32 | if (opts.indexOf('--env') === -1) { 33 | opts = opts.concat(['--env', 'chrome']) 34 | } 35 | 36 | const spawn = require('cross-spawn') 37 | const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' }) 38 | 39 | runner.on('exit', function (code) { 40 | server.close() 41 | process.exit(code) 42 | }) 43 | 44 | runner.on('error', function (err) { 45 | server.close() 46 | throw err 47 | }) 48 | }) 49 | -------------------------------------------------------------------------------- /resources/app/src/assets/scss/pages/login.scss: -------------------------------------------------------------------------------- 1 | .login__form{ 2 | position: absolute; 3 | top: 200px; 4 | float: left; 5 | width: 400px; 6 | margin-left: calc(50% - 200px); 7 | margin-right: calc(50% - 200px); 8 | background-color: white; 9 | 10 | .login--form{ 11 | width: 80%; 12 | margin-left: 10%; 13 | margin-right: 10%; 14 | margin-top: 65px; 15 | margin-bottom: 65px; 16 | float: left; 17 | height: 370px; 18 | 19 | .login_icon{ 20 | float: left; 21 | width: 100%; 22 | margin-bottom: 80px; 23 | text-align: center; 24 | color: $clouds; 25 | 26 | .login--icon{ 27 | float: left; 28 | height: 35px; 29 | width: 100%; 30 | margin-bottom: 10px; 31 | 32 | .__icon{ 33 | font-size: 35px !important; 34 | } 35 | } 36 | 37 | .product_name { 38 | text-transform: uppercase; 39 | font-size: 20px; 40 | } 41 | } 42 | 43 | .login_input{ 44 | width: 100%; 45 | float: left; 46 | height: 80px; 47 | 48 | input:-webkit-autofill { 49 | -webkit-box-shadow: 0 0 0 1000px white inset; 50 | } 51 | 52 | .login_input-value{ 53 | float: left; 54 | width: 100%; 55 | border: 0; 56 | border-bottom: 1px solid gray; 57 | padding-left: 5px; 58 | } 59 | .error__input{ 60 | float: left; 61 | font-size: 13px; 62 | color: $redColor; 63 | margin-top: 3px; 64 | } 65 | } 66 | } 67 | } 68 | 69 | .btn_login{ 70 | float: right; 71 | margin-top: 15px; 72 | 73 | .login_btn{ 74 | width: 100%; 75 | //background-color: $clouds; 76 | color: white; 77 | padding: 7px; 78 | border: 0; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'encrypted' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::middleware('web') 55 | ->namespace($this->namespace) 56 | ->group(base_path('routes/web.php')); 57 | } 58 | 59 | /** 60 | * Define the "api" routes for the application. 61 | * 62 | * These routes are typically stateless. 63 | * 64 | * @return void 65 | */ 66 | protected function mapApiRoutes() 67 | { 68 | Route::prefix('api') 69 | ->middleware('api') 70 | ->namespace($this->namespace) 71 | ->group(base_path('routes/api.php')); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.1.3", 12 | "barryvdh/laravel-ide-helper": "^2.6", 13 | "fideloper/proxy": "^4.0", 14 | "laravel/framework": "5.8.*", 15 | "laravel/passport": "^7.2", 16 | "laravel/tinker": "^1.0", 17 | "spatie/laravel-query-builder": "^1.17" 18 | }, 19 | "require-dev": { 20 | "beyondcode/laravel-dump-server": "^1.0", 21 | "filp/whoops": "^2.0", 22 | "fzaninotto/faker": "^1.4", 23 | "mockery/mockery": "^1.0", 24 | "nunomaduro/collision": "^2.0", 25 | "phpunit/phpunit": "^7.5" 26 | }, 27 | "config": { 28 | "optimize-autoloader": true, 29 | "preferred-install": "dist", 30 | "sort-packages": true 31 | }, 32 | "extra": { 33 | "laravel": { 34 | "dont-discover": [] 35 | } 36 | }, 37 | "autoload": { 38 | "psr-4": { 39 | "App\\": "app/" 40 | }, 41 | "classmap": [ 42 | "database/seeds", 43 | "database/factories" 44 | ] 45 | }, 46 | "autoload-dev": { 47 | "psr-4": { 48 | "Tests\\": "tests/" 49 | } 50 | }, 51 | "minimum-stability": "dev", 52 | "prefer-stable": true, 53 | "scripts": { 54 | "post-autoload-dump": [ 55 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 56 | "@php artisan package:discover --ansi" 57 | ], 58 | "post-root-package-install": [ 59 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 60 | ], 61 | "post-create-project-cmd": [ 62 | "@php artisan key:generate --ansi" 63 | ] 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | 2 | window._ = require('lodash'); 3 | 4 | /** 5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 6 | * for JavaScript based Bootstrap features such as modals and tabs. This 7 | * code may be modified to fit the specific needs of your application. 8 | */ 9 | 10 | try { 11 | window.Popper = require('popper.js').default; 12 | window.$ = window.jQuery = require('jquery'); 13 | 14 | require('bootstrap'); 15 | } catch (e) {} 16 | 17 | /** 18 | * We'll load the axios HTTP library which allows us to easily issue requests 19 | * to our Laravel back-end. This library automatically handles sending the 20 | * CSRF token as a header based on the value of the "XSRF" token cookie. 21 | */ 22 | 23 | window.axios = require('axios'); 24 | 25 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 26 | 27 | /** 28 | * Next we will register the CSRF Token as a common header with Axios so that 29 | * all outgoing HTTP requests automatically have it attached. This is just 30 | * a simple convenience so we don't have to attach every token manually. 31 | */ 32 | 33 | let token = document.head.querySelector('meta[name="csrf-token"]'); 34 | 35 | if (token) { 36 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 37 | } else { 38 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 39 | } 40 | 41 | /** 42 | * Echo exposes an expressive API for subscribing to channels and listening 43 | * for events that are broadcast by Laravel. Echo and event broadcasting 44 | * allows your team to easily build robust real-time web applications. 45 | */ 46 | 47 | // import Echo from 'laravel-echo' 48 | 49 | // window.Pusher = require('pusher-js'); 50 | 51 | // window.Echo = new Echo({ 52 | // broadcaster: 'pusher', 53 | // key: process.env.MIX_PUSHER_APP_KEY, 54 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 55 | // encrypted: true 56 | // }); 57 | -------------------------------------------------------------------------------- /app/Services/Impl/ClientServiceImpl.php: -------------------------------------------------------------------------------- 1 | FilterConstants::CLIENT_EXACT, 15 | 'partial' => FilterConstants::CLIENT_PARTIAL 16 | ]; 17 | private $allowIncludes = FilterConstants::CLIENT_INCLUDES; 18 | /** 19 | * Find All 20 | * 21 | * @return Client|\Illuminate\Http\JsonResponse|mixed 22 | */ 23 | public function findAll() 24 | { 25 | $clients = ApiRequest::applyQuery($this->allowFilters,$this->allowIncludes,Client::class)->get(); 26 | return $clients; 27 | } 28 | 29 | /** 30 | * @param $id 31 | * @return mixed 32 | */ 33 | public function show($id) 34 | { 35 | Client::findOrFail($id); 36 | return ApiRequest::applyQuery([],$this->allowIncludes,Client::class) 37 | ->where('id',$id) 38 | ->first(); 39 | } 40 | 41 | /** 42 | * Save new 43 | * 44 | * @param Client $client 45 | * @return Client|\Illuminate\Http\JsonResponse|mixed 46 | */ 47 | public function save(Client $client) 48 | { 49 | $client->save(); 50 | 51 | return $client; 52 | } 53 | 54 | /** 55 | * Update by id 56 | * 57 | * @param Client $client 58 | * @return Client|\Illuminate\Http\JsonResponse|mixed 59 | */ 60 | public function update(Client $client) 61 | { 62 | $client->update(); 63 | 64 | return $client; 65 | } 66 | 67 | /** 68 | * Delete 69 | * 70 | * @param $id 71 | * @return Client|\Illuminate\Http\JsonResponse|mixed 72 | */ 73 | public function delete($id) 74 | { 75 | $client = Client::findOrFail($id); 76 | 77 | $client->delete(); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /resources/app/src/main/login/LoginComponent.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 58 | 59 | -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | 60 | $kernel->terminate($request, $response); 61 | -------------------------------------------------------------------------------- /app/Services/Impl/BrandServiceImpl.php: -------------------------------------------------------------------------------- 1 | FilterConstants::BRAND_EXACT, 14 | 'partial' => FilterConstants::BRAND_PARTIAL, 15 | ]; 16 | private $allowIncludes = FilterConstants::BRAND_INCLUDES; 17 | 18 | /** 19 | * Find All 20 | * 21 | * @return Brand|\Illuminate\Http\JsonResponse|mixed 22 | */ 23 | public function findAll() 24 | { 25 | $brands = ApiRequest::applyQuery($this->allowFilters,$this->allowIncludes,Brand::class)->orderBy('created_at')->get(); 26 | return $brands; 27 | } 28 | 29 | /** 30 | * @param $id 31 | * @return mixed 32 | */ 33 | public function show($id) 34 | { 35 | Brand::findOrFail($id); 36 | return ApiRequest::applyQuery([],$this->allowIncludes,Brand::class) 37 | ->where('id',$id) 38 | ->first(); 39 | } 40 | 41 | /** 42 | * Save new 43 | * 44 | * @param Brand $brand 45 | * @return Brand|\Illuminate\Http\JsonResponse|mixed 46 | */ 47 | public function save(Brand $brand) 48 | { 49 | $brand->save(); 50 | 51 | return $brand; 52 | } 53 | 54 | /** 55 | * Update by id 56 | * 57 | * @param Brand $brand 58 | * @return Brand|\Illuminate\Http\JsonResponse|mixed 59 | */ 60 | public function update(Brand $brand) 61 | { 62 | $brand->update(); 63 | 64 | return $brand; 65 | } 66 | 67 | /** 68 | * Delete 69 | * 70 | * @param $id 71 | * @return Brand|\Illuminate\Http\JsonResponse|mixed 72 | */ 73 | public function delete($id) 74 | { 75 | $brand = Brand::findOrFail($id); 76 | 77 | $brand->delete(); 78 | } 79 | 80 | public function getByClientId($client_id) 81 | { 82 | return ApiRequest::applyQuery($this->allowFilters, $this->allowIncludes, Brand::class)->where('client_id', $client_id)->orderBy('created_at')->get(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 41 | } 42 | 43 | /** 44 | * Get a validator for an incoming registration request. 45 | * 46 | * @param array $data 47 | * @return \Illuminate\Contracts\Validation\Validator 48 | */ 49 | protected function validator(array $data) 50 | { 51 | return Validator::make($data, [ 52 | 'name' => ['required', 'string', 'max:255'], 53 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 54 | 'password' => ['required', 'string', 'min:8', 'confirmed'], 55 | ]); 56 | } 57 | 58 | /** 59 | * Create a new user instance after a valid registration. 60 | * 61 | * @param array $data 62 | * @return \App\User 63 | */ 64 | protected function create(array $data) 65 | { 66 | return User::create([ 67 | 'name' => $data['name'], 68 | 'email' => $data['email'], 69 | 'password' => Hash::make($data['password']), 70 | ]); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /resources/app/src/main/campaigns/details/call.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /app/Http/Controllers/AuthController.php: -------------------------------------------------------------------------------- 1 | input('email'))->first(); 17 | 18 | $credentials = request(['email', 'password']); 19 | 20 | if ($user != null && \Auth::attempt($credentials)) 21 | { 22 | if ($user->active == false) { 23 | return response()->json([ 24 | 'message' => 'No access.', 25 | 'errors' => [ 'email' => [ 'User is not active.' ] ] 26 | ], 403); 27 | } 28 | $user = $request->user(); 29 | 30 | $tokenResult = $user->createToken('Client Assets Token'); 31 | 32 | return response()->json([ 33 | 34 | 'access_token' => $tokenResult->accessToken, 35 | 'token_type' => 'Bearer', 36 | 'expires_at' => Carbon::parse( 37 | $tokenResult->token->expires_at 38 | )->toDateTimeString() 39 | ] 40 | ); 41 | } 42 | 43 | return response()->json([ 44 | 'message' => 'The given data was invalid.', 45 | 'errors' => ['email' => [ 'Email or password is invalid.' ] ] 46 | ], 403); 47 | } 48 | 49 | public function logout(Request $request) 50 | { 51 | $request->user()->token()->revoke(); 52 | return response()->json([ 53 | 'message' => 'Successfully logged out' 54 | ]); 55 | } 56 | public function details() 57 | { 58 | $user = Auth::user()->load('role'); 59 | return $user; 60 | } 61 | 62 | public function clients() 63 | { 64 | $user = Auth::user(); 65 | if($user->client_id != null) 66 | return [ Client::find($user->client_id) ]; 67 | elseif($user->role_id == 1) 68 | return Client::get(); 69 | return null; 70 | } 71 | 72 | public function clientAdmin() 73 | { 74 | return ['status' => Auth::user()->role_id == 2]; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /resources/app/build/webpack.base.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const utils = require('./utils') 4 | const config = require('../config') 5 | const vueLoaderConfig = require('./vue-loader.conf') 6 | 7 | function resolve (dir) { 8 | return path.join(__dirname, '..', dir) 9 | } 10 | 11 | 12 | 13 | module.exports = { 14 | context: path.resolve(__dirname, '../'), 15 | entry: { 16 | app: './src/main.js' 17 | }, 18 | output: { 19 | path: config.build.assetsRoot, 20 | filename: '[name].js', 21 | publicPath: process.env.NODE_ENV === 'production' 22 | ? config.build.assetsPublicPath 23 | : config.dev.assetsPublicPath 24 | }, 25 | resolve: { 26 | extensions: ['.js', '.vue', '.json'], 27 | alias: { 28 | 'vue$': 'vue/dist/vue.esm.js', 29 | '@': resolve('src'), 30 | } 31 | }, 32 | module: { 33 | rules: [ 34 | { 35 | test: /\.vue$/, 36 | loader: 'vue-loader', 37 | options: vueLoaderConfig 38 | }, 39 | { 40 | test: /\.js$/, 41 | loader: 'babel-loader', 42 | include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')] 43 | }, 44 | { 45 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 46 | loader: 'url-loader', 47 | options: { 48 | limit: 10000, 49 | name: utils.assetsPath('img/[name].[hash:7].[ext]') 50 | } 51 | }, 52 | { 53 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 54 | loader: 'url-loader', 55 | options: { 56 | limit: 10000, 57 | name: utils.assetsPath('media/[name].[hash:7].[ext]') 58 | } 59 | }, 60 | { 61 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 62 | loader: 'url-loader', 63 | options: { 64 | limit: 10000, 65 | name: utils.assetsPath('fonts/[name].[hash:7].[ext]') 66 | } 67 | } 68 | ] 69 | }, 70 | node: { 71 | // prevent webpack from injecting useless setImmediate polyfill because Vue 72 | // source contains it (although only uses it if it's native). 73 | setImmediate: false, 74 | // prevent webpack from injecting mocks to Node native modules 75 | // that does not make sense for the client 76 | dgram: 'empty', 77 | fs: 'empty', 78 | net: 'empty', 79 | tls: 'empty', 80 | child_process: 'empty' 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DRIVER', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Cloud Filesystem Disk 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Many applications store files both locally and in the cloud. For this 24 | | reason, you may specify a default "cloud" driver here. This driver 25 | | will be bound as the Cloud disk implementation in the container. 26 | | 27 | */ 28 | 29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Filesystem Disks 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here you may configure as many filesystem "disks" as you wish, and you 37 | | may even configure multiple disks of the same driver. Defaults have 38 | | been setup for each driver as an example of the required options. 39 | | 40 | | Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | 'url' => env('AWS_URL'), 65 | ], 66 | 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /resources/app/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | 4 | 5 | import LoadingView from '@/components/Loading-view' 6 | 7 | import AppView from '@/main/AppView' 8 | 9 | import LoginView from '@/main/login/LoginComponent' 10 | import ClientComponent from '@/main/clients/ClientsComponent' 11 | import BrandsComponent from '@/main/brands/BrandsComponent' 12 | import CampaignsComponent from '@/main/campaigns/CampaignsComponent' 13 | import AssetRequest from '@/main/assetRequest/AssetRequest' 14 | import UsersComponent from '@/main/users/UsersComponent' 15 | 16 | Vue.use(Router) 17 | 18 | export default new Router({ 19 | routes: [ 20 | { 21 | path: '/', 22 | name: 'loading', 23 | component: LoadingView 24 | }, 25 | { 26 | path: '/app', 27 | name: 'app-view', 28 | component: AppView, 29 | children: [ 30 | { 31 | path: '/clients', 32 | name: 'clients', 33 | component: ClientComponent 34 | }, 35 | { 36 | path: '/clients/brands/:clientId', 37 | name: 'clients-brands', 38 | component: BrandsComponent 39 | }, 40 | { 41 | path: '/clients/campaigns/:clientId', 42 | name: 'clients-campaigns', 43 | component: CampaignsComponent 44 | }, 45 | { 46 | path: '/brands', 47 | name: 'brands', 48 | component: BrandsComponent 49 | }, 50 | { 51 | path: '/brands/campaigns/:brandId', 52 | name: 'brands-campaigns', 53 | component: CampaignsComponent 54 | }, 55 | { 56 | path: '/clients/brands/:clientId', 57 | name: 'clients-brands', 58 | component: BrandsComponent 59 | }, 60 | { 61 | path: '/assetRequest', 62 | name: 'asset-request', 63 | component: AssetRequest 64 | }, 65 | { 66 | path: '/users', 67 | name: 'users', 68 | component: UsersComponent 69 | }, 70 | { 71 | path: '/campaigns', 72 | name: 'campaigns', 73 | component: CampaignsComponent 74 | } 75 | ] 76 | }, 77 | { 78 | path: '/login', 79 | name: 'login', 80 | component: LoginView 81 | }, 82 | { 83 | path: '*', 84 | redirect: '/', 85 | 86 | }, 87 | ] 88 | }) 89 | -------------------------------------------------------------------------------- /resources/app/src/main/campaigns/CampaignDetails.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 91 | -------------------------------------------------------------------------------- /resources/app/src/main/campaigns/details/sms.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | 71 | -------------------------------------------------------------------------------- /app/Services/Impl/CampaignServiceImpl.php: -------------------------------------------------------------------------------- 1 | FilterConstants::CAMPAIGN_EXACT, 15 | 'partial' => FilterConstants::CAMPAIGN_PARTIAL, 16 | ]; 17 | private $allowIncludes = FilterConstants::CAMPAIGN_INCLUDES; 18 | /** 19 | * Find All 20 | * 21 | * @return Campaign|\Illuminate\Http\JsonResponse|mixed 22 | */ 23 | public function findAll() 24 | { 25 | $campaings = ApiRequest::applyQuery($this->allowFilters,$this->allowIncludes,Campaign::class)->orderBy('created_at')->get(); 26 | return $campaings; 27 | } 28 | 29 | /** 30 | * @param $id 31 | * @return mixed 32 | */ 33 | public function show($id) 34 | { 35 | Campaign::findOrFail($id); 36 | return ApiRequest::applyQuery([],$this->allowIncludes,Campaign::class) 37 | ->where('id',$id) 38 | ->first(); 39 | } 40 | 41 | /** 42 | * Save new 43 | * 44 | * @param Campaign $campaign 45 | * @return Campaign|\Illuminate\Http\JsonResponse|mixed 46 | */ 47 | public function save(Campaign $campaign) 48 | { 49 | $campaign->save(); 50 | 51 | return $campaign; 52 | } 53 | 54 | /** 55 | * Update by id 56 | * 57 | * @param Campaign $campaign 58 | * @return Campaign|\Illuminate\Http\JsonResponse|mixed 59 | */ 60 | public function update(Campaign $campaign) 61 | { 62 | $campaign->update(); 63 | 64 | return $campaign; 65 | } 66 | 67 | /** 68 | * Delete 69 | * 70 | * @param $id 71 | * @return Campaign|\Illuminate\Http\JsonResponse|mixed 72 | */ 73 | public function delete($id) 74 | { 75 | $campaign = Campaign::findOrFail($id); 76 | if(!$campaign->campaign_verified) 77 | $campaign->delete(); 78 | else 79 | return response(['errors' => [ 'general' => ['You cannot delete verified campaigns']]], 422); 80 | } 81 | 82 | public function getByClientId($client_id) 83 | { 84 | return ApiRequest::applyQuery($this->allowFilters, $this->allowIncludes, Campaign::class)->where('client_id', $client_id)->orderBy('created_at')->get(); 85 | } 86 | 87 | public function getByBrandId($brand_id) 88 | { 89 | return ApiRequest::applyQuery($this->allowFilters, $this->allowIncludes, Campaign::class)->where('brand_id', $brand_id)->orderBy('created_at')->get(); 90 | } 91 | } -------------------------------------------------------------------------------- /resources/app/config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.3.1 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: { 14 | '/api': { 15 | target: 'http://127.0.0.1:8000/api', 16 | secure: false, 17 | changeOrigin: true, 18 | pathRewrite: { 19 | '^/api': '' 20 | } 21 | }, 22 | '/': { 23 | target: 'http://127.0.0.1:8000', 24 | secure: false, 25 | changeOrigin: true, 26 | pathRewrite: { 27 | '^/': '' 28 | } 29 | } 30 | }, 31 | 32 | // Various Dev Server settings 33 | host: 'localhost', // can be overwritten by process.env.HOST 34 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 35 | autoOpenBrowser: false, 36 | errorOverlay: true, 37 | notifyOnErrors: true, 38 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 39 | 40 | 41 | /** 42 | * Source Maps 43 | */ 44 | 45 | // https://webpack.js.org/configuration/devtool/#development 46 | devtool: 'cheap-module-eval-source-map', 47 | 48 | // If you have problems debugging vue-files in devtools, 49 | // set this to false - it *may* help 50 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 51 | cacheBusting: true, 52 | 53 | cssSourceMap: true 54 | }, 55 | 56 | build: { 57 | // Template for index.html 58 | index: path.resolve(__dirname, '../../../resources/views/index.blade.php'), 59 | 60 | // Paths 61 | assetsRoot: path.resolve(__dirname, '../../../public'), 62 | assetsSubDirectory: 'static', 63 | assetsPublicPath: '/', 64 | 65 | /** 66 | * Source Maps 67 | */ 68 | 69 | productionSourceMap: true, 70 | // https://webpack.js.org/configuration/devtool/#production 71 | devtool: '#source-map', 72 | 73 | // Gzip off by default as many popular static hosts such as 74 | // Surge or Netlify already gzip all static assets for you. 75 | // Before setting to `true`, make sure to: 76 | // npm install --save-dev compression-webpack-plugin 77 | productionGzip: false, 78 | productionGzipExtensions: ['js', 'css'], 79 | 80 | // Run the build command with an extra argument to 81 | // View the bundle analyzer report after build finishes: 82 | // `npm run build --report` 83 | // Set to `true` or `false` to always turn it on or off 84 | bundleAnalyzerReport: process.env.npm_config_report 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /app/Services/Impl/UserServiceImpl.php: -------------------------------------------------------------------------------- 1 | FilterConstants::USER_PARTIAL, 16 | 'exact' =>FilterConstants::USER_EXACT, 17 | ]; 18 | private $allowIncludes = FilterConstants::USER_INCLUDES; 19 | /** 20 | * Find All 21 | * 22 | * @return User|\Illuminate\Http\JsonResponse|mixed 23 | */ 24 | public function findAll() 25 | { 26 | return ApiRequest::applyQuery($this->allowFilters,$this->allowIncludes,User::class)->get(); 27 | } 28 | 29 | /** 30 | * @param $id 31 | * @return mixed 32 | */ 33 | public function show($id) 34 | { 35 | $user = User::findOrFail($id); 36 | return ApiRequest::applyQuery([],$this->allowIncludes,User::class) 37 | ->where('id',$id) 38 | ->first(); 39 | } 40 | 41 | /** 42 | * Save new 43 | * 44 | * @param User $user 45 | * @param array $brands 46 | * @return User|\Illuminate\Http\JsonResponse|mixed 47 | */ 48 | public function save(User $user, $brands = []) 49 | { 50 | if($user->role_id == 2) 51 | { 52 | $brands = Brand::where('client_id', $user->client_id)->pluck('id'); 53 | } 54 | elseif($brands != []) 55 | { 56 | $brands = Brand::where('client_id', $user->client_id)->whereIn('id', $brands)->pluck('id'); 57 | } 58 | $user->save(); 59 | 60 | $user->brands()->attach($brands); 61 | return $user; 62 | } 63 | 64 | /** 65 | * Update by id 66 | * 67 | * @param User $user 68 | * @return User|\Illuminate\Http\JsonResponse|mixed 69 | */ 70 | public function update(User $user) 71 | { 72 | $user->update(); 73 | 74 | return $user; 75 | } 76 | 77 | /** 78 | * Delete 79 | * 80 | * @param $id 81 | * @return User|\Illuminate\Http\JsonResponse|mixed 82 | */ 83 | public function delete($id) 84 | { 85 | $user = User::findOrFail($id); 86 | if(\Auth::user()->id == $id) 87 | return response(['errors' => ['general'=> ['You cannot delete your account!']]], 403); 88 | $user->delete(); 89 | } 90 | 91 | public function addUserBrand($userId, $brandId, $flag) 92 | { 93 | $user = User::findOrFail($userId); 94 | $brand = Brand::where('client_id', $user->client_id)->where('id', $brandId)->pluck('id'); 95 | if ($flag == "add") { 96 | $user->brands()->attach($brand); 97 | } else { 98 | $user->brands()->detach($brand); 99 | } 100 | } 101 | } -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | ], 43 | 44 | 'beanstalkd' => [ 45 | 'driver' => 'beanstalkd', 46 | 'host' => 'localhost', 47 | 'queue' => 'default', 48 | 'retry_after' => 90, 49 | 'block_for' => 0, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => env('AWS_ACCESS_KEY_ID'), 55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'), 58 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 59 | ], 60 | 61 | 'redis' => [ 62 | 'driver' => 'redis', 63 | 'connection' => 'default', 64 | 'queue' => env('REDIS_QUEUE', 'default'), 65 | 'retry_after' => 90, 66 | 'block_for' => null, 67 | ], 68 | 69 | ], 70 | 71 | /* 72 | |-------------------------------------------------------------------------- 73 | | Failed Queue Jobs 74 | |-------------------------------------------------------------------------- 75 | | 76 | | These options configure the behavior of failed queue job logging so you 77 | | can control which database and table are used to store the jobs that 78 | | have failed. You may change them to any database / table you wish. 79 | | 80 | */ 81 | 82 | 'failed' => [ 83 | 'database' => env('DB_CONNECTION', 'mysql'), 84 | 'table' => 'failed_jobs', 85 | ], 86 | 87 | ]; 88 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Log Channels 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may configure the log channels for your application. Out of 27 | | the box, Laravel uses the Monolog PHP logging library. This gives 28 | | you a variety of powerful log handlers / formatters to utilize. 29 | | 30 | | Available Drivers: "single", "daily", "slack", "syslog", 31 | | "errorlog", "monolog", 32 | | "custom", "stack" 33 | | 34 | */ 35 | 36 | 'channels' => [ 37 | 'stack' => [ 38 | 'driver' => 'stack', 39 | 'channels' => ['daily'], 40 | 'ignore_exceptions' => false, 41 | ], 42 | 43 | 'single' => [ 44 | 'driver' => 'single', 45 | 'path' => storage_path('logs/laravel.log'), 46 | 'level' => 'debug', 47 | ], 48 | 49 | 'daily' => [ 50 | 'driver' => 'daily', 51 | 'path' => storage_path('logs/laravel.log'), 52 | 'level' => 'debug', 53 | 'days' => 14, 54 | ], 55 | 56 | 'slack' => [ 57 | 'driver' => 'slack', 58 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 59 | 'username' => 'Laravel Log', 60 | 'emoji' => ':boom:', 61 | 'level' => 'critical', 62 | ], 63 | 64 | 'papertrail' => [ 65 | 'driver' => 'monolog', 66 | 'level' => 'debug', 67 | 'handler' => SyslogUdpHandler::class, 68 | 'handler_with' => [ 69 | 'host' => env('PAPERTRAIL_URL'), 70 | 'port' => env('PAPERTRAIL_PORT'), 71 | ], 72 | ], 73 | 74 | 'stderr' => [ 75 | 'driver' => 'monolog', 76 | 'handler' => StreamHandler::class, 77 | 'formatter' => env('LOG_STDERR_FORMATTER'), 78 | 'with' => [ 79 | 'stream' => 'php://stderr', 80 | ], 81 | ], 82 | 83 | 'syslog' => [ 84 | 'driver' => 'syslog', 85 | 'level' => 'debug', 86 | ], 87 | 88 | 'errorlog' => [ 89 | 'driver' => 'errorlog', 90 | 'level' => 'debug', 91 | ], 92 | ], 93 | 94 | ]; 95 | -------------------------------------------------------------------------------- /resources/app/build/utils.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const path = require('path') 3 | const config = require('../config') 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin') 5 | const packageConfig = require('../package.json') 6 | 7 | exports.assetsPath = function (_path) { 8 | const assetsSubDirectory = process.env.NODE_ENV === 'production' 9 | ? config.build.assetsSubDirectory 10 | : config.dev.assetsSubDirectory 11 | 12 | return path.posix.join(assetsSubDirectory, _path) 13 | } 14 | 15 | exports.cssLoaders = function (options) { 16 | options = options || {} 17 | 18 | const cssLoader = { 19 | loader: 'css-loader', 20 | options: { 21 | sourceMap: options.sourceMap 22 | } 23 | } 24 | 25 | const postcssLoader = { 26 | loader: 'postcss-loader', 27 | options: { 28 | sourceMap: options.sourceMap 29 | } 30 | } 31 | 32 | // generate loader string to be used with extract text plugin 33 | function generateLoaders (loader, loaderOptions) { 34 | const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader] 35 | 36 | if (loader) { 37 | loaders.push({ 38 | loader: loader + '-loader', 39 | options: Object.assign({}, loaderOptions, { 40 | sourceMap: options.sourceMap 41 | }) 42 | }) 43 | } 44 | 45 | // Extract CSS when that option is specified 46 | // (which is the case during production build) 47 | if (options.extract) { 48 | return ExtractTextPlugin.extract({ 49 | use: loaders, 50 | fallback: 'vue-style-loader' 51 | }) 52 | } else { 53 | return ['vue-style-loader'].concat(loaders) 54 | } 55 | } 56 | 57 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html 58 | return { 59 | css: generateLoaders(), 60 | postcss: generateLoaders(), 61 | less: generateLoaders('less'), 62 | sass: generateLoaders('sass', { indentedSyntax: true }), 63 | scss: generateLoaders('sass'), 64 | stylus: generateLoaders('stylus'), 65 | styl: generateLoaders('stylus') 66 | } 67 | } 68 | 69 | // Generate loaders for standalone style files (outside of .vue) 70 | exports.styleLoaders = function (options) { 71 | const output = [] 72 | const loaders = exports.cssLoaders(options) 73 | 74 | for (const extension in loaders) { 75 | const loader = loaders[extension] 76 | output.push({ 77 | test: new RegExp('\\.' + extension + '$'), 78 | use: loader 79 | }) 80 | } 81 | 82 | return output 83 | } 84 | 85 | exports.createNotifierCallback = () => { 86 | const notifier = require('node-notifier') 87 | 88 | return (severity, errors) => { 89 | if (severity !== 'error') return 90 | 91 | const error = errors[0] 92 | const filename = error.file && error.file.split('!').pop() 93 | 94 | notifier.notify({ 95 | title: packageConfig.name, 96 | message: severity + ': ' + error.name, 97 | subtitle: filename || '', 98 | icon: path.join(__dirname, 'logo.png') 99 | }) 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /resources/app/src/assets/scss/components/modal.scss: -------------------------------------------------------------------------------- 1 | .modal-mask { 2 | position: fixed; 3 | z-index: 10; 4 | top: 0; 5 | left: 0; 6 | width: 100%; 7 | height: 100%; 8 | background-color: rgba(0, 0, 0, .5); 9 | display: table; 10 | transition: opacity .3s ease; 11 | 12 | .modal-wrapper { 13 | display: table-cell; 14 | vertical-align: middle; 15 | } 16 | 17 | .modal-container { 18 | width: 600px; 19 | margin: 0 auto; 20 | background-color: white; 21 | border-radius: 4px; 22 | box-shadow: 0 2px 8px rgba(0, 0, 0, .33); 23 | transition: all .2s ease; 24 | 25 | .modal-header-customize { 26 | padding: 16px; 27 | border-bottom: 1px solid $borderMenu; 28 | font-size: 17px; 29 | 30 | .modal-title { 31 | font-weight: bold; 32 | } 33 | .modal-close { 34 | float: right; 35 | cursor: pointer; 36 | } 37 | } 38 | 39 | .modal-header-stepper { 40 | width: 100%; 41 | float: left; 42 | border-bottom: 1px solid $borderMenu; 43 | text-align: center; 44 | height: 120px; 45 | padding: 30px calc(50% - 240px); 46 | position: relative; 47 | 48 | .step { 49 | float: left; 50 | width: 60px; 51 | cursor: pointer; 52 | text-decoration: none; 53 | 54 | .icon { 55 | font-size: 24px; 56 | text-align: center; 57 | color: $greenAlphaColor; 58 | } 59 | .details { 60 | font-size: 16px; 61 | color: $alphabetContent; 62 | 63 | font-weight: 600; 64 | } 65 | } 66 | 67 | .step_active { 68 | .icon { 69 | color: $greenColor !important; 70 | } 71 | .details { 72 | font-size: 17px !important; 73 | color: $alphabetContent; 74 | } 75 | } 76 | 77 | .line { 78 | margin-top: 25px; 79 | float: left; 80 | height: 1px; 81 | width: 80px; 82 | 83 | } 84 | 85 | .close_modal { 86 | position: absolute; 87 | top: 8px; 88 | right: 8px; 89 | cursor: pointer; 90 | } 91 | } 92 | 93 | .modal-body-customize { 94 | padding: 20px 10px 20px 13px; 95 | border-bottom: 1px solid $borderMenu; 96 | min-height: 250px; 97 | max-height: 500px; 98 | overflow-x: auto; 99 | } 100 | 101 | .modal-body-stepper { 102 | height: 420px !important; 103 | } 104 | 105 | .modal-footer-customize { 106 | padding: 12px 16px; 107 | text-align: right; 108 | 109 | .btn-left { 110 | float: left !important; 111 | } 112 | } 113 | } 114 | 115 | .modal-container_lg { 116 | width: 800px; 117 | margin: 0 auto; 118 | background-color: #fff; 119 | border-radius: 4px; 120 | box-shadow: 0 2px 8px rgba(0, 0, 0, .33); 121 | transition: all .2s ease; 122 | } 123 | } 124 | 125 | .container_100{ 126 | width: 100% !important; 127 | margin: 0!important; 128 | padding: 0 !important; 129 | float: left; 130 | } 131 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 32 | \App\Http\Middleware\EncryptCookies::class, 33 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 34 | \Illuminate\Session\Middleware\StartSession::class, 35 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | // \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | ], 40 | 41 | 'api' => [ 42 | 'throttle:60,1', 43 | 'bindings', 44 | ], 45 | ]; 46 | 47 | /** 48 | * The application's route middleware. 49 | * 50 | * These middleware may be assigned to groups or used individually. 51 | * 52 | * @var array 53 | */ 54 | protected $routeMiddleware = [ 55 | 'auth' => \App\Http\Middleware\Authenticate::class, 56 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 57 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 58 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 59 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 60 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 61 | 'role' => CheckRole::class, 62 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 63 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 64 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 65 | ]; 66 | 67 | /** 68 | * The priority-sorted list of middleware. 69 | * 70 | * This forces non-global middleware to always be in the given order. 71 | * 72 | * @var array 73 | */ 74 | protected $middlewarePriority = [ 75 | \Illuminate\Session\Middleware\StartSession::class, 76 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 77 | \App\Http\Middleware\Authenticate::class, 78 | \Illuminate\Session\Middleware\AuthenticateSession::class, 79 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 80 | \Illuminate\Auth\Middleware\Authorize::class, 81 | ]; 82 | } 83 | -------------------------------------------------------------------------------- /app/Http/Controllers/CampaignController.php: -------------------------------------------------------------------------------- 1 | service = $campaignService; 20 | } 21 | 22 | public function index() 23 | { 24 | return $this->service->findAll(); 25 | } 26 | 27 | public function show($id) 28 | { 29 | return $this->service->show($id); 30 | } 31 | 32 | public function store(CampaignSaveRequest $request) 33 | { 34 | $campaign = new Campaign(); 35 | 36 | $campaign->title = $request->json("title"); 37 | $campaign->description = $request->json("description"); 38 | $campaign->sms_script = $request->json("sms_script"); 39 | $campaign->call_script = $request->json("call_script"); 40 | $campaign->email_subject = $request->json("email_subject"); 41 | $campaign->email_html = $request->json("email_html"); 42 | 43 | $campaign->brand_id = $request->json("brand_id"); 44 | 45 | return $this->service->save($campaign); 46 | } 47 | 48 | public function update(CampaignUpdateRequest $request, $id) 49 | { 50 | $campaign = Campaign::findOrFail($id); 51 | 52 | $campaign->title = $request->json("title"); 53 | $campaign->description = $request->json("description"); 54 | if(!$campaign->sms_verified) { 55 | $campaign->sms_script = $request->json("sms_script"); 56 | $campaign->sms_verified = $request->json("sms_verified"); 57 | } 58 | if(!$campaign->call_verified) { 59 | $campaign->call_script = $request->json("call_script"); 60 | $campaign->call_verified = $request->json("call_verified"); 61 | } 62 | if(!$campaign->email_verified) { 63 | $campaign->email_subject = $request->json("email_subject"); 64 | $campaign->email_html = $request->json("email_html"); 65 | $campaign->email_verified = $request->json("email_verified"); 66 | } 67 | 68 | if(!$campaign->campaign_verified & $campaign->sms_verified & $campaign->call_verified & $campaign->email_verified) { 69 | $campaign->campaign_verified = true; 70 | event(new CampaignVerifiedEvent($campaign)); 71 | } 72 | $campaign->brand_id = $request->json("brand_id"); 73 | $campaign->client_id = $request->json("client_id"); 74 | 75 | return $this->service->update($campaign); 76 | } 77 | 78 | public function destroy($id) 79 | { 80 | return $this->service->delete($id); 81 | } 82 | 83 | public function getByClientId($client_id) 84 | { 85 | return $this->service->getByClientId($client_id); 86 | } 87 | 88 | public function getByBrandId($brand_id) 89 | { 90 | return $this->service->getByBrandId($brand_id); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /database/seeds/ClientsTableSeeder.php: -------------------------------------------------------------------------------- 1 | name = 'Client 1'; 17 | $client->iwinback_api_key = 'iWINBACK API KEY'; 18 | $client->iwinback_api_secret = 'iWINBACK API SECRET'; 19 | $client->save(); 20 | 21 | $brand = new \App\Brand(); 22 | $brand->name = 'Brand 1'; 23 | $brand->client_id = $client->id; 24 | $brand->save(); 25 | 26 | $campaign = new \App\Campaign(); 27 | $campaign->title = 'Campaign Title'; 28 | $campaign->description = 'Campaign Description'; 29 | $campaign->sms_script = 'Sms Script'; 30 | $campaign->email_html = 'Email Html'; 31 | $campaign->email_subject = 'Email Subject'; 32 | $campaign->call_script = 'Call Script'; 33 | $campaign->brand_id = $brand->id; 34 | $campaign->client_id = $brand->client_id; 35 | $campaign->save(); 36 | 37 | $user = new \App\User(); 38 | $user->first_name = "Admin"; 39 | $user->last_name = "Admini"; 40 | $user->username = "Admin"; 41 | $user->email = "admin@admin.com"; 42 | $user->password = bcrypt("admin"); 43 | $user->active = true; 44 | $role = Role::where('name', 'super admin')->first(); 45 | $user->role_id = $role->id; 46 | $user->save(); 47 | 48 | $clientAdmin = new \App\User(); 49 | $clientAdmin->first_name = "Client Admin"; 50 | $clientAdmin->last_name = "Admini"; 51 | $clientAdmin->username = "clientAdmin"; 52 | $clientAdmin->email = "client@admin.com"; 53 | $clientAdmin->password = bcrypt("client"); 54 | $clientAdmin->active = true; 55 | $clientAdmin->client_id = $client->id; 56 | $role2 = Role::where('name', 'client admin')->first(); 57 | $clientAdmin->role_id = $role2->id; 58 | $clientAdmin->save(); 59 | 60 | $clientUser = new \App\User(); 61 | $clientUser->first_name = "Client User"; 62 | $clientUser->last_name = "User"; 63 | $clientUser->username = "clientUser"; 64 | $clientUser->email = "client@user.com"; 65 | $clientUser->password = bcrypt("client"); 66 | $clientUser->active = true; 67 | $clientUser->client_id = $client->id; 68 | $role3 = Role::where('name', 'client user')->first(); 69 | $clientUser->role_id = $role3->id; 70 | $clientUser->save(); 71 | 72 | $clientViewer = new \App\User(); 73 | $clientViewer->first_name = "Client Viewer"; 74 | $clientViewer->last_name = "Viewer"; 75 | $clientViewer->username = "clientViewer"; 76 | $clientViewer->email = "client@viewer.com"; 77 | $clientViewer->password = bcrypt("client"); 78 | $clientViewer->active = true; 79 | $clientViewer->client_id = $client->id; 80 | $role4 = Role::where('name', 'client viewer')->first(); 81 | $clientViewer->role_id = $role4->id; 82 | $clientViewer->save(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | ['auth:api', 'role:super admin']], function() { 18 | Route::get('/clients', 'ClientController@index'); 19 | Route::get('/clients/{id}', 'ClientController@show'); 20 | Route::post('/clients', 'ClientController@store'); 21 | Route::put('/clients/{id}', 'ClientController@update'); 22 | Route::delete('/clients/{id}', 'ClientController@destroy'); 23 | }); 24 | 25 | Route::group(['middleware' => ['auth:api', 'role:client admin']], function() { 26 | Route::get('/users', 'UserController@index'); 27 | Route::get('/users/{id}', 'UserController@show'); 28 | Route::post('/users', 'UserController@store'); 29 | Route::put('/users/{id}', 'UserController@update'); 30 | Route::delete('/users/{id}', 'UserController@destroy'); 31 | 32 | Route::get('users/brands/{user_id}', 'UserController@getUserBrands'); 33 | Route::get('users/brands/not/{user_id}', 'UserController@getNotUserBrands'); 34 | Route::post('/users/brands/{userId}/{brandId}/{flag}', 'UserController@addUserBrand'); 35 | 36 | Route::get('/requests', 'VerifiedRequestController@index'); 37 | Route::get('/requests/{id}', 'VerifiedRequestController@show'); 38 | Route::delete('/requests/{id}', 'VerifiedRequestController@destroy'); 39 | 40 | Route::delete('/campaigns/{id}', 'CampaignController@destroy'); 41 | 42 | Route::post('request/approve', 'VerifiedRequestController@directApprove'); 43 | Route::get('/requests/approve/{id}', 'VerifiedRequestController@approve'); 44 | }); 45 | 46 | Route::group(['middleware' => ['auth:api', 'role:client user']], function() { 47 | 48 | Route::post('/brands', 'BrandController@store'); 49 | Route::put('/brands/{id}', 'BrandController@update'); 50 | Route::delete('/brands/{id}', 'BrandController@destroy'); 51 | 52 | Route::post('/campaigns', 'CampaignController@store'); 53 | Route::put('/campaigns/{id}', 'CampaignController@update'); 54 | 55 | }); 56 | 57 | Route::group(['middleware' => 'auth:api'], function() { 58 | Route::get('/brands/clients/{client_id}', 'BrandController@getByClientId'); 59 | Route::get('/campaigns/brands/{brand_id}', 'CampaignController@getByBrandId'); 60 | Route::get('/campaigns/clients/{clientId}', 'CampaignController@getByClientId'); 61 | 62 | Route::get('/auth/details', 'AuthController@details'); 63 | Route::get('/auth/clients', 'AuthController@clients'); 64 | Route::get('/auth/clientadmin', 'AuthController@clientAdmin'); 65 | Route::get('/auth/logout', 'AuthController@logout'); 66 | 67 | Route::post('/requests', 'VerifiedRequestController@store'); 68 | 69 | Route::get('/brands', 'BrandController@index'); 70 | Route::get('/brands/{id}', 'BrandController@show'); 71 | 72 | Route::get('/campaigns', 'CampaignController@index'); 73 | Route::get('/campaigns/{id}', 'CampaignController@show'); 74 | }); 75 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel 8 | 9 | 10 | 11 | 12 | 13 | 65 | 66 | 67 |
68 | @if (Route::has('login')) 69 | 80 | @endif 81 | 82 |
83 |
84 | Laravel 85 |
86 | 87 | 96 |
97 |
98 | 99 | 100 | -------------------------------------------------------------------------------- /resources/app/build/webpack.dev.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const webpack = require('webpack') 4 | const config = require('../config') 5 | const merge = require('webpack-merge') 6 | const path = require('path') 7 | const baseWebpackConfig = require('./webpack.base.conf') 8 | const CopyWebpackPlugin = require('copy-webpack-plugin') 9 | const HtmlWebpackPlugin = require('html-webpack-plugin') 10 | const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') 11 | const portfinder = require('portfinder') 12 | 13 | const HOST = process.env.HOST 14 | const PORT = process.env.PORT && Number(process.env.PORT) 15 | 16 | const devWebpackConfig = merge(baseWebpackConfig, { 17 | module: { 18 | rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true }) 19 | }, 20 | // cheap-module-eval-source-map is faster for development 21 | devtool: config.dev.devtool, 22 | 23 | // these devServer options should be customized in /config/index.js 24 | devServer: { 25 | clientLogLevel: 'warning', 26 | historyApiFallback: { 27 | rewrites: [ 28 | { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') }, 29 | ], 30 | }, 31 | hot: true, 32 | contentBase: false, // since we use CopyWebpackPlugin. 33 | compress: true, 34 | host: HOST || config.dev.host, 35 | port: PORT || config.dev.port, 36 | open: config.dev.autoOpenBrowser, 37 | overlay: config.dev.errorOverlay 38 | ? { warnings: false, errors: true } 39 | : false, 40 | publicPath: config.dev.assetsPublicPath, 41 | proxy: config.dev.proxyTable, 42 | quiet: true, // necessary for FriendlyErrorsPlugin 43 | watchOptions: { 44 | poll: config.dev.poll, 45 | } 46 | }, 47 | plugins: [ 48 | new webpack.DefinePlugin({ 49 | 'process.env': require('../config/dev.env') 50 | }), 51 | new webpack.HotModuleReplacementPlugin(), 52 | new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update. 53 | new webpack.NoEmitOnErrorsPlugin(), 54 | // https://github.com/ampedandwired/html-webpack-plugin 55 | new HtmlWebpackPlugin({ 56 | filename: 'index.html', 57 | template: 'index.html', 58 | inject: true 59 | }), 60 | // copy custom static assets 61 | new CopyWebpackPlugin([ 62 | { 63 | from: path.resolve(__dirname, '../static'), 64 | to: config.dev.assetsSubDirectory, 65 | ignore: ['.*'] 66 | } 67 | ]) 68 | ] 69 | }) 70 | 71 | module.exports = new Promise((resolve, reject) => { 72 | portfinder.basePort = process.env.PORT || config.dev.port 73 | portfinder.getPort((err, port) => { 74 | if (err) { 75 | reject(err) 76 | } else { 77 | // publish the new Port, necessary for e2e tests 78 | process.env.PORT = port 79 | // add port to devServer config 80 | devWebpackConfig.devServer.port = port 81 | 82 | // Add FriendlyErrorsPlugin 83 | devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({ 84 | compilationSuccessInfo: { 85 | messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`], 86 | }, 87 | onErrors: config.dev.notifyOnErrors 88 | ? utils.createNotifierCallback() 89 | : undefined 90 | })) 91 | 92 | resolve(devWebpackConfig) 93 | } 94 | }) 95 | }) 96 | -------------------------------------------------------------------------------- /resources/app/src/main/campaigns/details/detailsData.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 102 | -------------------------------------------------------------------------------- /resources/app/src/assets/scss/components/leftMenu.scss: -------------------------------------------------------------------------------- 1 | .menu_item { 2 | color: $alphabet; 3 | padding-left: 20px; 4 | transition: 300ms; 5 | } 6 | 7 | .menu { 8 | float: left; 9 | height: 100%; 10 | margin: 0; 11 | border-right: 1px solid $borderMenu; 12 | background: $clouds; 13 | padding: 10px 0 0 0 !important; 14 | width: 20% !important; 15 | position: relative; 16 | 17 | .logo { 18 | width: 80%; 19 | padding-left: 25px; 20 | display: flex; 21 | align-items: center; 22 | padding-bottom: 10px; 23 | position: relative; 24 | cursor: default; 25 | position: relative; 26 | 27 | .first__letters{ 28 | padding: 10px; 29 | width: 45px; 30 | height: 45px; 31 | background: #2548a6; 32 | border-radius: 3px; 33 | color: #fff; 34 | font-size: 18px; 35 | display: flex; 36 | justify-content: center; 37 | align-items: center; 38 | p{ 39 | margin: 0; 40 | } 41 | } 42 | 43 | .user__name{ 44 | position: absolute; 45 | margin: 0px; 46 | left: 80px; 47 | float: left; 48 | width: 100%; 49 | } 50 | 51 | .user__client-name { 52 | position: absolute; 53 | left: 80px; 54 | top:30px; 55 | width: 100%; 56 | font-size: 12px; 57 | 58 | } 59 | } 60 | 61 | .user__actions{ 62 | float: right; 63 | position: absolute; 64 | top: 15px; 65 | right: 15px; 66 | font-size: 20px; 67 | a{ 68 | color: $actions-color; 69 | cursor: pointer; 70 | font-size: 20px !important; 71 | &:hover{ 72 | color: #2548a6; 73 | } 74 | } 75 | } 76 | 77 | .list { 78 | width: 100%; 79 | background: inherit; 80 | padding-top: 50px; 81 | padding-bottom: 4px; 82 | float: left; 83 | margin-top: 15px; 84 | 85 | .list__tile--link { 86 | width: 100%; 87 | float: left; 88 | cursor: pointer; 89 | color: $alphabetMenu; 90 | border-radius: 3px; 91 | padding: 10px 30px; 92 | text-decoration: none; 93 | position: relative; 94 | 95 | .active__span { 96 | width: 5px; 97 | height: 100%; 98 | position: absolute; 99 | left: 0; 100 | top: 0; 101 | } 102 | 103 | .list__tile__icon { 104 | float: left; 105 | display: flex; 106 | justify-content: flex-start; 107 | min-width: 47px; 108 | font-size: 20px; 109 | 110 | 111 | i { 112 | color: $alphabetMenu; 113 | } 114 | } 115 | 116 | .active__icon { 117 | color: $activeItemMenuColor !important; 118 | } 119 | 120 | .list__tile__title { 121 | font-size: 15px; 122 | float: left; 123 | font-weight: 500; 124 | } 125 | 126 | &:hover { 127 | background: $activeItemMenuHover; 128 | color: $alphabetMenu; 129 | } 130 | } 131 | 132 | .list__tile--link-active { 133 | 134 | .active__span { 135 | background: $activeItemMenuColor; 136 | } 137 | 138 | color: $activeItemMenuColor; 139 | 140 | i { 141 | color: $activeItemMenuColor !important; 142 | } 143 | } 144 | } 145 | } 146 | 147 | .width_zero { 148 | width: 0px; 149 | display: none; 150 | } 151 | 152 | .active_list { 153 | background: rgba(0,0,0,0.12) !important; 154 | } 155 | -------------------------------------------------------------------------------- /app/Http/Controllers/VerifiedRequestController.php: -------------------------------------------------------------------------------- 1 | get(); 15 | } 16 | 17 | public function show($id) 18 | { 19 | return VerifiedRequest::with(['user','campaign'])->findOrFail($id); 20 | } 21 | 22 | public function store(VerifiedRequestSaveRequest $request) 23 | { 24 | $verifiedRequest = new VerifiedRequest(); 25 | 26 | $verifiedRequest->user_id = \Auth::user()->id; 27 | $verifiedRequest->campaign_id = $request->json('campaign_id'); 28 | $verifiedRequest->entity = $request->json('entity'); 29 | 30 | $requestExists = VerifiedRequest::where('entity', $verifiedRequest->entity)->where('campaign_id', $verifiedRequest->campaign_id)->first(); 31 | if($requestExists) 32 | return response(['errors' => ['message' =>'Request for this campaign and asset exists already']],422); 33 | 34 | $verifiedRequest->save(); 35 | 36 | return response(['message'=> 'Successfully'], 200); 37 | } 38 | 39 | public function directApprove(Request $request) 40 | { 41 | $entity = $request->json('entity'); 42 | $campaign = Campaign::findOrFail($request->json('campaign_id')); 43 | 44 | if($entity == 'SMS') 45 | $campaign->sms_verified = false; 46 | 47 | if($entity== 'CALL') 48 | $campaign->call_verified = false; 49 | 50 | if($entity == 'EMAIL') 51 | $campaign->email_verified = false; 52 | 53 | if($entity == 'CAMPAIGN') 54 | { 55 | $campaign->sms_verified = false; 56 | $campaign->call_verified = false; 57 | $campaign->email_verified = false; 58 | } 59 | $campaign->campaign_verified = false; 60 | $campaign->update(); 61 | } 62 | public function approve($id) 63 | { 64 | $flag = true; 65 | $verifiedRequest = VerifiedRequest::findOrFail($id); 66 | 67 | $campaign = Campaign::findOrFail($verifiedRequest->campaign_id); 68 | if($verifiedRequest->entity == 'SMS') 69 | $campaign->sms_verified = false; 70 | 71 | if($verifiedRequest->entity == 'CALL') 72 | $campaign->call_verified = false; 73 | 74 | if($verifiedRequest->entity == 'EMAIL') 75 | $campaign->email_verified = false; 76 | 77 | if($verifiedRequest->entity == 'CAMPAIGN') 78 | { 79 | $campaign->sms_verified = false; 80 | $campaign->call_verified = false; 81 | $campaign->email_verified = false; 82 | $flag = true; 83 | } 84 | $campaign->campaign_verified = false; 85 | $campaign->update(); 86 | 87 | if($flag) 88 | VerifiedRequest::where('campaign_id', $verifiedRequest->campaign_id)->delete(); 89 | else 90 | $this->destroy($id); 91 | return response(['message' => 'Successfully'], 200); 92 | } 93 | 94 | public function destroy($id) 95 | { 96 | $verifiedRequest = VerifiedRequest::findOrFail($id); 97 | $verifiedRequest->delete(); 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Cache Stores 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may define all of the cache "stores" for your application as 29 | | well as their drivers. You may even define multiple stores for the 30 | | same cache driver to group types of items stored in your caches. 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | ], 43 | 44 | 'database' => [ 45 | 'driver' => 'database', 46 | 'table' => 'cache', 47 | 'connection' => null, 48 | ], 49 | 50 | 'file' => [ 51 | 'driver' => 'file', 52 | 'path' => storage_path('framework/cache/data'), 53 | ], 54 | 55 | 'memcached' => [ 56 | 'driver' => 'memcached', 57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 58 | 'sasl' => [ 59 | env('MEMCACHED_USERNAME'), 60 | env('MEMCACHED_PASSWORD'), 61 | ], 62 | 'options' => [ 63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 64 | ], 65 | 'servers' => [ 66 | [ 67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 68 | 'port' => env('MEMCACHED_PORT', 11211), 69 | 'weight' => 100, 70 | ], 71 | ], 72 | ], 73 | 74 | 'redis' => [ 75 | 'driver' => 'redis', 76 | 'connection' => 'cache', 77 | ], 78 | 79 | 'dynamodb' => [ 80 | 'driver' => 'dynamodb', 81 | 'key' => env('AWS_ACCESS_KEY_ID'), 82 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 83 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 84 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 85 | ], 86 | 87 | ], 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Cache Key Prefix 92 | |-------------------------------------------------------------------------- 93 | | 94 | | When utilizing a RAM based store such as APC or Memcached, there might 95 | | be other applications utilizing the same cache. So, we'll specify a 96 | | value to get prefixed to all our keys so we can avoid collisions. 97 | | 98 | */ 99 | 100 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 101 | 102 | ]; 103 | -------------------------------------------------------------------------------- /resources/app/src/main/assetRequest/AssetRequest.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 112 | -------------------------------------------------------------------------------- /resources/app/src/assets/scss/components/inputs.scss: -------------------------------------------------------------------------------- 1 | // Configuration modal inputs 2 | .cnf__input { 3 | width: 100%; 4 | padding: 6px 0 0 0 !important; 5 | float: left; 6 | background-color: white; 7 | position: relative; 8 | 9 | &.flex--display { 10 | display: flex; 11 | justify-content: flex-start; 12 | align-items: center; 13 | 14 | label { 15 | width: 60px; 16 | padding-right: 7px; 17 | } 18 | 19 | .datepicker { 20 | float: left; 21 | width: 100%; 22 | } 23 | } 24 | 25 | label { 26 | font-size: 12px; 27 | font-family: $roboto; 28 | font-weight: 400; 29 | color: $labelColor; 30 | margin-bottom: 3px; 31 | } 32 | 33 | .basic__input { 34 | width: 100%; 35 | font-size: 13px; 36 | border-radius: 4px; 37 | border-color: #d7d9db #dfe1e3 #eaebec; 38 | border-width: 1px; 39 | height: 31px; 40 | border-style: solid; 41 | 42 | &.textarea--input { 43 | resize: none; 44 | 45 | &.small--input { 46 | height: 70px; 47 | } 48 | } 49 | 50 | //&.error { 51 | // border-color: $errorColor; 52 | // transition: border .2s $firstBezier; 53 | //} 54 | } 55 | 56 | .error__span { 57 | float: left; 58 | margin-top: 3px; 59 | color: $redColor; 60 | font-size: 12px; 61 | padding-left: 5px; 62 | } 63 | 64 | .checkbox__holder { 65 | display: flex; 66 | box-sizing: border-box; 67 | align-items: center; 68 | padding: 4px 0px; 69 | 70 | input { 71 | margin: 0; 72 | } 73 | 74 | label { 75 | cursor: pointer; 76 | margin-bottom: 0; 77 | display: block; 78 | margin-left: 5px; 79 | margin-top: 1px; 80 | width: 100%; 81 | float: left; 82 | } 83 | } 84 | } 85 | 86 | .cnf__input-html { 87 | display: block; 88 | width: 100%; 89 | float: left; 90 | word-wrap: break-word; 91 | cursor: default; 92 | 93 | 94 | label { 95 | font-size: 12px; 96 | font-family: $roboto; 97 | font-weight: 400; 98 | color: $labelColor; 99 | margin-bottom: 3px; 100 | } 101 | 102 | .view-html { 103 | display: block; 104 | width: 100%; 105 | border: 1px solid #ced4da; 106 | border-radius: 0.25rem; 107 | float: left; 108 | padding: 10px; 109 | } 110 | } 111 | 112 | .col-md-6 { 113 | padding: 0 3px 0 0!important; 114 | } 115 | 116 | .cnt__textarea{ 117 | height: 80px !important; 118 | float: left; 119 | resize: none; 120 | font-size: 14px; 121 | } 122 | 123 | .cnt__textarea-233 { 124 | @extend .cnt__textarea; 125 | height: 233px !important; 126 | } 127 | 128 | .cnt__textarea-188 { 129 | @extend .cnt__textarea; 130 | height: 188px !important; 131 | } 132 | 133 | .cnt__textarea-174 { 134 | @extend .cnt__textarea; 135 | height: 174px !important; 136 | } 137 | 138 | .cnt__textarea-lg { 139 | @extend .cnt__textarea; 140 | min-height: 300px !important; 141 | word-wrap: break-word; 142 | height: auto !important; 143 | } 144 | 145 | .vue-treeselect__control { 146 | border-color: #ccc !important; 147 | height: 34px !important; 148 | font-size: 14px; 149 | color: $alphabetContent; 150 | } 151 | 152 | .vue-treeselect__single-value { 153 | color: #555 !important; 154 | } 155 | 156 | .vue-treeselect__input{ 157 | font-size: 14px; 158 | } 159 | 160 | .form-control:focus { 161 | border-color: #ccc !important; 162 | box-shadow: none !important; 163 | } 164 | 165 | .form-control { 166 | box-shadow: none !important; 167 | font-size: 14px !important; 168 | } 169 | 170 | --------------------------------------------------------------------------------