Initial commit

This commit is contained in:
merdiano 2019-05-11 05:27:49 +05:00
commit 5628604edd
12726 changed files with 2096580 additions and 0 deletions

15
.editorconfig Normal file
View File

@ -0,0 +1,15 @@
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_size = 2

44
.env.example Normal file
View File

@ -0,0 +1,44 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
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
BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
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_ENCRYPTION=null
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

5
.gitattributes vendored Normal file
View File

@ -0,0 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore

11
.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log

14
.idea/deployment.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData">
<serverData>
<paths name="adonis-pusher">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
</component>
</project>

4
.idea/encodings.xml Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
</project>

6
.idea/misc.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/telemele.iml" filepath="$PROJECT_DIR$/.idea/telemele.iml" />
</modules>
</component>
</project>

114
.idea/php.xml Normal file
View File

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/swiftmailer/swiftmailer" />
<path value="$PROJECT_DIR$/vendor/opis/closure" />
<path value="$PROJECT_DIR$/vendor/monolog/monolog" />
<path value="$PROJECT_DIR$/vendor/mockery/mockery" />
<path value="$PROJECT_DIR$/vendor/erusev/parsedown" />
<path value="$PROJECT_DIR$/vendor/dnoegel/php-xdg-base-dir" />
<path value="$PROJECT_DIR$/vendor/phar-io/version" />
<path value="$PROJECT_DIR$/vendor/phar-io/manifest" />
<path value="$PROJECT_DIR$/vendor/theseer/tokenizer" />
<path value="$PROJECT_DIR$/vendor/league/flysystem" />
<path value="$PROJECT_DIR$/vendor/fideloper/proxy" />
<path value="$PROJECT_DIR$/vendor/egulias/email-validator" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-iconv" />
<path value="$PROJECT_DIR$/vendor/symfony/debug" />
<path value="$PROJECT_DIR$/vendor/symfony/process" />
<path value="$PROJECT_DIR$/vendor/symfony/console" />
<path value="$PROJECT_DIR$/vendor/symfony/http-kernel" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php72" />
<path value="$PROJECT_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" />
<path value="$PROJECT_DIR$/vendor/symfony/var-dumper" />
<path value="$PROJECT_DIR$/vendor/paragonie/random_compat" />
<path value="$PROJECT_DIR$/vendor/psr/simple-cache" />
<path value="$PROJECT_DIR$/vendor/symfony/css-selector" />
<path value="$PROJECT_DIR$/vendor/symfony/routing" />
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
<path value="$PROJECT_DIR$/vendor/symfony/contracts" />
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" />
<path value="$PROJECT_DIR$/vendor/psr/log" />
<path value="$PROJECT_DIR$/vendor/symfony/translation" />
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-ctype" />
<path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-token-stream" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-timer" />
<path value="$PROJECT_DIR$/vendor/phpoption/phpoption" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" />
<path value="$PROJECT_DIR$/vendor/symfony/http-foundation" />
<path value="$PROJECT_DIR$/vendor/phpunit/phpunit" />
<path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" />
<path value="$PROJECT_DIR$/vendor/dragonmantank/cron-expression" />
<path value="$PROJECT_DIR$/vendor/filp/whoops" />
<path value="$PROJECT_DIR$/vendor/ramsey/uuid" />
<path value="$PROJECT_DIR$/vendor/phpspec/prophecy" />
<path value="$PROJECT_DIR$/vendor/doctrine/lexer" />
<path value="$PROJECT_DIR$/vendor/doctrine/inflector" />
<path value="$PROJECT_DIR$/vendor/doctrine/instantiator" />
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/sebastian/exporter" />
<path value="$PROJECT_DIR$/vendor/sebastian/environment" />
<path value="$PROJECT_DIR$/vendor/sebastian/comparator" />
<path value="$PROJECT_DIR$/vendor/sebastian/global-state" />
<path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" />
<path value="$PROJECT_DIR$/vendor/jakub-onderka/php-console-highlighter" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" />
<path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" />
<path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" />
<path value="$PROJECT_DIR$/vendor/nesbot/carbon" />
<path value="$PROJECT_DIR$/vendor/sebastian/version" />
<path value="$PROJECT_DIR$/vendor/sebastian/diff" />
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<path value="$PROJECT_DIR$/vendor/jakub-onderka/php-console-color" />
<path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" />
<path value="$PROJECT_DIR$/vendor/webmozart/assert" />
<path value="$PROJECT_DIR$/vendor/psy/psysh" />
<path value="$PROJECT_DIR$/vendor/beyondcode/laravel-dump-server" />
<path value="$PROJECT_DIR$/vendor/laravel/framework" />
<path value="$PROJECT_DIR$/vendor/nunomaduro/collision" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" />
<path value="$PROJECT_DIR$/vendor/laravel/tinker" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" />
<path value="$PROJECT_DIR$/vendor/hamcrest/hamcrest-php" />
<path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" />
<path value="$PROJECT_DIR$/vendor/fzaninotto/faker" />
<path value="$PROJECT_DIR$/vendor/nikic/php-parser" />
<path value="$PROJECT_DIR$/vendor/vlucas/phpdotenv" />
<path value="$PROJECT_DIR$/vendor/doctrine/dbal" />
<path value="$PROJECT_DIR$/vendor/doctrine/event-manager" />
<path value="$PROJECT_DIR$/vendor/doctrine/cache" />
<path value="$PROJECT_DIR$/vendor/psr/http-message" />
<path value="$PROJECT_DIR$/vendor/backpack/crud" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/guzzle" />
<path value="$PROJECT_DIR$/vendor/ralouphie/getallheaders" />
<path value="$PROJECT_DIR$/vendor/prologue/alerts" />
<path value="$PROJECT_DIR$/vendor/backpack/base" />
<path value="$PROJECT_DIR$/vendor/venturecraft/revisionable" />
<path value="$PROJECT_DIR$/vendor/intervention/image" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/promises" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/psr7" />
<path value="$PROJECT_DIR$/vendor/creativeorange/gravatar" />
<path value="$PROJECT_DIR$/vendor/almasaeed2010/adminlte" />
<path value="$PROJECT_DIR$/vendor/backpack/generators" />
<path value="$PROJECT_DIR$/vendor/laracasts/generators" />
<path value="$PROJECT_DIR$/vendor/league/flysystem-cached-adapter" />
<path value="$PROJECT_DIR$/vendor/studio-42/elfinder" />
<path value="$PROJECT_DIR$/vendor/psr/cache" />
<path value="$PROJECT_DIR$/vendor/barryvdh/laravel-elfinder" />
<path value="$PROJECT_DIR$/vendor/barryvdh/elfinder-flysystem-driver" />
<path value="$PROJECT_DIR$/vendor/davejamesmiller/laravel-breadcrumbs" />
<path value="$PROJECT_DIR$/vendor/moontoast/math" />
</include_path>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.1" />
<component name="PhpUnit">
<phpunit_settings>
<PhpUnitSettings load_method="CUSTOM_LOADER" configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" />
</phpunit_settings>
</component>
</project>

112
.idea/telemele.iml Normal file
View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<excludeFolder url="file://$MODULE_DIR$/vendor/almasaeed2010/adminlte" />
<excludeFolder url="file://$MODULE_DIR$/vendor/backpack/base" />
<excludeFolder url="file://$MODULE_DIR$/vendor/backpack/crud" />
<excludeFolder url="file://$MODULE_DIR$/vendor/backpack/generators" />
<excludeFolder url="file://$MODULE_DIR$/vendor/barryvdh/elfinder-flysystem-driver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/barryvdh/laravel-elfinder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/beyondcode/laravel-dump-server" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/creativeorange/gravatar" />
<excludeFolder url="file://$MODULE_DIR$/vendor/davejamesmiller/laravel-breadcrumbs" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dnoegel/php-xdg-base-dir" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/dbal" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/event-manager" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/dragonmantank/cron-expression" />
<excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/erusev/parsedown" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fideloper/proxy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" />
<excludeFolder url="file://$MODULE_DIR$/vendor/fzaninotto/faker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
<excludeFolder url="file://$MODULE_DIR$/vendor/hamcrest/hamcrest-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/intervention/image" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jakub-onderka/php-console-color" />
<excludeFolder url="file://$MODULE_DIR$/vendor/jakub-onderka/php-console-highlighter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laracasts/generators" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/framework" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravel/tinker" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem" />
<excludeFolder url="file://$MODULE_DIR$/vendor/league/flysystem-cached-adapter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/mockery/mockery" />
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
<excludeFolder url="file://$MODULE_DIR$/vendor/moontoast/math" />
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nunomaduro/collision" />
<excludeFolder url="file://$MODULE_DIR$/vendor/opis/closure" />
<excludeFolder url="file://$MODULE_DIR$/vendor/paragonie/random_compat" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpoption/phpoption" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-token-stream" />
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" />
<excludeFolder url="file://$MODULE_DIR$/vendor/prologue/alerts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/http-message" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/simple-cache" />
<excludeFolder url="file://$MODULE_DIR$/vendor/psy/psysh" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ralouphie/getallheaders" />
<excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/uuid" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" />
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" />
<excludeFolder url="file://$MODULE_DIR$/vendor/studio-42/elfinder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/swiftmailer/swiftmailer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/contracts" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/css-selector" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/debug" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-kernel" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-ctype" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-iconv" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php72" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/routing" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-dumper" />
<excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/tijsverkoyen/css-to-inline-styles" />
<excludeFolder url="file://$MODULE_DIR$/vendor/venturecraft/revisionable" />
<excludeFolder url="file://$MODULE_DIR$/vendor/vlucas/phpdotenv" />
<excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

42
app/Console/Kernel.php Normal file
View File

@ -0,0 +1,42 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View File

@ -0,0 +1,51 @@
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
* @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace App\Http\Controllers\Admin;
use Backpack\CRUD\app\Http\Controllers\CrudController;
// VALIDATION: change the requests to match your own file names if you need form validation
use App\Http\Requests\CategoryRequest as StoreRequest;
use App\Http\Requests\CategoryRequest as UpdateRequest;
use Backpack\CRUD\CrudPanel;
/**
* Class CategoryCrudController
* @package App\Http\Controllers\Admin
* @property-read CrudPanel $crud
*/
class CategoryCrudController extends CrudController
{
public function setup()
{
/*
|--------------------------------------------------------------------------
| CrudPanel Basic Information
|--------------------------------------------------------------------------
*/
$this->crud->setModel('App\Models\Category');
$this->crud->setRoute(config('backpack.base.route_prefix') . '/category');
$this->crud->setEntityNameStrings('category', 'categories');
$this->crud->allowAccess('reorder');
$this->crud->enableReorder('name', 3);
/*
|--------------------------------------------------------------------------
| CrudPanel Configuration
|--------------------------------------------------------------------------
*/
// TODO: remove setFromDb() and manually define Fields and Columns
//$this->crud->setFromDb();
$this->crud->addColumn([
'name' => 'name',
'type' => 'text',
'label' => trans('admin.name')
]);
$this->crud->addField([
'name' => 'name',
'type' => 'text',
'label' => trans('admin.name')
]);
// add asterisk for fields that are required in CategoryRequest
$this->crud->setRequiredFields(StoreRequest::class, 'create');
$this->crud->setRequiredFields(UpdateRequest::class, 'edit');
}
public function store(StoreRequest $request)
{
// your additional operations before save here
$redirect_location = parent::storeCrud($request);
// your additional operations after save here
// use $this->data['entry'] or $this->crud->entry
return $redirect_location;
}
public function update(UpdateRequest $request)
{
// your additional operations before save here
$redirect_location = parent::updateCrud($request);
// your additional operations after save here
// use $this->data['entry'] or $this->crud->entry
return $redirect_location;
}
}

View File

@ -0,0 +1,110 @@
<?php
namespace App\Http\Controllers\Admin;
use Backpack\CRUD\app\Http\Controllers\CrudController;
// VALIDATION: change the requests to match your own file names if you need form validation
use App\Http\Requests\MaterialRequest as StoreRequest;
use App\Http\Requests\MaterialRequest as UpdateRequest;
use Backpack\CRUD\CrudPanel;
/**
* Class MaterialCrudController
* @package App\Http\Controllers\Admin
* @property-read CrudPanel $crud
*/
class MaterialCrudController extends CrudController
{
public function setup()
{
/*
|--------------------------------------------------------------------------
| CrudPanel Basic Information
|--------------------------------------------------------------------------
*/
$this->crud->setModel('App\Models\Material');
$this->crud->setRoute(config('backpack.base.route_prefix') . '/material');
$this->crud->setEntityNameStrings('material', 'materials');
/*
|--------------------------------------------------------------------------
| CrudPanel Configuration
|--------------------------------------------------------------------------
*/
// TODO: remove setFromDb() and manually define Fields and Columns
//$this->crud->setFromDb();
$this->crud->addColumns([
['name' => 'title','type' => 'text', 'lable' => trans('admin.title')],
['name' => 'view','type' => 'text', 'lable' => trans('admin.view')],
['name' => 'rating','type' => 'text', 'lable' => trans('admin.like')],
['name' => 'price','type' => 'text', 'lable' => trans('admin.price')],
['name' => 'size','type' => 'text', 'lable' => trans('admin.size')],
['name' => 'duration','type' => 'text', 'lable' => trans('admin.duration')],
['name' => 'day_count','type' => 'text', 'lable' => trans('admin.day_count')],
['name' => 'download_count','type' => 'text', 'lable' => trans('admin.download_count')],
]);
$this->crud->addFields([
['name' => 'title','type' => 'text', 'lable' => trans('admin.title'),'tab' => trans('admin.material.firsttab')],
['name' => 'category_id', 'type' => 'select', 'entity' => 'category', 'attribute' =>'name', 'model' => 'App\Models\Category',
'lable'=>trans('admin.category'), 'tab' => trans('admin.material.firsttab')],
['name' => 'desc','type' => 'textarea', 'lable' => trans('admin.desc'),'tab' => trans('admin.material.firsttab')],
['suffix' => 'manat','name' => 'price','type' => 'number', 'lable' => trans('admin.price'),'tab' => trans('admin.material.secondtab')],
['suffix'=>'kilobyte','name' => 'size','type' => 'number', 'lable' => trans('admin.size'),'tab' => trans('admin.material.secondtab')],
['suffix'=>'minut','name' => 'duration','type' => 'number', 'lable' => trans('admin.duration'),'tab' => trans('admin.material.secondtab')],
[ // image
'tab' => trans('admin.material.thirdtab'),
'label' => "Material Image",
'name' => "banner_url",
'type' => 'image',
'upload' => true,
'crop' => true, // set to true to allow cropping, false to disable
'aspect_ratio' => 2, // ommit or set to 0 to allow any aspect ratio
//'disk' => 'uploads', // in case you need to show images from a different disk
'prefix' => 'uploads/' // in case your db value is only the file name (no path), you can use this to prepend your path to the image src (in HTML), before it's shown to the user;
],
['name' => 'trailer_url','type' => 'browse', 'lable' => trans('admin.trailer_url'),'tab' => trans('admin.material.thirdtab')],
['name' => 'content_url','type' => 'browse', 'lable' => trans('admin.content_url'),'tab' => trans('admin.material.thirdtab')],
['name' => 'day_count','type' => 'number', 'lable' => trans('admin.day_count'),'tab' => trans('admin.material.secondtab')],
['name' => 'download_count','type' => 'number', 'lable' => trans('admin.download_count'),'tab' => trans('admin.material.secondtab')],
// [ // Table
// 'name' => 'details',
// 'label' => trans('admin.material.extras'),
// 'type' => 'table',
// 'entity_singular' => 'detail', // used on the "Add X" button
// 'columns' => [
// 'name' => 'Name',
// 'desc' => 'Description'
// ],
// 'tab' => trans('admin.material.fourthtab'),
// ],
]);
// add asterisk for fields that are required in MaterialRequest
$this->crud->setRequiredFields(StoreRequest::class, 'create');
$this->crud->setRequiredFields(UpdateRequest::class, 'edit');
}
public function store(StoreRequest $request)
{
// your additional operations before save here
$redirect_location = parent::storeCrud($request);
// your additional operations after save here
// use $this->data['entry'] or $this->crud->entry
return $redirect_location;
}
public function update(UpdateRequest $request)
{
// your additional operations before save here
$redirect_location = parent::updateCrud($request);
// your additional operations after save here
// use $this->data['entry'] or $this->crud->entry
return $redirect_location;
}
}

View File

@ -0,0 +1,61 @@
<?php
namespace App\Http\Controllers\Admin;
use Backpack\CRUD\app\Http\Controllers\CrudController;
// VALIDATION: change the requests to match your own file names if you need form validation
use App\Http\Requests\OrderRequest as StoreRequest;
use App\Http\Requests\OrderRequest as UpdateRequest;
use Backpack\CRUD\CrudPanel;
/**
* Class OrderCrudController
* @package App\Http\Controllers\Admin
* @property-read CrudPanel $crud
*/
class OrderCrudController extends CrudController
{
public function setup()
{
/*
|--------------------------------------------------------------------------
| CrudPanel Basic Information
|--------------------------------------------------------------------------
*/
$this->crud->setModel('App\Models\Order');
$this->crud->setRoute(config('backpack.base.route_prefix') . '/order');
$this->crud->setEntityNameStrings('order', 'orders');
/*
|--------------------------------------------------------------------------
| CrudPanel Configuration
|--------------------------------------------------------------------------
*/
// TODO: remove setFromDb() and manually define Fields and Columns
$this->crud->setFromDb();
// add asterisk for fields that are required in OrderRequest
$this->crud->setRequiredFields(StoreRequest::class, 'create');
$this->crud->setRequiredFields(UpdateRequest::class, 'edit');
}
public function store(StoreRequest $request)
{
// your additional operations before save here
$redirect_location = parent::storeCrud($request);
// your additional operations after save here
// use $this->data['entry'] or $this->crud->entry
return $redirect_location;
}
public function update(UpdateRequest $request)
{
// your additional operations before save here
$redirect_location = parent::updateCrud($request);
// your additional operations after save here
// use $this->data['entry'] or $this->crud->entry
return $redirect_location;
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}

View File

@ -0,0 +1,83 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
/**
* Determine if the request field is email or username.
*
* @param \Illuminate\Http\Request $request
* @return string
*/
public function field(Request $request)
{
$email = $this->username();
return filter_var($request->get($email), FILTER_VALIDATE_EMAIL) ? $email : 'phone';
}
/**
* Get the needed authorization credentials from the request.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
protected function credentials(Request $request)
{
$field = $this->field($request);
return [
$field => $request->get($this->username()),
'password' => $request->get('password')
];
}
/**
* Validate the user login request.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
protected function validateLogin(Request $request)
{
$field = $this->field($request);
$messages = ["{$this->username()}.exists" => trans('auth.fail')];
$this->validate($request, [
$this->username() => "required|exists:users,{$field}",
'password' => 'required',
], $messages);
}
}

View File

@ -0,0 +1,76 @@
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = '/';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'firstname' => ['required', 'string', 'max:255'],
'lastname' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'phone' => ['required', 'numeric', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\User
*/
protected function create(array $data)
{
return User::create([
'name' => "{$data['firstname']} {$data['lastname']}",
'email' => $data['email'],
'phone' => $data['phone'],
'is_admin' => 0,
'password' => Hash::make($data['password']),
]);
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
use Illuminate\Support\Facades\Auth;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
Auth::routes();
$this->middleware('guest');
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;
class VerificationController extends Controller
{
/*
|--------------------------------------------------------------------------
| Email Verification Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling email verification for any
| user that recently registered with the application. Emails may also
| be re-sent if the user didn't receive the original email message.
|
*/
use VerifiesEmails;
/**
* Where to redirect users after verification.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}

View File

@ -0,0 +1,203 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\ProfileRequest;
use App\Models\Category;
use App\Models\Material;
use App\Models\Order;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cookie;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
protected $mainCategories;
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index(){
$cat = Category::where('depth',1)
->orderBy('lft')->firstOrFail();
$materials = Material::where('category_id',$cat->id)->paginate(6);
return view('main')->with([
'cat' => $cat,
'materials' => $materials,
'sort' => 'all'
]);
}
public function category($cat_id){
//dd(\request());
$request = \request();
$sort = $request['sort'];
$sort = $sort ?? 'all';
//dd($request['sort']);
//todo restrict sort to be only {'all','rate','date'}
$cat = Category:: findOrFail($cat_id);
$materials = Material::where('category_id',$cat_id);
switch ($sort){
case 'rate':
$materials->orderBy('rating','DESC');
break;
case 'date':
$materials->orderBy('created_at','DESC');
break;
}
$materials = $materials->paginate(6);
//dd($materials);
return view('main')->with([
'cat' => $cat,
'materials' => $materials,
'sort' => $sort
]);
}
public function download($material_id){
//todo check limits
$material = Material::findOrFail($material_id);
$order = Order::where('user_id',auth()->id())
->where('material_id',$material_id)
// ->where('registered',1)//todo payed
->first();
if(!empty($order)){
if(!($order->download_count !=0 && $order->downloaded == $order->download_count)
||(!empty($order->last_date) && !(Carbon::today()->lte($order->last_date))))
{
$file = public_path($material->content_url);
//dd(public_path($material->trailer_url));
return response()->download($file, Str::slug($material->title));
}
}
return redirect()->back();
}
public function material($material_id){
$material = Material::findOrFail($material_id);
$watch_list_cookie = Cookie::get('watchlist');
$material->view ++;
$material->save();
// dd($material->details);
if(!$watch_list_cookie){
$watch_list = [1 => $material_id];
Cookie::queue('watchlist', json_encode($watch_list), 450000);
}
else{
$watch_list = json_decode($watch_list_cookie,true);
//dd($watch_list);
if(!array_search($material_id,$watch_list)){
$watch_list[]=$material_id;
Cookie::queue('watchlist', json_encode($watch_list), 450000);
}
}
//todo update view count check cookie
// Cookie::queue('watchlist', json_encode([$material_id]), 450000);
// Cookie::queue('wishlist', $material_id, 450000);
// cookie()->forever('watchlist',$material_id,450000);
// dd(Cookie::get('watchlist'));
$order = Order::where('user_id',auth()->id())
->where('material_id',$material_id)
// ->where('registered',1)//todo payed
->first();
if(!empty($order)){
if($order->download_count !=0 && $order->downloaded == $order->download_count){
$order = null;
}elseif (!empty($order->last_date) && !(Carbon::today()->lte($order->last_date))){
$order = null;
}
}
//dd($order);
return view('material',compact('material'))
->with('order',$order)
->with('cat',$material->category);
}
public function like($material_id){
//todo ajax post
$material = Material::findOrFail($material_id);
$like_list_cookie = Cookie::get('likelist');
if(!$like_list_cookie){
$like_list = [1 => $material_id];
Cookie::queue('likelist', json_encode($like_list), 450000);
$material->rate ++;
$material->save();
}
else{
$like_list = json_decode($like_list_cookie,true);
//dd($watch_list);
if(!array_search($material_id,$like_list)){
$like_list[]=$material_id;
$material->view ++;
$material->save();
Cookie::queue('watchlist', json_encode($like_list), 450000);
}
}
// return view('material',compact('material'))->with('cat',$material->category);
return $material->rate;
}
public function watch_list(){
$watch_list = json_decode(Cookie::get('watchlist'),true);
$materials = null;
if($watch_list){
$material_ids = array_values($watch_list);
$materials = Material::whereIn('id',$material_ids)->paginate(6);
}
return view('watched',compact('materials'));
}
public function like_list(){
$like_list = json_decode(Cookie::get('likelist'),true);
$materials = null;
if($like_list){
$material_ids = array_values($like_list);
$materials = Material::whereIn('id',$material_ids)->paginate(6);
}
return view('liked',compact($materials));
}
public function bought_list(){
$orders = Order::with('material')
->where('user_id',auth()->id())
// ->where('payed',0)
->paginate(6);
// dd($orders);/
//todo change payed true
return view('bought',compact('orders'));
}
public function profile(){
// dd(route()->getName());
return view('profile')->with('user',auth()->user());
}
public function profileUpdate(ProfileRequest $request){
$user = auth()->user();
$user->name = $request['name'];
$user->phone = $request['phone'];
$user->email = $request['email'];
if ( ! $request->input('password') == '')
{
$user->password = bcrypt($request->input('password'));
}
$user->save();
return redirect()->back();
}
}

View File

@ -0,0 +1,143 @@
<?php
namespace App\Http\Controllers;
use App\Models\Material;
use App\Models\Order;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use GuzzleHttp\Client;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
class OrderController extends Controller
{
public function buy($material_id){
$material = Material::findOrFail($material_id);
$order = Order::firstOrNew([
'material_id' => $material_id,
'user_id' => auth()->id()
]);
$order->price = $material->price;
$order->title = $material->title;
$order->registered = 0;
$order->payed = 0;
$order->download_count = $material->download_count;
$order->downloaded = 0;
if($material->day_count != 0)
$order->last_date = Carbon::today()->addDays($material->day_count);
else
$order->last_date = null;
$order->oid = str_replace('-','',Str::orderedUuid());
$order->save();
return $this->register($order);
}
private function register(Order $order){
$url = config('app.gateway_url');
$user = config('app.gateway_user');
$pwd = config('app.gateway_password');
// dd($pwd);
if(!($user && $url && $pwd)){
throw new MethodNotAllowedException();
}
$client = new Client(['base_uri' => $url]);
try{
$response = $client->request('POST', 'register.do', [
'connect_timeout' => 15,
'timeout' => 15,
'verify' => false,
'form_params' => [
'userName' => $user,
'password' => $pwd,
'orderNumber' => $order->oid,
'currency' => 934,
'language' => 'ru',
'description'=> $order->title,
'amount' =>$order->price * 100,// amount w kopeykah
'returnUrl' => route('order_status', $order->id),
//'failUrl' => route('paymentFail', $order->id)
]
]);
$data = json_decode($response->getBody(), true);
if($data['errorCode'] == 0){
$order->registered = 1;
$order->orderId = $data['orderId'];
$order->formUrl = $data['formUrl'];
$url = $order->formUrl;
}
else {
// $order->status = 'register_failed';
$order->errorCode = $data['errorCode'];
$order->errorMessage = $data['errorMessage'];
$order->formUrl = url('order',$order->id);
$url = redirect()->back();
request()->session()->flash('status','danger');
request()->session()->flash('status_message',$order->errorMessage);
}
$order->save();
}catch (\Exception $ex){
request()->session()->flash('status','danger');
request()->session()->flash('status_message',trans('abonent.gateway_not_responding_message'));
dd($ex);
$url = redirect()->back();
}
return redirect($url);
}
public function result($order_id){
$order = Order::findOrFail($order_id);
$url = config('app.gateway_url');
$user = config('app.gateway_user');
$pwd = config('app.gateway_password');
if(!($user && $url && $pwd)){
throw new MethodNotAllowedException();
}
$client = new Client(['base_uri' => $url]);
try{
$response = $client->request('POST', 'getOrderStatus.do', [
'verify' => false,
'connect_timeout' => 15,
'timeout' => 15,
'form_params' => [
'userName' => $user,
'password' => $pwd,
'orderId' => $order->orderId,
]
]);
$data = json_decode($response->getBody(), true);
if($data['ErrorCode'] == 0){
if($data['OrderStatus'] == 2){ //payment successfull
$order->payed = 1;
// $this->makePayment($order);
request()->session()->flash('status','success');
request()->session()->flash('status_message',trans('abonent.payment_successfull'));
}
}
else{
// $order->status = 'payment_failed';
$order->errorCode = $data['ErrorCode'];
$order->errorMessage = $data['ErrorMessage'];
request()->session()->flash('status','danger');
request()->session()->flash('status_message',$order->errorMessage);
}
$order->save();
}
catch (\Exception $e){
request()->session()->flash('status','danger');
request()->session()->flash('status_message',trans('abonent.gateway_not_responding_message'));
redirect()->route('orderDetail',$order_id);
}
return view('material')->with('material',$order->material);
}
}

80
app/Http/Kernel.php Normal file
View File

@ -0,0 +1,80 @@
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\TrustProxies::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
'throttle:60,1',
'bindings',
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
/**
* The priority-sorted list of middleware.
*
* This forces non-global middleware to always be in the given order.
*
* @var array
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
}

View File

@ -0,0 +1,21 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
class CheckForMaintenanceMode extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,65 @@
<?php
namespace App\Http\Middleware;
use Closure;
class CheckIfAdmin
{
/**
* Checked that the logged in user is an administrator.
*
* --------------
* VERY IMPORTANT
* --------------
* If you have both regular users and admins inside the same table,
* change the contents of this method to check that the logged in user
* is an admin, and not a regular user.
*
* @param [type] $user [description]
*
* @return bool [description]
*/
private function checkIfUserIsAdmin($user)
{
return ($user->is_admin == 1);
//return true;
}
/**
* Answer to unauthorized access request.
*
* @param [type] $request [description]
*
* @return [type] [description]
*/
private function respondToUnauthorizedRequest($request)
{
if ($request->ajax() || $request->wantsJson()) {
return response(trans('backpack::base.unauthorized'), 401);
} else {
return redirect()->guest(backpack_url('login'));
}
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
*
* @return mixed
*/
public function handle($request, Closure $next)
{
if (backpack_auth()->guest()) {
return $this->respondToUnauthorizedRequest($request);
}
if (!$this->checkIfUserIsAdmin(backpack_user())) {
return $this->respondToUnauthorizedRequest($request);
}
return $next($request);
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/home');
}
return $next($request);
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array
*/
protected $except = [
'password',
'password_confirmation',
];
}

View File

@ -0,0 +1,23 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
}

View File

@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
//
];
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
use Illuminate\Foundation\Http\FormRequest;
class CategoryRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
// only allow updates if the user is logged in
return backpack_auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|min:3|max:255'
];
}
/**
* Get the validation attributes that apply to the request.
*
* @return array
*/
public function attributes()
{
return [
//
];
}
/**
* Get the validation messages that apply to the request.
*
* @return array
*/
public function messages()
{
return [
//
];
}
}

View File

@ -0,0 +1,57 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
use Illuminate\Foundation\Http\FormRequest;
class MaterialRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
// only allow updates if the user is logged in
return backpack_auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'title' => 'required|min:5|max:255',
'category_id' => 'required|integer'
];
}
/**
* Get the validation attributes that apply to the request.
*
* @return array
*/
public function attributes()
{
return [
//
];
}
/**
* Get the validation messages that apply to the request.
*
* @return array
*/
public function messages()
{
return [
//
];
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
use Illuminate\Foundation\Http\FormRequest;
class OrderRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
// only allow updates if the user is logged in
return backpack_auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
// 'name' => 'required|min:5|max:255'
];
}
/**
* Get the validation attributes that apply to the request.
*
* @return array
*/
public function attributes()
{
return [
//
];
}
/**
* Get the validation messages that apply to the request.
*
* @return array
*/
public function messages()
{
return [
//
];
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ProfileRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return auth()->check();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name' => 'required|max:255',
'email' => 'required|email|unique:users,email,'.auth()->id(),
'phone' => 'required|digits_between:6,9|numeric'
];
}
}

View File

@ -0,0 +1,36 @@
<?php
namespace App\Models;
use App\User;
use Backpack\Base\app\Models\Traits\InheritsRelationsFromParentModel;
use Backpack\Base\app\Notifications\ResetPasswordNotification as ResetPasswordNotification;
class BackpackUser extends User
{
use InheritsRelationsFromParentModel;
protected $table = 'users';
/**
* Send the password reset notification.
*
* @param string $token
*
* @return void
*/
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
/**
* Get the e-mail address where password reset links are sent.
*
* @return string
*/
public function getEmailForPasswordReset()
{
return $this->email;
}
}

58
app/Models/Category.php Normal file
View File

@ -0,0 +1,58 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Backpack\CRUD\CrudTrait;
class Category extends Model
{
use CrudTrait;
/*
|--------------------------------------------------------------------------
| GLOBAL VARIABLES
|--------------------------------------------------------------------------
*/
protected $table = 'categories';
// protected $primaryKey = 'id';
// public $timestamps = false;
// protected $guarded = ['id'];
protected $fillable = ['name','parent_id','lft','rgt','depth'];
// protected $hidden = [];
// protected $dates = [];
/*
|--------------------------------------------------------------------------
| FUNCTIONS
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| RELATIONS
|--------------------------------------------------------------------------
*/
public function materials(){
return $this->hasMany(Material::class);
}
/*
|--------------------------------------------------------------------------
| SCOPES
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| ACCESORS
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| MUTATORS
|--------------------------------------------------------------------------
*/
}

104
app/Models/Material.php Normal file
View File

@ -0,0 +1,104 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Backpack\CRUD\CrudTrait;
use Illuminate\Support\Str;
//use Illuminate\Support\Facades\Storage;
class Material extends Model
{
use CrudTrait;
/*
|--------------------------------------------------------------------------
| GLOBAL VARIABLES
|--------------------------------------------------------------------------
*/
protected $table = 'materials';
// protected $primaryKey = 'id';
// public $timestamps = false;
// protected $guarded = ['id'];
protected $fillable = ['title','desc','view','rating','price','size',
'duration','details','trailer_url','content_url','category_id','banner_url'];
protected $fakeColumns = ['details'];
// protected $hidden = [];
// protected $dates = [];
/*
|--------------------------------------------------------------------------
| FUNCTIONS
|--------------------------------------------------------------------------
*/
public static function boot()
{
parent::boot();
static::deleting(function($obj) {
\Storage::disk('uploads')->delete($obj->banner_url);
});
}
/*
|--------------------------------------------------------------------------
| RELATIONS
|--------------------------------------------------------------------------
*/
public function category(){
return $this->belongsTo(Category::class);
}
public function orders(){
return $this->belongsTo(Order::class);
}
/*
|--------------------------------------------------------------------------
| SCOPES
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| ACCESORS
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| MUTATORS
|--------------------------------------------------------------------------
*/
public function setBannerUrlAttribute($value)
{
$attribute_name = "banner_url";
$disk = 'uploads'; // or use your own disk, defined in config/filesystems.php
$destination_path = "images"; // path relative to the disk above
// if the image was erased
if ($value==null) {
// delete the image from disk
\Storage::disk($disk)->delete($this->{$attribute_name});
// set null in the database column
$this->attributes[$attribute_name] = null;
}
// if a base64 was sent, store it in the db
if (starts_with($value, 'data:image'))
{
// 0. Make the image
$image = \Image::make($value)->encode('jpg', 90);
// 1. Generate a filename.
$filename = md5($value.time()).'.jpg';
// 2. Store the image on disk.
\Storage::disk($disk)->put($destination_path.'/'.$filename, $image->stream());
// 3. Save the public path to the database
// but first, remove "public/" from the path, since we're pointing to it from the root folder
// that way, what gets saved in the database is the user-accesible URL
$public_destination_path = Str::replaceFirst('public/', '', $destination_path);
$this->attributes[$attribute_name] = $public_destination_path.'/'.$filename;
}
}
}

57
app/Models/Order.php Normal file
View File

@ -0,0 +1,57 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Backpack\CRUD\CrudTrait;
class Order extends Model
{
use CrudTrait;
/*
|--------------------------------------------------------------------------
| GLOBAL VARIABLES
|--------------------------------------------------------------------------
*/
protected $table = 'orders';
// protected $primaryKey = 'id';
// public $timestamps = false;
// protected $guarded = ['id'];
protected $fillable = ['title','material_id','user_id','price','registered','payed','last_date','downloaded','download_count'];
// protected $hidden = [];
// protected $dates = [];
/*
|--------------------------------------------------------------------------
| FUNCTIONS
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| RELATIONS
|--------------------------------------------------------------------------
*/
public function material(){
return $this->hasOne(Material::class,'id','material_id');
}
/*
|--------------------------------------------------------------------------
| SCOPES
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| ACCESORS
|--------------------------------------------------------------------------
*/
/*
|--------------------------------------------------------------------------
| MUTATORS
|--------------------------------------------------------------------------
*/
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Providers;
use App\Models\Category;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
View::composer('layouts.left_menu', function ($view) {
$cats = Category::where('depth',1)
->orderBy('lft')
->get();
$view->with('mainCategories',$cats);
});
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
// 'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
//
}
}

View File

@ -0,0 +1,21 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View File

@ -0,0 +1,34 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}
}

View File

@ -0,0 +1,73 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}

View File

@ -0,0 +1,33 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class ViewServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
View::composer('left_menu', function ($view) {
$cats = Category::where('depth',1)
->orderBy('lft')
->get();
$view->with('mainCategories',$cats);
});
}
}

39
app/User.php Normal file
View File

@ -0,0 +1,39 @@
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password', 'phone','username'
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}

53
artisan Normal file
View File

@ -0,0 +1,53 @@
#!/usr/bin/env php
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);

55
bootstrap/app.php Normal file
View File

@ -0,0 +1,55 @@
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;

2
bootstrap/cache/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

69
composer.json Normal file
View File

@ -0,0 +1,69 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"backpack/crud": "^3.6",
"barryvdh/laravel-elfinder": "^0.4.2",
"davejamesmiller/laravel-breadcrumbs": "^5.2",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"moontoast/math": "^1.1"
},
"require-dev": {
"backpack/generators": "^1.2",
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"laracasts/generators": "dev-master",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}

5933
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

233
config/app.php Normal file
View File

@ -0,0 +1,233 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Laravel'),
'gateway_url' => env('GATEWAY_URL'),
'gateway_user' => env('GATEWAY_USER'),
'gateway_password' => env('GATEWAY_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
];

103
config/auth.php Normal file
View File

@ -0,0 +1,103 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
],
],
];

153
config/backpack/base.php Normal file
View File

@ -0,0 +1,153 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Look & feel customizations
|--------------------------------------------------------------------------
|
| Make it yours.
|
*/
// Project name. Shown in the breadcrumbs and a few other places.
'project_name' => 'Video Portal',
// Menu logos
'logo_lg' => '<b>Video</b>Portal',
'logo_mini' => '<b>V</b>p',
// Developer or company name. Shown in footer.
'developer_name' => 'Digital TPS',
// Developer website. Link in footer.
'developer_link' => 'http://tpsadvertising.com',
// Show powered by Laravel Backpack in the footer?
'show_powered_by' => false,
// The AdminLTE skin. Affects menu color and primary/secondary colors used throughout the application.
'skin' => 'skin-green',
// Options: skin-black, skin-blue, skin-purple, skin-red, skin-yellow, skin-green, skin-blue-light, skin-black-light, skin-purple-light, skin-green-light, skin-red-light, skin-yellow-light
// Date & Datetime Format Syntax: https://carbon.nesbot.com/docs/#api-localization
'default_date_format' => 'D MMM YYYY',
'default_datetime_format' => 'D MMM YYYY, HH:mm',
// Content of the HTML meta robots tag to prevent indexing and link following
'meta_robots_content' => 'noindex, nofollow',
// Overlays - CSS files that change the look and feel of the admin panel
'overlays' => [
'vendor/backpack/base/backpack.bold.css',
'vendor/backpack/base/backpack.content.is.king.css',
],
/*
|--------------------------------------------------------------------------
| Registration Open
|--------------------------------------------------------------------------
|
| Choose whether new users/admins are allowed to register.
| This will show up the Register button in the menu and allow access to the
| Register functions in AuthController.
|
| By default the registration is open only on localhost.
*/
'registration_open' => env('BACKPACK_REGISTRATION_OPEN', env('APP_ENV') === 'local'),
/*
|--------------------------------------------------------------------------
| Routing
|--------------------------------------------------------------------------
*/
// The prefix used in all base routes (the 'admin' in admin/dashboard)
// You can make sure all your URLs use this prefix by using the backpack_url() helper instead of url()
'route_prefix' => 'panel',
// Set this to false if you would like to use your own AuthController and PasswordController
// (you then need to setup your auth routes manually in your routes.php file)
'setup_auth_routes' => true,
// Set this to false if you would like to skip adding the dashboard routes
// (you then need to overwrite the login route on your AuthController)
'setup_dashboard_routes' => true,
// Set this to false if you would like to skip adding "my account" routes
// (you then need to manually define the routes in your web.php)
'setup_my_account_routes' => true,
/*
|--------------------------------------------------------------------------
| Authentication
|--------------------------------------------------------------------------
*/
// Fully qualified namespace of the User model
'user_model_fqn' => App\Models\BackpackUser::class,
// The classes for the middleware to check if the visitor is an admin
// Can be a single class or an array of clases
'middleware_class' => [
App\Http\Middleware\CheckIfAdmin::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
// \Backpack\Base\app\Http\Middleware\UseBackpackAuthGuardInsteadOfDefaultAuthGuard::class,
],
// Alias for that middleware
'middleware_key' => 'admin',
// Note: It's recommended to use the backpack_middleware() helper everywhere, which pulls this key for you.
// Username column for authentication
// The Backpack default is the same as the Laravel default (email)
// If you need to switch to username, you also need to create that column in your db
'authentication_column' => 'username',
'authentication_column_name' => 'Username',
// The guard that protects the Backpack admin panel.
// If null, the config.auth.defaults.guard value will be used.
'guard' => 'backpack',
// The password reset configuration for Backpack.
// If null, the config.auth.defaults.passwords value will be used.
'passwords' => 'backpack',
// What kind of avatar will you like to show to the user?
// Default: gravatar (automatically use the gravatar for his email)
// Other options:
// - placehold (generic image with his first letter)
// - example_method_name (specify the method on the User model that returns the URL)
'avatar_type' => 'placehold',
/*
|--------------------------------------------------------------------------
| File System
|--------------------------------------------------------------------------
*/
// Backpack\Base sets up its own filesystem disk, just like you would by
// adding an entry to your config/filesystems.php. It points to the root
// of your project and it's used throughout all Backpack packages.
//
// You can rename this disk here. Default: root
'root_disk_name' => 'root',
/*
|--------------------------------------------------------------------------
| License Code
|--------------------------------------------------------------------------
|
| If you, your employer or your client make money by using Backpack, you need
| to purchase a license. A license code will be provided after purchase,
| which you can put here or in your ENV file in staging & production.
|
| More info and payment form on:
| https://www.backpackforlaravel.com
|
*/
'license_code' => env('BACKPACK_LICENSE', false),
];

546
config/backpack/crud.php Normal file
View File

@ -0,0 +1,546 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Backpack\CRUD preferences
|--------------------------------------------------------------------------
*/
/*
|------------
| CREATE & UPDATE
|------------
*/
// Where do you want to redirect the user by default, after a CRUD entry is saved in the Add or Edit forms?
'default_save_action' => 'save_and_back', //options: save_and_back, save_and_edit, save_and_new
// When the user chooses "save and back" or "save and new", show a bubble
// for the fact that the default save action has been changed?
'show_save_action_change' => true, //options: true, false
// When using tabbed forms (create & update), what kind of tabs would you like?
'tabs_type' => 'horizontal', //options: horizontal, vertical
// How would you like the validation errors to be shown?
'show_grouped_errors' => true,
'show_inline_errors' => true,
// Here you may override the css-classes for the content section of the create view globally
// To override per view use $this->crud->setCreateContentClass('class-string')
'create_content_class' => 'col-md-8 col-md-offset-2',
// Here you may override the css-classes for the content section of the edit view globally
// To override per view use $this->crud->setEditContentClass('class-string')
'edit_content_class' => 'col-md-8 col-md-offset-2',
// Here you may override the css-classes for the content section of the revisions timeline view globally
// To override per view use $this->crud->setRevisionsTimelineContentClass('class-string')
'revisions_timeline_content_class' => 'col-md-10 col-md-offset-1',
/*
|------------
| READ
|------------
*/
// LIST VIEW (table view)
// enable the datatables-responsive plugin, which hides columns if they don't fit?
// if not, a horizontal scrollbar will be shown instead
'responsive_table' => true,
// stores pagination and filters in localStorage for two hours
// whenever the user tries to see that page, backpack loads the previous pagination and filtration
'persistent_table' => false,
// How many items should be shown by default by the Datatable?
// This value can be overwritten on a specific CRUD by calling
// $this->crud->setDefaultPageLength(50);
'default_page_length' => 25,
// A 1D array of options which will be used for both the displayed option and the value, or
// A 2D array in which the first array is used to define the value options and the second array the displayed options
// If a 2D array is used, strings in the right hand array will be automatically run through trans()
'page_length_menu' => [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'backpack::crud.all']],
// Here you may override the css-class for the content section of the list view globally
// To override per view use $this->crud->setListContentClass('class-string')
'list_content_class' => 'col-md-12',
// SHOW (PREVIEW)
// Here you may override the css-classes for the content section of the show view globally
// To override per view use $this->crud->setShowContentClass('class-string')
'show_content_class' => 'col-md-8 col-md-offset-2',
/*
|------------
| DELETE
|------------
*/
/*
|------------
| REORDER
|------------
*/
// Here you may override the css-classes for the content section of the reorder view globally
// To override per view use $this->crud->setReorderContentClass('class-string')
'reorder_content_class' => 'col-md-8 col-md-offset-2',
/*
|------------
| DETAILS ROW
|------------
*/
/*
|-------------------
| TRANSLATABLE CRUDS
|-------------------
*/
'show_translatable_field_icon' => true,
'translatable_field_icon_position' => 'right', // left or right
'locales' => [
// "af_NA" => "Afrikaans (Namibia)",
// "af_ZA" => "Afrikaans (South Africa)",
// "af" => "Afrikaans",
// "ak_GH" => "Akan (Ghana)",
// "ak" => "Akan",
// "sq_AL" => "Albanian (Albania)",
// "sq" => "Albanian",
// "am_ET" => "Amharic (Ethiopia)",
// "am" => "Amharic",
// "ar_DZ" => "Arabic (Algeria)",
// "ar_BH" => "Arabic (Bahrain)",
// "ar_EG" => "Arabic (Egypt)",
// "ar_IQ" => "Arabic (Iraq)",
// "ar_JO" => "Arabic (Jordan)",
// "ar_KW" => "Arabic (Kuwait)",
// "ar_LB" => "Arabic (Lebanon)",
// "ar_LY" => "Arabic (Libya)",
// "ar_MA" => "Arabic (Morocco)",
// "ar_OM" => "Arabic (Oman)",
// "ar_QA" => "Arabic (Qatar)",
// "ar_SA" => "Arabic (Saudi Arabia)",
// "ar_SD" => "Arabic (Sudan)",
// "ar_SY" => "Arabic (Syria)",
// "ar_TN" => "Arabic (Tunisia)",
// "ar_AE" => "Arabic (United Arab Emirates)",
// "ar_YE" => "Arabic (Yemen)",
// "ar" => "Arabic",
// "hy_AM" => "Armenian (Armenia)",
// "hy" => "Armenian",
// "as_IN" => "Assamese (India)",
// "as" => "Assamese",
// "asa_TZ" => "Asu (Tanzania)",
// "asa" => "Asu",
// "az_Cyrl" => "Azerbaijani (Cyrillic)",
// "az_Cyrl_AZ" => "Azerbaijani (Cyrillic, Azerbaijan)",
// "az_Latn" => "Azerbaijani (Latin)",
// "az_Latn_AZ" => "Azerbaijani (Latin, Azerbaijan)",
// "az" => "Azerbaijani",
// "bm_ML" => "Bambara (Mali)",
// "bm" => "Bambara",
// "eu_ES" => "Basque (Spain)",
// "eu" => "Basque",
// "be_BY" => "Belarusian (Belarus)",
// "be" => "Belarusian",
// "bem_ZM" => "Bemba (Zambia)",
// "bem" => "Bemba",
// "bez_TZ" => "Bena (Tanzania)",
// "bez" => "Bena",
// "bn_BD" => "Bengali (Bangladesh)",
// "bn_IN" => "Bengali (India)",
// "bn" => "Bengali",
// "bs_BA" => "Bosnian (Bosnia and Herzegovina)",
// "bs" => "Bosnian",
// "bg_BG" => "Bulgarian (Bulgaria)",
// "bg" => "Bulgarian",
// "my_MM" => "Burmese (Myanmar [Burma])",
// "my" => "Burmese",
// "ca_ES" => "Catalan (Spain)",
// "ca" => "Catalan",
// "tzm_Latn" => "Central Morocco Tamazight (Latin)",
// "tzm_Latn_MA" => "Central Morocco Tamazight (Latin, Morocco)",
// "tzm" => "Central Morocco Tamazight",
// "chr_US" => "Cherokee (United States)",
// "chr" => "Cherokee",
// "cgg_UG" => "Chiga (Uganda)",
// "cgg" => "Chiga",
// "zh_Hans" => "Chinese (Simplified Han)",
// "zh_Hans_CN" => "Chinese (Simplified Han, China)",
// "zh_Hans_HK" => "Chinese (Simplified Han, Hong Kong SAR China)",
// "zh_Hans_MO" => "Chinese (Simplified Han, Macau SAR China)",
// "zh_Hans_SG" => "Chinese (Simplified Han, Singapore)",
// "zh_Hant" => "Chinese (Traditional Han)",
// "zh_Hant_HK" => "Chinese (Traditional Han, Hong Kong SAR China)",
// "zh_Hant_MO" => "Chinese (Traditional Han, Macau SAR China)",
// "zh_Hant_TW" => "Chinese (Traditional Han, Taiwan)",
// "zh" => "Chinese",
// "kw_GB" => "Cornish (United Kingdom)",
// "kw" => "Cornish",
// "hr_HR" => "Croatian (Croatia)",
// "hr" => "Croatian",
// "cs_CZ" => "Czech (Czech Republic)",
// "cs" => "Czech",
// "da_DK" => "Danish (Denmark)",
// "da" => "Danish",
// "nl_BE" => "Dutch (Belgium)",
// "nl_NL" => "Dutch (Netherlands)",
// "nl" => "Dutch",
// "ebu_KE" => "Embu (Kenya)",
// "ebu" => "Embu",
// "en_AS" => "English (American Samoa)",
// "en_AU" => "English (Australia)",
// "en_BE" => "English (Belgium)",
// "en_BZ" => "English (Belize)",
// "en_BW" => "English (Botswana)",
// "en_CA" => "English (Canada)",
// "en_GU" => "English (Guam)",
// "en_HK" => "English (Hong Kong SAR China)",
// "en_IN" => "English (India)",
// "en_IE" => "English (Ireland)",
// "en_JM" => "English (Jamaica)",
// "en_MT" => "English (Malta)",
// "en_MH" => "English (Marshall Islands)",
// "en_MU" => "English (Mauritius)",
// "en_NA" => "English (Namibia)",
// "en_NZ" => "English (New Zealand)",
// "en_MP" => "English (Northern Mariana Islands)",
// "en_PK" => "English (Pakistan)",
// "en_PH" => "English (Philippines)",
// "en_SG" => "English (Singapore)",
// "en_ZA" => "English (South Africa)",
// "en_TT" => "English (Trinidad and Tobago)",
// "en_UM" => "English (U.S. Minor Outlying Islands)",
// "en_VI" => "English (U.S. Virgin Islands)",
// "en_GB" => "English (United Kingdom)",
// "en_US" => "English (United States)",
// "en_ZW" => "English (Zimbabwe)",
'en' => 'English',
// "eo" => "Esperanto",
// "et_EE" => "Estonian (Estonia)",
// "et" => "Estonian",
// "ee_GH" => "Ewe (Ghana)",
// "ee_TG" => "Ewe (Togo)",
// "ee" => "Ewe",
// "fo_FO" => "Faroese (Faroe Islands)",
// "fo" => "Faroese",
// "fil_PH" => "Filipino (Philippines)",
// "fil" => "Filipino",
// "fi_FI" => "Finnish (Finland)",
// "fi" => "Finnish",
// "fr_BE" => "French (Belgium)",
// "fr_BJ" => "French (Benin)",
// "fr_BF" => "French (Burkina Faso)",
// "fr_BI" => "French (Burundi)",
// "fr_CM" => "French (Cameroon)",
// "fr_CA" => "French (Canada)",
// "fr_CF" => "French (Central African Republic)",
// "fr_TD" => "French (Chad)",
// "fr_KM" => "French (Comoros)",
// "fr_CG" => "French (Congo - Brazzaville)",
// "fr_CD" => "French (Congo - Kinshasa)",
// "fr_CI" => "French (Côte dIvoire)",
// "fr_DJ" => "French (Djibouti)",
// "fr_GQ" => "French (Equatorial Guinea)",
// "fr_FR" => "French (France)",
// "fr_GA" => "French (Gabon)",
// "fr_GP" => "French (Guadeloupe)",
// "fr_GN" => "French (Guinea)",
// "fr_LU" => "French (Luxembourg)",
// "fr_MG" => "French (Madagascar)",
// "fr_ML" => "French (Mali)",
// "fr_MQ" => "French (Martinique)",
// "fr_MC" => "French (Monaco)",
// "fr_NE" => "French (Niger)",
// "fr_RW" => "French (Rwanda)",
// "fr_RE" => "French (Réunion)",
// "fr_BL" => "French (Saint Barthélemy)",
// "fr_MF" => "French (Saint Martin)",
// "fr_SN" => "French (Senegal)",
// "fr_CH" => "French (Switzerland)",
// "fr_TG" => "French (Togo)",
'fr' => 'French',
// "ff_SN" => "Fulah (Senegal)",
// "ff" => "Fulah",
// "gl_ES" => "Galician (Spain)",
// "gl" => "Galician",
// "lg_UG" => "Ganda (Uganda)",
// "lg" => "Ganda",
// "ka_GE" => "Georgian (Georgia)",
// "ka" => "Georgian",
// "de_AT" => "German (Austria)",
// "de_BE" => "German (Belgium)",
// "de_DE" => "German (Germany)",
// "de_LI" => "German (Liechtenstein)",
// "de_LU" => "German (Luxembourg)",
// "de_CH" => "German (Switzerland)",
// "de" => "German",
// "el_CY" => "Greek (Cyprus)",
// "el_GR" => "Greek (Greece)",
// "el" => "Greek",
// "gu_IN" => "Gujarati (India)",
// "gu" => "Gujarati",
// "guz_KE" => "Gusii (Kenya)",
// "guz" => "Gusii",
// "ha_Latn" => "Hausa (Latin)",
// "ha_Latn_GH" => "Hausa (Latin, Ghana)",
// "ha_Latn_NE" => "Hausa (Latin, Niger)",
// "ha_Latn_NG" => "Hausa (Latin, Nigeria)",
// "ha" => "Hausa",
// "haw_US" => "Hawaiian (United States)",
// "haw" => "Hawaiian",
// "he_IL" => "Hebrew (Israel)",
// "he" => "Hebrew",
// "hi_IN" => "Hindi (India)",
// "hi" => "Hindi",
// "hu_HU" => "Hungarian (Hungary)",
// "hu" => "Hungarian",
// "is_IS" => "Icelandic (Iceland)",
// "is" => "Icelandic",
// "ig_NG" => "Igbo (Nigeria)",
// "ig" => "Igbo",
// "id_ID" => "Indonesian (Indonesia)",
// "id" => "Indonesian",
// "ga_IE" => "Irish (Ireland)",
// "ga" => "Irish",
// "it_IT" => "Italian (Italy)",
// "it_CH" => "Italian (Switzerland)",
'it' => 'Italian',
// "ja_JP" => "Japanese (Japan)",
// "ja" => "Japanese",
// "kea_CV" => "Kabuverdianu (Cape Verde)",
// "kea" => "Kabuverdianu",
// "kab_DZ" => "Kabyle (Algeria)",
// "kab" => "Kabyle",
// "kl_GL" => "Kalaallisut (Greenland)",
// "kl" => "Kalaallisut",
// "kln_KE" => "Kalenjin (Kenya)",
// "kln" => "Kalenjin",
// "kam_KE" => "Kamba (Kenya)",
// "kam" => "Kamba",
// "kn_IN" => "Kannada (India)",
// "kn" => "Kannada",
// "kk_Cyrl" => "Kazakh (Cyrillic)",
// "kk_Cyrl_KZ" => "Kazakh (Cyrillic, Kazakhstan)",
// "kk" => "Kazakh",
// "km_KH" => "Khmer (Cambodia)",
// "km" => "Khmer",
// "ki_KE" => "Kikuyu (Kenya)",
// "ki" => "Kikuyu",
// "rw_RW" => "Kinyarwanda (Rwanda)",
// "rw" => "Kinyarwanda",
// "kok_IN" => "Konkani (India)",
// "kok" => "Konkani",
// "ko_KR" => "Korean (South Korea)",
// "ko" => "Korean",
// "khq_ML" => "Koyra Chiini (Mali)",
// "khq" => "Koyra Chiini",
// "ses_ML" => "Koyraboro Senni (Mali)",
// "ses" => "Koyraboro Senni",
// "lag_TZ" => "Langi (Tanzania)",
// "lag" => "Langi",
// "lv_LV" => "Latvian (Latvia)",
// "lv" => "Latvian",
// "lt_LT" => "Lithuanian (Lithuania)",
// "lt" => "Lithuanian",
// "luo_KE" => "Luo (Kenya)",
// "luo" => "Luo",
// "luy_KE" => "Luyia (Kenya)",
// "luy" => "Luyia",
// "mk_MK" => "Macedonian (Macedonia)",
// "mk" => "Macedonian",
// "jmc_TZ" => "Machame (Tanzania)",
// "jmc" => "Machame",
// "kde_TZ" => "Makonde (Tanzania)",
// "kde" => "Makonde",
// "mg_MG" => "Malagasy (Madagascar)",
// "mg" => "Malagasy",
// "ms_BN" => "Malay (Brunei)",
// "ms_MY" => "Malay (Malaysia)",
// "ms" => "Malay",
// "ml_IN" => "Malayalam (India)",
// "ml" => "Malayalam",
// "mt_MT" => "Maltese (Malta)",
// "mt" => "Maltese",
// "gv_GB" => "Manx (United Kingdom)",
// "gv" => "Manx",
// "mr_IN" => "Marathi (India)",
// "mr" => "Marathi",
// "mas_KE" => "Masai (Kenya)",
// "mas_TZ" => "Masai (Tanzania)",
// "mas" => "Masai",
// "mer_KE" => "Meru (Kenya)",
// "mer" => "Meru",
// "mfe_MU" => "Morisyen (Mauritius)",
// "mfe" => "Morisyen",
// "naq_NA" => "Nama (Namibia)",
// "naq" => "Nama",
// "ne_IN" => "Nepali (India)",
// "ne_NP" => "Nepali (Nepal)",
// "ne" => "Nepali",
// "nd_ZW" => "North Ndebele (Zimbabwe)",
// "nd" => "North Ndebele",
// "nb_NO" => "Norwegian Bokmål (Norway)",
// "nb" => "Norwegian Bokmål",
// "nn_NO" => "Norwegian Nynorsk (Norway)",
// "nn" => "Norwegian Nynorsk",
// "nyn_UG" => "Nyankole (Uganda)",
// "nyn" => "Nyankole",
// "or_IN" => "Oriya (India)",
// "or" => "Oriya",
// "om_ET" => "Oromo (Ethiopia)",
// "om_KE" => "Oromo (Kenya)",
// "om" => "Oromo",
// "ps_AF" => "Pashto (Afghanistan)",
// "ps" => "Pashto",
// "fa_AF" => "Persian (Afghanistan)",
// "fa_IR" => "Persian (Iran)",
// "fa" => "Persian",
// "pl_PL" => "Polish (Poland)",
// "pl" => "Polish",
// "pt_BR" => "Portuguese (Brazil)",
// "pt_GW" => "Portuguese (Guinea-Bissau)",
// "pt_MZ" => "Portuguese (Mozambique)",
// "pt_PT" => "Portuguese (Portugal)",
// "pt" => "Portuguese",
// "pa_Arab" => "Punjabi (Arabic)",
// "pa_Arab_PK" => "Punjabi (Arabic, Pakistan)",
// "pa_Guru" => "Punjabi (Gurmukhi)",
// "pa_Guru_IN" => "Punjabi (Gurmukhi, India)",
// "pa" => "Punjabi",
// "ro_MD" => "Romanian (Moldova)",
// "ro_RO" => "Romanian (Romania)",
'ro' => 'Romanian',
// "rm_CH" => "Romansh (Switzerland)",
// "rm" => "Romansh",
// "rof_TZ" => "Rombo (Tanzania)",
// "rof" => "Rombo",
// "ru_MD" => "Russian (Moldova)",
// "ru_RU" => "Russian (Russia)",
// "ru_UA" => "Russian (Ukraine)",
// "ru" => "Russian",
// "rwk_TZ" => "Rwa (Tanzania)",
// "rwk" => "Rwa",
// "saq_KE" => "Samburu (Kenya)",
// "saq" => "Samburu",
// "sg_CF" => "Sango (Central African Republic)",
// "sg" => "Sango",
// "seh_MZ" => "Sena (Mozambique)",
// "seh" => "Sena",
// "sr_Cyrl" => "Serbian (Cyrillic)",
// "sr_Cyrl_BA" => "Serbian (Cyrillic, Bosnia and Herzegovina)",
// "sr_Cyrl_ME" => "Serbian (Cyrillic, Montenegro)",
// "sr_Cyrl_RS" => "Serbian (Cyrillic, Serbia)",
// "sr_Latn" => "Serbian (Latin)",
// "sr_Latn_BA" => "Serbian (Latin, Bosnia and Herzegovina)",
// "sr_Latn_ME" => "Serbian (Latin, Montenegro)",
// "sr_Latn_RS" => "Serbian (Latin, Serbia)",
// "sr" => "Serbian",
// "sn_ZW" => "Shona (Zimbabwe)",
// "sn" => "Shona",
// "ii_CN" => "Sichuan Yi (China)",
// "ii" => "Sichuan Yi",
// "si_LK" => "Sinhala (Sri Lanka)",
// "si" => "Sinhala",
// "sk_SK" => "Slovak (Slovakia)",
// "sk" => "Slovak",
// "sl_SI" => "Slovenian (Slovenia)",
// "sl" => "Slovenian",
// "xog_UG" => "Soga (Uganda)",
// "xog" => "Soga",
// "so_DJ" => "Somali (Djibouti)",
// "so_ET" => "Somali (Ethiopia)",
// "so_KE" => "Somali (Kenya)",
// "so_SO" => "Somali (Somalia)",
// "so" => "Somali",
// "es_AR" => "Spanish (Argentina)",
// "es_BO" => "Spanish (Bolivia)",
// "es_CL" => "Spanish (Chile)",
// "es_CO" => "Spanish (Colombia)",
// "es_CR" => "Spanish (Costa Rica)",
// "es_DO" => "Spanish (Dominican Republic)",
// "es_EC" => "Spanish (Ecuador)",
// "es_SV" => "Spanish (El Salvador)",
// "es_GQ" => "Spanish (Equatorial Guinea)",
// "es_GT" => "Spanish (Guatemala)",
// "es_HN" => "Spanish (Honduras)",
// "es_419" => "Spanish (Latin America)",
// "es_MX" => "Spanish (Mexico)",
// "es_NI" => "Spanish (Nicaragua)",
// "es_PA" => "Spanish (Panama)",
// "es_PY" => "Spanish (Paraguay)",
// "es_PE" => "Spanish (Peru)",
// "es_PR" => "Spanish (Puerto Rico)",
// "es_ES" => "Spanish (Spain)",
// "es_US" => "Spanish (United States)",
// "es_UY" => "Spanish (Uruguay)",
// "es_VE" => "Spanish (Venezuela)",
// "es" => "Spanish",
// "sw_KE" => "Swahili (Kenya)",
// "sw_TZ" => "Swahili (Tanzania)",
// "sw" => "Swahili",
// "sv_FI" => "Swedish (Finland)",
// "sv_SE" => "Swedish (Sweden)",
// "sv" => "Swedish",
// "gsw_CH" => "Swiss German (Switzerland)",
// "gsw" => "Swiss German",
// "shi_Latn" => "Tachelhit (Latin)",
// "shi_Latn_MA" => "Tachelhit (Latin, Morocco)",
// "shi_Tfng" => "Tachelhit (Tifinagh)",
// "shi_Tfng_MA" => "Tachelhit (Tifinagh, Morocco)",
// "shi" => "Tachelhit",
// "dav_KE" => "Taita (Kenya)",
// "dav" => "Taita",
// "ta_IN" => "Tamil (India)",
// "ta_LK" => "Tamil (Sri Lanka)",
// "ta" => "Tamil",
// "te_IN" => "Telugu (India)",
// "te" => "Telugu",
// "teo_KE" => "Teso (Kenya)",
// "teo_UG" => "Teso (Uganda)",
// "teo" => "Teso",
// "th_TH" => "Thai (Thailand)",
// "th" => "Thai",
// "bo_CN" => "Tibetan (China)",
// "bo_IN" => "Tibetan (India)",
// "bo" => "Tibetan",
// "ti_ER" => "Tigrinya (Eritrea)",
// "ti_ET" => "Tigrinya (Ethiopia)",
// "ti" => "Tigrinya",
// "to_TO" => "Tonga (Tonga)",
// "to" => "Tonga",
// "tr_TR" => "Turkish (Turkey)",
// "tr" => "Turkish",
// "uk_UA" => "Ukrainian (Ukraine)",
// "uk" => "Ukrainian",
// "ur_IN" => "Urdu (India)",
// "ur_PK" => "Urdu (Pakistan)",
// "ur" => "Urdu",
// "uz_Arab" => "Uzbek (Arabic)",
// "uz_Arab_AF" => "Uzbek (Arabic, Afghanistan)",
// "uz_Cyrl" => "Uzbek (Cyrillic)",
// "uz_Cyrl_UZ" => "Uzbek (Cyrillic, Uzbekistan)",
// "uz_Latn" => "Uzbek (Latin)",
// "uz_Latn_UZ" => "Uzbek (Latin, Uzbekistan)",
// "uz" => "Uzbek",
// "vi_VN" => "Vietnamese (Vietnam)",
// "vi" => "Vietnamese",
// "vun_TZ" => "Vunjo (Tanzania)",
// "vun" => "Vunjo",
// "cy_GB" => "Welsh (United Kingdom)",
// "cy" => "Welsh",
// "yo_NG" => "Yoruba (Nigeria)",
// "yo" => "Yoruba",
// "zu_ZA" => "Zulu (South Africa)",
// "zu" => "Zulu"
],
];

75
config/breadcrumbs.php Normal file
View File

@ -0,0 +1,75 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Name
|--------------------------------------------------------------------------
|
| Choose a view to display when Breadcrumbs::render() is called.
| Built in templates are:
|
| - 'breadcrumbs::bootstrap4' - Bootstrap 4
| - 'breadcrumbs::bootstrap3' - Bootstrap 3
| - 'breadcrumbs::bootstrap2' - Bootstrap 2
| - 'breadcrumbs::bulma' - Bulma
| - 'breadcrumbs::foundation6' - Foundation 6
| - 'breadcrumbs::materialize' - Materialize
| - 'breadcrumbs::uikit' - UIkit
| - 'breadcrumbs::json-ld' - JSON-LD Structured Data
|
| Or a custom view, e.g. '_partials/breadcrumbs'.
|
*/
'view' => 'partials.breadcrumbs',
/*
|--------------------------------------------------------------------------
| Breadcrumbs File(s)
|--------------------------------------------------------------------------
|
| The file(s) where breadcrumbs are defined. e.g.
|
| - base_path('routes/breadcrumbs.php')
| - glob(base_path('breadcrumbs/*.php'))
|
*/
'files' => base_path('routes/breadcrumbs.php'),
/*
|--------------------------------------------------------------------------
| Exceptions
|--------------------------------------------------------------------------
|
| Determine when to throw an exception.
|
*/
// When route-bound breadcrumbs are used but the current route doesn't have a name (UnnamedRouteException)
'unnamed-route-exception' => true,
// When route-bound breadcrumbs are used and the matching breadcrumb doesn't exist (InvalidBreadcrumbException)
'missing-route-bound-breadcrumb-exception' => true,
// When a named breadcrumb is used but doesn't exist (InvalidBreadcrumbException)
'invalid-named-breadcrumb-exception' => true,
/*
|--------------------------------------------------------------------------
| Classes
|--------------------------------------------------------------------------
|
| Subclass the default classes for more advanced customisations.
|
*/
// Manager
'manager-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsManager::class,
// Generator
'generator-class' => DaveJamesMiller\Breadcrumbs\BreadcrumbsGenerator::class,
];

59
config/broadcasting.php Normal file
View File

@ -0,0 +1,59 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'encrypted' => true,
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];

102
config/cache.php Normal file
View File

@ -0,0 +1,102 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb"
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
];

141
config/database.php Normal file
View File

@ -0,0 +1,141 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => 'InnoDB',
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'predis'),
'prefix' => Str::slug(env('APP_NAME', 'laravel'), '_').'_database_',
],
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0),
],
'cache' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
],
],
];

81
config/elfinder.php Normal file
View File

@ -0,0 +1,81 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Upload dir
|--------------------------------------------------------------------------
|
| The dir where to store the images (relative from public).
|
*/
'dir' => ['uploads'],
/*
|--------------------------------------------------------------------------
| Filesystem disks (Flysytem)
|--------------------------------------------------------------------------
|
| Define an array of Filesystem disks, which use Flysystem.
| You can set extra options, example:
|
| 'my-disk' => [
| 'URL' => url('to/disk'),
| 'alias' => 'Local storage',
| ]
*/
'disks' => [
// 'uploads',
],
/*
|--------------------------------------------------------------------------
| Routes group config
|--------------------------------------------------------------------------
|
| The default group settings for the elFinder routes.
|
*/
'route' => [
'prefix' => config('backpack.base.route_prefix', 'admin').'/elfinder',
'middleware' => ['web', config('backpack.base.middleware_key', 'admin')], //Set to null to disable middleware filter
],
/*
|--------------------------------------------------------------------------
| Access filter
|--------------------------------------------------------------------------
|
| Filter callback to check the files
|
*/
'access' => 'Barryvdh\Elfinder\Elfinder::checkAccess',
/*
|--------------------------------------------------------------------------
| Roots
|--------------------------------------------------------------------------
|
| By default, the roots file is LocalFileSystem, with the above public dir.
| If you want custom options, you can set your own roots below.
|
*/
'roots' => null,
/*
|--------------------------------------------------------------------------
| Options
|--------------------------------------------------------------------------
|
| These options are merged, together with 'roots' and passed to the Connector.
| See https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options-2.1
|
*/
'options' => [],
];

72
config/filesystems.php Normal file
View File

@ -0,0 +1,72 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => public_path('uploads'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
],
'uploads' => [
'driver' => 'local',
'root' => public_path('uploads'),
],
],
];

34
config/gravatar.php Normal file
View File

@ -0,0 +1,34 @@
<?php
return array(
'default' => array(
// By default, images are presented at 80px by 80px if no size parameter is supplied.
// You may request a specific image size, which will be dynamically delivered from Gravatar
// by passing a single pixel dimension (since the images are square):
'size' => 80,
// the fallback image, can be a string or a url
// for more info, visit: http://en.gravatar.com/site/implement/images/#default-image
'fallback' => 'mm',
// would you like to return a https://... image
'secure' => false,
// Gravatar allows users to self-rate their images so that they can indicate if an image
// is appropriate for a certain audience. By default, only 'G' rated images are displayed
// unless you indicate that you would like to see higher ratings.
// Available options:
// g: suitable for display on all websites with any audience type.
// pg: may contain rude gestures, provocatively dressed individuals, the lesser swear words, or mild violence.
// r: may contain such things as harsh profanity, intense violence, nudity, or hard drug use.
// x: may contain hardcore sexual imagery or extremely disturbing violence.
'maximumRating' => 'g',
// If for some reason you wanted to force the default image to always load, you can do that setting this to true
'forceDefault' => false,
// If you require a file-type extension (some places do) then you may also add an (optional) .jpg extension to that URL
'forceExtension' => 'jpg',
)
);

52
config/hashing.php Normal file
View File

@ -0,0 +1,52 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];

94
config/logging.php Normal file
View File

@ -0,0 +1,94 @@
<?php
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['daily'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 14,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],
'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],
'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],
],
];

136
config/mail.php Normal file
View File

@ -0,0 +1,136 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "mandrill", "ses",
| "sparkpost", "postmark", "log", "array"
|
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'port' => env('MAIL_PORT', 587),
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
/*
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
|
| If you are using the "log" driver, you may specify the logging channel
| if you prefer to keep mail messages separate from other log entries
| for simpler reading. Otherwise, the default channel will be used.
|
*/
'log_channel' => env('MAIL_LOG_CHANNEL'),
];

View File

@ -0,0 +1,39 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Alert Levels
|--------------------------------------------------------------------------
|
| The default sort of alert levels which can be called as functions on the
| AlertsMessageBag class. This gives a convenient way to add certain type's
| of messages.
|
| For example:
|
| Alerts::info($message);
|
*/
'levels' => [
'info',
'warning',
'error',
'success',
],
/*
|--------------------------------------------------------------------------
| Session Key
|--------------------------------------------------------------------------
|
| The session key which is used to store flashed messages into the current
| session. This can be changed if it conflicts with another key.
|
*/
'session_key' => 'alert_messages',
];

87
config/queue.php Normal file
View File

@ -0,0 +1,87 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
],
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];

47
config/services.php Normal file
View File

@ -0,0 +1,47 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, SparkPost and others. This file provides a sane
| default location for this type of information, allowing packages
| to have a conventional place to find your various credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'sparkpost' => [
'secret' => env('SPARKPOST_SECRET'),
],
'stripe' => [
'model' => App\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
'webhook' => [
'secret' => env('STRIPE_WEBHOOK_SECRET'),
'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
],
],
];

199
config/session.php Normal file
View File

@ -0,0 +1,199 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION', null),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc", "memcached", or "dynamodb" session drivers you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
*/
'store' => env('SESSION_STORE', null),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE', false),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
|
*/
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
|
| Supported: "lax", "strict"
|
*/
'same_site' => null,
];

36
config/view.php Normal file
View File

@ -0,0 +1,36 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('framework/views'))
),
];

2
database/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.sqlite
*.sqlite-journal

View File

@ -0,0 +1,28 @@
<?php
/* @var $factory \Illuminate\Database\Eloquent\Factory */
use App\User;
use Illuminate\Support\Str;
use Faker\Generator as Faker;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
});

View File

@ -0,0 +1,39 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('username')->unique()->nullable();
$table->string('name')->nullable();
$table->string('email')->unique()->nullable();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->boolean('is_admin')->default(1);
$table->string('phone')->nullable();
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->unique();
$table->integer('parent_id')->default(0)->nullable();
$table->integer('lft')->default(0);
$table->integer('rgt')->default(0);
$table->integer('depth')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('categories');
}
}

View File

@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMaterialsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('materials', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('title')->nullable();
$table->text('desc')->nullable();
$table->unsignedInteger('view')->default(0);
$table->unsignedDecimal('rating')->default(0);
$table->unsignedDecimal('price')->nullable();
$table->unsignedDecimal('size')->nullable();
$table->unsignedInteger('duration')->nullable();
$table->json('details')->nullable();
$table->text('trailer_url')->nullable();
$table->text('content_url')->nullable();
$table->text('banner_url')->nullable();
$table->unsignedBigInteger('category_id');
$table->foreign('category_id')->references('id')->on('categories');
$table->unsignedSmallInteger('day_count')->default(0);
$table->unsignedSmallInteger('download_count')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('materials');
}
}

View File

@ -0,0 +1,47 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOrdersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('orders', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('oid')->nullable()->unique();
$table->unsignedBigInteger('material_id');
$table->foreign('material_id')->references('id')->on('materials');
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
$table->decimal('price');
$table->string('title');
$table->boolean('payed')->default(0);
$table->boolean('registered')->default(0);
$table->date('last_date')->nullable();
$table->unsignedSmallInteger('downloaded')->default(0);
$table->unsignedSmallInteger('download_count')->default(0);
$table->unsignedSmallInteger('errorCode')->nullable();
$table->string('orderId')->nullable();
$table->string('formUrl',512)->nullable();
$table->string('errorMessage',512)->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('orders');
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Seeder;
class CategorySeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Schema::disableForeignKeyConstraints();
DB::table('categories')->delete();
Schema::enableForeignKeyConstraints();
$groups = [
['id'=>null,'name'=>'Habarlar','depth'=>1,'lft'=>2,'rgt'=>3],
['id'=>null,'name'=>'Kinofilmler','depth'=>1,'lft'=>4,'rgt'=>5],
['id'=>null,'name'=>'Dokumental filmler','depth'=>1,'lft'=>6,'rgt'=>7],
['id'=>null,'name'=>'Multfilmler','depth'=>1,'lft'=>8,'rgt'=>9],
['id'=>null,'name'=>'Telegepleşikler','depth'=>1,'lft'=>10,'rgt'=>11],
['id'=>null,'name'=>'Radiogepleşikler','depth'=>1,'lft'=>12,'rgt'=>13],
['id'=>null,'name'=>'Çagalar üçin','depth'=>1,'lft'=>14,'rgt'=>15],
['id'=>null,'name'=>'Sport','depth'=>1,'lft'=>16,'rgt'=>17],
['id'=>null,'name'=>'Taryh','depth'=>1,'lft'=>18,'rgt'=>19],
['id'=>null,'name'=>'Syýahtçylyk','depth'=>1,'lft'=>20,'rgt'=>21],
['id'=>null,'name'=>'Aýdym-saz klipleri','depth'=>1,'lft'=>22,'rgt'=>23],
['id'=>null,'name'=>'Redaktoryň saýlany','depth'=>1,'lft'=>24,'rgt'=>25],
['id'=>null,'name'=>'Dürli','depth'=>1,'lft'=>26,'rgt'=>27],
];
DB::table('categories')->insert($groups);
}
}

View File

@ -0,0 +1,16 @@
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
$this->call(CategorySeeder::class);
}
}

25
package.json Normal file
View File

@ -0,0 +1,25 @@
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.18",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^4.0.7",
"lodash": "^4.17.5",
"popper.js": "^1.12",
"resolve-url-loader": "^2.3.1",
"sass": "^1.15.2",
"sass-loader": "^7.1.0",
"vue": "^2.5.17"
}
}

33
phpunit.xml Normal file
View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="MAIL_DRIVER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
</php>
</phpunit>

21
public/.htaccess Normal file
View File

@ -0,0 +1,21 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

3003
public/css/app.css vendored Normal file

File diff suppressed because it is too large Load Diff

0
public/favicon.ico Normal file
View File

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More