Skip to content

Commit

Permalink
add assets
Browse files Browse the repository at this point in the history
add php cs
  • Loading branch information
muhajirinlpu committed Oct 7, 2019
1 parent 74e22d4 commit e600a57
Show file tree
Hide file tree
Showing 93 changed files with 8,085 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ composer.phar
composer.lock
.DS_Store
Thumbs.db
.php_cs.cache
91 changes: 91 additions & 0 deletions .php_cs
@@ -0,0 +1,91 @@
<?php

$rules = [
'array_syntax' => [
'syntax' => 'short',
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_return' => true,
'braces' => true,
'cast_spaces' => true,
'concat_space' => ['spacing' => 'none'],
'no_multiline_whitespace_around_double_arrow' => true,
'no_empty_statement' => true,
'elseif' => true,
'simplified_null_return' => true,
'encoding' => true,
'single_blank_line_at_eof' => true,
'no_extra_consecutive_blank_lines' => [
'use',
],
'no_spaces_after_function_name' => true,
'no_trailing_comma_in_list_call' => true,
'not_operator_with_successor_space' => true,
'function_declaration' => true,
'include' => true,
'indentation_type' => true,
'no_alias_functions' => true,
'line_ending' => true,
'lowercase_constants' => true,
'lowercase_keywords' => true,
'method_argument_space' => true,
'trailing_comma_in_multiline_array' => true,
'no_multiline_whitespace_before_semicolons' => true,
'single_import_per_statement' => true,
'no_leading_namespace_whitespace' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'object_operator_without_whitespace' => true,
'binary_operator_spaces' => [
'align_equals' => false,
],
'no_spaces_inside_parenthesis' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
'phpdoc_no_access' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'phpdoc_summary' => true,
'phpdoc_to_comment' => true,
'phpdoc_no_alias_tag' => [
'type' => 'var',
],
'self_accessor' => true,
'phpdoc_var_without_name' => true,
'no_leading_import_slash' => true,
'no_short_echo_tag' => true,
'full_opening_tag' => true,
'no_trailing_comma_in_singleline_array' => true,
'single_blank_line_before_namespace' => true,
'single_line_after_imports' => true,
'single_quote' => true,
'no_singleline_whitespace_before_semicolons' => true,
'cast_spaces' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'no_trailing_whitespace' => true,
'unary_operator_spaces' => true,
'trim_array_spaces' => true,
'no_unused_imports' => true,
'visibility_required' => true,
'no_whitespace_in_blank_line' => true,
'ordered_imports' => [
'sortAlgorithm' => 'length'
],
'ordered_class_elements' => [
'order' => ['use_trait', 'constant_public', 'constant_protected', 'constant_private', 'property_public', 'property_protected', 'property_private', 'construct', 'destruct', 'magic', 'phpunit', 'method_public', 'method_protected', 'method_private']
]
];

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules($rules)
->setFinder(
PhpCsFixer\Finder::create()
->exclude('storage')
->exclude('vendor')
->notPath('config/routes.php')
->notName('*.blade.php')
->in(__DIR__)
);
32 changes: 32 additions & 0 deletions resources/js/app.js
@@ -0,0 +1,32 @@
/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/

require('./bootstrap');

window.Vue = require('vue');

/**
* The following block of code may be used to automatically register your
* Vue components. It will recursively scan this directory for the Vue
* components and automatically register them with their "basename".
*
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
*/

// const files = require.context('./', true, /\.vue$/i)
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))

// Vue.component('example-component', require('./components/ExampleComponent.vue').default);

/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
* or customize the JavaScript scaffolding to fit your unique needs.
*/

const app = new Vue({
el: '#app',
});
54 changes: 54 additions & 0 deletions resources/js/bootstrap.js
@@ -0,0 +1,54 @@
window._ = require('lodash');

/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/

window.axios = require('axios');

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

window.jQuery = window.$ = require('jquery');

window.moment = require('moment');

require('popper.js');
require('assets/resources/js/bootstrap');
require('jquery.nicescroll');

require('./stiesla/stisla');
require('./stiesla/scripts');
require('./stiesla/custom');

/**
* Next we will register the CSRF Token as a common header with Axios so that
* all outgoing HTTP requests automatically have it attached. This is just
* a simple convenience so we don't have to attach every token manually.
*/

let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/

// import Echo from 'laravel-echo'

// window.Pusher = require('pusher-js');

// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: process.env.MIX_PUSHER_APP_KEY,
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
// encrypted: true
// });
8 changes: 8 additions & 0 deletions resources/js/stiesla/custom.js
@@ -0,0 +1,8 @@
/**
*
* You can write your JS code here, DO NOT touch the default style file
* because it will make it harder for you to update.
*
*/

"use strict";

0 comments on commit e600a57

Please sign in to comment.