Commit 4bd3c9e2 authored by Renato  Pratas's avatar Renato Pratas
Browse files

Initial commit

parents
Pipeline #140 failed with stages
File added
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.yml]
indent_style = space
indent_size = 2
APP_ENV=local
APP_DEBUG=true
APP_CACHE=false
APP_INSTALLED=false
APP_EDITOR=vscode
APP_KEY=
APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
QUEUE_DRIVER=sync
CACHE_DRIVER=file
SESSION_DRIVER=file
FILESYSTEM_DRIVER=public_storage
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME=null
MAIL_ENCRYPTION=null
SCOUT_QUEUE=false
DEBUGBAR_ENABLED=false
QUERY_DETECTOR_ENABLED=false
/public
/Modules/*/Assets
/Themes/*/assets
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jquery": true
},
"extends": [
"spatie",
"plugin:import/errors",
"plugin:import/warnings"
],
"rules": {
"prefer-const": "off"
},
"globals": {
"_": true,
"Sortable": true,
"Mousetrap": true,
"CloudInfo": true,
"DataTable": true,
"MediaPicker": true,
"noUiSlider": true,
"route": true,
"ohSnap": true,
"notify": true,
"info": true,
"success": true,
"warning": true,
"error": true,
"trans": true
}
}
.idea/
.phpintel/
*.sublime-project
node_modules/
/vendor
/public/storage
/public/media
/public/modules
/public/themes
/Modules/*/Assets
/Themes/*/assets
mix-manifest.json
npm-debug.log
yarn-error.log
tags
*.map
.env
/public/hot
/storage/*.key
/storage/framework/views
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
\ No newline at end of file
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
scripts-prepend-node-path=true
<?php
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'method_separation' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => false,
'single_quote' => true,
'binary_operator_spaces' => [
'align_double_arrow' => false,
'align_equals' => false,
],
'blank_line_after_opening_tag' => true,
'blank_line_before_return' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'braces' => [
'allow_single_line_closure' => true,
],
'cast_spaces' => ['space' => 'single'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => true,
'function_typehint_space' => true,
'hash_to_slash_comment' => true,
'include' => true,
'lowercase_cast' => true,
'native_function_casing' => true,
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => [
'curly_brace_block',
'extra',
'parenthesis_brace_block',
'square_brace_block',
'throw',
'use',
],
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => ['use' => 'echo'],
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiline_whitespace_before_semicolons' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
'no_unneeded_curly_braces' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => ['sortAlgorithm' => 'length'],
'php_unit_fqcn_annotation' => true,
'phpdoc_scalar' => true,
'phpdoc_return_self_reference' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'semicolon_after_instruction' => true,
'short_scalar_cast' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'whitespace_after_comma_in_array' => true,
]);
{
"options": {
"autoRename": false,
"autoRenameStrict": false,
"blacklist": {},
"clean": true,
"greedy": false,
"processUrls": false,
"stringMap": []
},
"plugins": [],
"map": false
}
<?php
return [
/*
|--------------------------------------------------------------------------
| Define which assets will be available through the asset manager
|--------------------------------------------------------------------------
| These assets are registered on the asset manager
*/
'all_assets' => [
'admin.css' => ['module' => 'admin:css/admin.css'],
'admin.js' => ['module' => 'admin:js/admin.js'],
'admin.dashboard.css' => ['module' => 'admin:css/dashboard.css'],
'admin.dashboard.js' => ['module' => 'admin:js/dashboard.js'],
'admin.polyfill.js' => ['cdn' => 'https://cdn.polyfill.io/v2/polyfill.min.js'],
],
/*
|--------------------------------------------------------------------------
| Define which default assets will always be included in your pages
| through the asset pipeline
|--------------------------------------------------------------------------
*/
'required_assets' => ['admin.css', 'admin.polyfill.js', 'admin.js'],
];
<?php
namespace Modules\Admin\Http\Controllers\Admin;
use Modules\User\Entities\User;
use Illuminate\Routing\Controller;
class DashboardController extends Controller
{
/**
* Display the dashboard with its widgets.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('admin::dashboard.index');
}
}
<?php
namespace Modules\Admin\Http\Controllers\Admin;
use Modules\Order\Entities\Order;
use Illuminate\Routing\Controller;
class SalesAnalyticsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return response()->json([
'labels' => trans('admin::dashboard.sales_analytics.day_names'),
'data' => Order::salesAnalytics(),
]);
}
}
<?php
namespace Modules\Admin\Http\ViewComposers;
use Modules\Core\Events\CollectingAssets;
use Modules\Core\Foundation\Asset\Pipeline\AssetPipeline;
class AssetsComposer
{
/**
* The instance of AssetPipeline.
*
* @var \Modules\Core\Foundation\Asset\Pipeline\AssetPipeline
*/
private $assetPipeline;
/**
* Create a new composer instance.
*
* @param \Modules\Core\Foundation\Asset\Pipeline\AssetPipeline $assetPipeline
*/
public function __construct(AssetPipeline $assetPipeline)
{
$this->assetPipeline = $assetPipeline;
}
/**
* Bind data to the view.
*
* @param \Illuminate\View\View $view
* @return void
*/
public function compose($view)
{
event(new CollectingAssets($this->assetPipeline));
$view->with('assets', $this->assetPipeline);
}
}
<?php
namespace Modules\Admin\Http\ViewCreators;
use Illuminate\View\View;
use Modules\Admin\Sidebar\AdminSidebar;
use Maatwebsite\Sidebar\Presentation\SidebarRenderer;
class AdminSidebarCreator
{
/**
* @var \Modules\Admin\Sidebar\AdminSidebar
*/
protected $sidebar;
/**
* @var \Maatwebsite\Sidebar\Presentation\SidebarRenderer
*/
protected $renderer;
/**
* @param \Modules\Admin\Sidebar\AdminSidebar $sidebar
* @param \Maatwebsite\Sidebar\Presentation\SidebarRenderer $renderer
*/
public function __construct(AdminSidebar $sidebar, SidebarRenderer $renderer)
{
$this->sidebar = $sidebar;
$this->renderer = $renderer;
}
public function create(View $view)
{
$view->sidebar = $this->renderer->render($this->sidebar);
}
}
<?php
namespace Modules\Admin\Providers;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\View;
use Modules\Support\Traits\AddsAsset;
use Illuminate\Support\ServiceProvider;
use Modules\Support\Traits\LoadsConfig;
use Modules\Admin\Http\ViewComposers\AssetsComposer;
class AdminServiceProvider extends ServiceProvider
{
use AddsAsset, LoadsConfig;
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
View::composer('admin::layout', AssetsComposer::class);
Paginator::defaultSimpleView('admin::pagination.simple');
$this->addAdminAssets('admin.dashboard.index', ['admin.dashboard.css', 'admin.dashboard.js']);
}
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->loadConfigs('assets.php');
}
}
<?php
namespace Modules\Admin\Providers;
use Modules\Core\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* The root namespace to assume when generating URLs to actions.
*
* @var string
*/
protected $namespace = 'Modules\Admin\Http\Controllers';
/**
* Get admin routes.
*
* @return string
*/
protected function admin()
{
return __DIR__ . '/../Routes/admin.php';
}
}
<?php
namespace Modules\Admin\Providers;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Maatwebsite\Sidebar\SidebarManager;
use Modules\Admin\Sidebar\AdminSidebar;
use Modules\Admin\Http\ViewCreators\AdminSidebarCreator;
class SidebarServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot(SidebarManager $manager)
{
if (! config('app.installed')) {
return;
}
if ($this->app['inBackend']) {
$manager->register(AdminSidebar::class);
}
View::creator('admin::partials.sidebar', AdminSidebarCreator::class);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment