{{ $article->title }}
29 |{!! $article->description !!}
30 |├── .editorconfig
├── .env.example
├── .gitattributes
├── .gitignore
├── Procfile
├── README.md
├── app
├── Auth.php
├── Console
│ └── Kernel.php
├── Events
│ └── Event.php
├── Exceptions
│ └── Handler.php
├── Helpers
│ ├── Settings.php
│ └── helpers.php
├── Http
│ ├── Controllers
│ │ ├── Admin
│ │ │ ├── AccessLogsController.php
│ │ │ ├── ArticlesController.php
│ │ │ ├── CategoriesController.php
│ │ │ ├── ComponentsController.php
│ │ │ ├── DashboardController.php
│ │ │ ├── EmailsController.php
│ │ │ ├── MenuItemsController.php
│ │ │ ├── MenusController.php
│ │ │ ├── ModulesController.php
│ │ │ ├── PermissionsController.php
│ │ │ ├── RolesController.php
│ │ │ ├── SettingsController.php
│ │ │ ├── Traits
│ │ │ │ ├── EmailActionsTrait.php
│ │ │ │ ├── EmailFoldersTrait.php
│ │ │ │ ├── PivotTrait.php
│ │ │ │ └── Validations
│ │ │ │ │ ├── ArticlesValidationTrait.php
│ │ │ │ │ ├── CategoriesValidationTrait.php
│ │ │ │ │ ├── ComponentsValidationTrait.php
│ │ │ │ │ ├── MenusValidationTrait.php
│ │ │ │ │ ├── ModulesValidationTrait.php
│ │ │ │ │ ├── PermissionsValidationTrait.php
│ │ │ │ │ ├── RolesValidationTrait.php
│ │ │ │ │ └── UsersValidationTrait.php
│ │ │ └── UsersController.php
│ │ ├── Auth
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── RegisterController.php
│ │ │ ├── ResetPasswordController.php
│ │ │ ├── Traits
│ │ │ │ └── LoginSuspensionTrait.php
│ │ │ └── VerificationController.php
│ │ ├── Controller.php
│ │ ├── Front
│ │ │ ├── BlogController.php
│ │ │ └── Home.php
│ │ ├── ResourceController.php
│ │ └── Traits
│ │ │ ├── AuthorizeActionTrait.php
│ │ │ ├── ResourceActionsTrait.php
│ │ │ └── ResourcesFilterTrait.php
│ ├── Kernel.php
│ └── Middleware
│ │ ├── Authenticate.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── ClearCache.php
│ │ ├── EncryptCookies.php
│ │ ├── ForcePasswordChange.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── RedirectIfInactive.php
│ │ ├── TrimStrings.php
│ │ ├── TrustProxies.php
│ │ └── VerifyCsrfToken.php
├── Listeners
│ ├── EventListener.php
│ ├── LogFailedLogin.php
│ ├── LogSuccessfulLogin.php
│ ├── LogSuccessfulLogout.php
│ └── UdateLastLogin.php
├── Models
│ ├── AccessLog.php
│ ├── Article.php
│ ├── Builder.php
│ ├── Category.php
│ ├── Component.php
│ ├── Email.php
│ ├── LengthAwarePaginator.php
│ ├── Menu.php
│ ├── MenuItem.php
│ ├── Module.php
│ ├── Permission.php
│ ├── ResourceModel.php
│ ├── Role.php
│ ├── Setting.php
│ ├── Traits
│ │ ├── ListableTrait.php
│ │ ├── RolesPermissionTrait.php
│ │ └── UserEmailsTrait.php
│ └── User.php
├── Policies
│ ├── ActionPolicy.php
│ ├── EmailPolicy.php
│ ├── Traits
│ │ ├── ActionPolicyTraits.php
│ │ └── BeforePolicyTraits.php
│ └── UserPolicy.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BlankBoardServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Route.php
└── User.php
├── artisan
├── bootstrap
├── app.php
└── cache
│ └── .gitignore
├── composer.json
├── composer.lock
├── config
├── app.php
├── auth.php
├── broadcasting.php
├── cache.php
├── database.php
├── filesystems.php
├── hashing.php
├── logging.php
├── mail.php
├── queue.php
├── services.php
├── session.php
├── user.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── UserFactory.php
├── migrations
│ ├── 2014_10_12_000000_create_users_table.php
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2017_10_14_214212_create_roles_table.php
│ ├── 2017_10_14_214643_create_role_user_table.php
│ ├── 2017_10_15_214014_create_permissions_table.php
│ ├── 2017_10_15_214209_create_permission_role_table.php
│ ├── 2017_11_05_021227_create_emails_table.php
│ ├── 2017_11_05_021609_create_email_user_table.php
│ ├── 2017_12_19_191727_AccessLogsTable.php
│ ├── 2018_12_31_094233_create_categories_table.php
│ ├── 2018_12_31_103509_create_articles_table.php
│ ├── 2019_01_12_213959_create_menus_table.php
│ ├── 2019_01_14_000737_create_settings_table.php
│ ├── 2019_01_17_225345_create_modules_table.php
│ ├── 2019_01_19_194442_create_components_table.php
│ └── 2019_02_11_185344_create_menu_items_table.php
└── seeds
│ ├── ArticlesTableSeeder.php
│ ├── CategoriesTableSeeder.php
│ ├── ComponentsTableSeeder.php
│ ├── DatabaseSeeder.php
│ ├── EmailUserTableSeeder.php
│ ├── EmailsTableSeeder.php
│ ├── MenuItemsTableSeeder.php
│ ├── MenusTableSeeder.php
│ ├── PermissionRoleTableSeeder.php
│ ├── PermissionsTableSeeder.php
│ ├── RoleUserTableSeeder.php
│ ├── RolesTableSeeder.php
│ ├── SettingsTableSeeder.php
│ └── UsersTableSeeder.php
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── css
│ ├── AdminLTE.css
│ ├── AdminLTE.min.css
│ ├── adminlte.css.map
│ ├── adminlte.min.css.map
│ ├── alt
│ │ ├── AdminLTE-bootstrap-social.css
│ │ ├── AdminLTE-bootstrap-social.min.css
│ │ ├── AdminLTE-fullcalendar.css
│ │ ├── AdminLTE-fullcalendar.min.css
│ │ ├── AdminLTE-select2.css
│ │ ├── AdminLTE-select2.min.css
│ │ ├── AdminLTE-without-plugins.css
│ │ └── AdminLTE-without-plugins.min.css
│ ├── app.css
│ ├── bootstrap-theme.css
│ ├── bootstrap-theme.css.map
│ ├── bootstrap-theme.min.css
│ ├── bootstrap-theme.min.css.map
│ ├── bootstrap.css
│ ├── bootstrap.css.map
│ ├── bootstrap.min.css
│ ├── bootstrap.min.css.map
│ ├── chosen-sprite.png
│ ├── chosen-sprite@2x.png
│ ├── chosen.min.css
│ ├── custom.css
│ ├── font-awesome.css
│ ├── font-awesome.css.map
│ ├── font-awesome.min.css
│ ├── ionicons.min.css
│ ├── jquery-ui.min.css
│ └── skins
│ │ ├── _all-skins.css
│ │ ├── _all-skins.min.css
│ │ ├── skin-black-light.css
│ │ ├── skin-black-light.min.css
│ │ ├── skin-black.css
│ │ ├── skin-black.min.css
│ │ ├── skin-blue-light.css
│ │ ├── skin-blue-light.min.css
│ │ ├── skin-blue.css
│ │ ├── skin-blue.min.css
│ │ ├── skin-green-light.css
│ │ ├── skin-green-light.min.css
│ │ ├── skin-green.css
│ │ ├── skin-green.min.css
│ │ ├── skin-purple-light.css
│ │ ├── skin-purple-light.min.css
│ │ ├── skin-purple.css
│ │ ├── skin-purple.min.css
│ │ ├── skin-red-light.css
│ │ ├── skin-red-light.min.css
│ │ ├── skin-red.css
│ │ ├── skin-red.min.css
│ │ ├── skin-yellow-light.css
│ │ ├── skin-yellow-light.min.css
│ │ ├── skin-yellow.css
│ │ └── skin-yellow.min.css
├── favicon.ico
├── fonts
│ ├── FontAwesome.otf
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ ├── fontawesome-webfont.woff2
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.svg
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ ├── glyphicons-halflings-regular.woff2
│ ├── ionicons.eot
│ ├── ionicons.svg
│ ├── ionicons.ttf
│ └── ionicons.woff
├── img
│ ├── 350x220.png
│ └── avatar
│ │ └── default.png
├── index.php
├── js
│ ├── adminlte.min.js
│ ├── app.js
│ ├── bootstrap.min.js
│ ├── chosen.jquery.min.js
│ ├── demo.js
│ ├── jquery-ui.min.js
│ ├── jquery.inputmask.bundle.min.js
│ ├── jquery.min.js
│ └── npm.js
├── robots.txt
├── svg
│ ├── 403.svg
│ ├── 404.svg
│ ├── 500.svg
│ └── 503.svg
└── web.config
├── resources
├── js
│ ├── app.js
│ ├── bootstrap.js
│ └── components
│ │ └── ExampleComponent.vue
├── lang
│ ├── en
│ │ ├── access_logs.php
│ │ ├── articles.php
│ │ ├── auth.php
│ │ ├── categories.php
│ │ ├── components.php
│ │ ├── dashboard.php
│ │ ├── emails.php
│ │ ├── footer.php
│ │ ├── menu_items.php
│ │ ├── menus.php
│ │ ├── messages.php
│ │ ├── modules.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ ├── roles.php
│ │ ├── settings.php
│ │ ├── users.php
│ │ └── validation.php
│ └── es
│ │ ├── access_logs.php
│ │ ├── articles.php
│ │ ├── auth.php
│ │ ├── categories.php
│ │ ├── components.php
│ │ ├── dashboard.php
│ │ ├── emails.php
│ │ ├── footer.php
│ │ ├── menu_items.php
│ │ ├── menus.php
│ │ ├── messages.php
│ │ ├── modules.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ ├── permissions.php
│ │ ├── roles.php
│ │ ├── settings.php
│ │ ├── users.php
│ │ └── validation.php
├── sass
│ ├── _variables.scss
│ └── app.scss
└── views
│ ├── admin
│ ├── dashboard
│ │ └── index.blade.php
│ ├── emails
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── includes
│ │ ├── actions
│ │ │ ├── create.blade.php
│ │ │ ├── edit.blade.php
│ │ │ ├── filters.blade.php
│ │ │ ├── index.blade.php
│ │ │ ├── list.blade.php
│ │ │ └── lists.blade.php
│ │ ├── alerts.blade.php
│ │ ├── box-email.blade.php
│ │ ├── box-profile.blade.php
│ │ ├── content-header.blade.php
│ │ ├── filters
│ │ │ └── permissions.blade.php
│ │ ├── footer.blade.php
│ │ ├── forms
│ │ │ ├── articles.blade.php
│ │ │ ├── categories.blade.php
│ │ │ ├── components.blade.php
│ │ │ ├── emails.blade.php
│ │ │ ├── inputs
│ │ │ │ ├── boolean.blade.php
│ │ │ │ ├── date.blade.php
│ │ │ │ ├── integer.blade.php
│ │ │ │ └── string.blade.php
│ │ │ ├── menu_items.blade.php
│ │ │ ├── menus.blade.php
│ │ │ ├── modules.blade.php
│ │ │ ├── permissions.blade.php
│ │ │ ├── roles.blade.php
│ │ │ ├── settings.blade.php
│ │ │ ├── users.blade.php
│ │ │ ├── users_image.blade.php
│ │ │ ├── users_password.blade.php
│ │ │ ├── users_update.blade.php
│ │ │ └── users_update_adv.blade.php
│ │ ├── head.blade.php
│ │ ├── header.blade.php
│ │ ├── scripts.blade.php
│ │ ├── sidebar.blade.php
│ │ └── tables
│ │ │ ├── emails_draft.blade.php
│ │ │ ├── emails_inbox.blade.php
│ │ │ ├── emails_sent.blade.php
│ │ │ ├── emails_trash.blade.php
│ │ │ ├── header_emails.blade.php
│ │ │ ├── resources.php
│ │ │ └── user_emails.blade.php
│ ├── menus
│ │ ├── create.blade.php
│ │ └── edit.blade.php
│ └── users
│ │ ├── edit.blade.php
│ │ └── show.blade.php
│ ├── auth
│ ├── login.blade.php
│ ├── passwords
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ └── register.blade.php
│ ├── front
│ ├── blog
│ │ ├── category.blade.php
│ │ └── single.blade.php
│ ├── default.blade.php
│ ├── home.blade.php
│ └── includes
│ │ ├── footer.blade.php
│ │ ├── head.blade.php
│ │ ├── menu.blade.php
│ │ └── scripts.blade.php
│ ├── layouts
│ ├── admin.blade.php
│ ├── app.blade.php
│ └── auth.php
│ └── welcome.blade.php
├── routes
├── api.php
├── channels.php
├── console.php
└── web.php
├── server.php
├── storage
├── app
│ ├── .gitignore
│ └── public
│ │ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ ├── .gitignore
│ │ └── data
│ │ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── testing
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
├── tests
├── CreatesApplication.php
├── Feature
│ └── ExampleTest.php
├── TestCase.php
└── Unit
│ └── ExampleTest.php
└── webpack.mix.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 4
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.yml]
15 | indent_size = 2
16 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=
4 | APP_DEBUG=true
5 | APP_URL=http://localhost
6 |
7 | LOG_CHANNEL=stack
8 |
9 | DB_CONNECTION=mysql
10 | DB_HOST=127.0.0.1
11 | DB_PORT=3306
12 | DB_DATABASE=homestead
13 | DB_USERNAME=homestead
14 | DB_PASSWORD=secret
15 |
16 | BROADCAST_DRIVER=log
17 | CACHE_DRIVER=file
18 | QUEUE_CONNECTION=sync
19 | SESSION_DRIVER=file
20 | SESSION_LIFETIME=120
21 |
22 | REDIS_HOST=127.0.0.1
23 | REDIS_PASSWORD=null
24 | REDIS_PORT=6379
25 |
26 | MAIL_DRIVER=smtp
27 | MAIL_HOST=smtp.mailtrap.io
28 | MAIL_PORT=2525
29 | MAIL_USERNAME=null
30 | MAIL_PASSWORD=null
31 | MAIL_ENCRYPTION=null
32 |
33 | PUSHER_APP_ID=
34 | PUSHER_APP_KEY=
35 | PUSHER_APP_SECRET=
36 | PUSHER_APP_CLUSTER=mt1
37 |
38 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
39 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
40 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /public/hot
3 | /public/storage
4 | /storage/*.key
5 | /vendor
6 | .env
7 | .phpunit.result.cache
8 | Homestead.json
9 | Homestead.yaml
10 | npm-debug.log
11 | yarn-error.log
12 | .env
13 | Procfile
14 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: vendor/bin/heroku-php-apache2 public/
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BlankBoard
2 | Basic users and permissions management system, with Laravel 5.5 on the AdminLTE template.
3 |
4 | ## Users
5 | Using Laravel's API with BlankBoard you're able create new users, assing roles (or not) to the users to grant them access through out the app.
6 |
7 | ## Roles
8 | Roles are created within the GUI. You can attach permissions to the roles.
9 |
10 | ## Permissions
11 | Permissions are created directly through the Controller. On the instantiation of the Controller (would be moved to an independent action, to register the Controller on demand). The GUI don't let you create or delete the Permissions. If you want to remove any permission from you app, just deactivate the desired permission.
12 |
13 | ## Messages
14 | You are be able to create, send and delete messages. If you want, you can store messages as drafts to be processed in the future.
15 |
--------------------------------------------------------------------------------
/app/Auth.php:
--------------------------------------------------------------------------------
1 | last_name != null) {
17 | return self::user()->name . ' ' . self::user()->last_name;
18 | } else {
19 | return self::user()->name;
20 | }
21 | }
22 |
23 | /**
24 | * Display user's image.
25 | *
26 | * @return string
27 | */
28 | public static function image()
29 | {
30 | if (self::user()->image != null) {
31 | return self::user()->image();
32 | } else {
33 | return config('user.default_avatar');
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
28 | // ->hourly();
29 | }
30 |
31 | /**
32 | * Register the commands for the application.
33 | *
34 | * @return void
35 | */
36 | protected function commands()
37 | {
38 | $this->load(__DIR__.'/Commands');
39 |
40 | require base_path('routes/console.php');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Events/Event.php:
--------------------------------------------------------------------------------
1 | settings = Model::all()->pluck('value', 'slug')->toArray();
18 | } catch (\Exception $e) {
19 | //
20 | }
21 | }
22 | return $this->settings[$key] ?? null;
23 | }
24 |
25 | public static function getInstance(): self
26 | {
27 | if (!self::$instance instanceof static) {
28 | self::$instance = new static;
29 | }
30 | return self::$instance;
31 | }
32 |
33 | public static function sections()
34 | {
35 | return cache()->remember('settings-sections', 15, function () {
36 | return Model::select('section')
37 | ->groupBy('section')
38 | ->get()
39 | ->pluck('section')
40 | ->toArray();
41 | });
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/AccessLogsController.php:
--------------------------------------------------------------------------------
1 | 'desc'];
32 |
33 | /**
34 | * Get the map of resource methods to ability names.
35 | *
36 | * @return array
37 | */
38 | protected function resourceAbilityMap()
39 | {
40 | return [
41 | 'index' => 'index'
42 | ];
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/CategoriesController.php:
--------------------------------------------------------------------------------
1 | 'index',
38 | 'create' => 'create',
39 | 'store' => 'create',
40 | 'edit' => 'update',
41 | 'update' => 'update',
42 | 'destroy' => 'delete',
43 | ];
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/ComponentsController.php:
--------------------------------------------------------------------------------
1 | 'asc'];
35 |
36 | /**
37 | * Get the map of resource methods to ability names.
38 | *
39 | * @return array
40 | */
41 | protected function resourceAbilityMap()
42 | {
43 | return [
44 | 'index' => 'index',
45 | 'create' => 'create',
46 | 'store' => 'create',
47 | 'edit' => 'update',
48 | 'update' => 'update',
49 | 'destroy' => 'delete',
50 | ];
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/DashboardController.php:
--------------------------------------------------------------------------------
1 | route . '.index')
26 | ->with('name', $this->route);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/EmailsController.php:
--------------------------------------------------------------------------------
1 | 'index',
38 | 'create' => 'create',
39 | 'store' => 'create',
40 | 'edit' => 'update',
41 | 'update' => 'update',
42 | 'destroy' => 'delete',
43 | ];
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/MenusController.php:
--------------------------------------------------------------------------------
1 | 'index',
39 | 'create' => 'create',
40 | 'store' => 'create',
41 | 'edit' => 'update',
42 | 'update' => 'update',
43 | 'destroy' => 'delete',
44 | ];
45 | }
46 |
47 | public function edit($id)
48 | {
49 | $this->setListable(['id', 'title', 'url', 'status']);
50 | $this->setFilters(['menu_id' => $id]);
51 | $this->registerModule('menu_items', $this->resourceAbilityMap());
52 |
53 | $menu_items = $this->resourcesList(MenuItem::class);
54 |
55 | return parent::edit($id)
56 | ->withResources($menu_items)
57 | ->withModule($this->module);
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/ModulesController.php:
--------------------------------------------------------------------------------
1 | 'index',
38 | 'edit' => 'update',
39 | 'update' => 'update',
40 | ];
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/PermissionsController.php:
--------------------------------------------------------------------------------
1 | 'index',
38 | 'edit' => 'update',
39 | 'update' => 'update',
40 | ];
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/SettingsController.php:
--------------------------------------------------------------------------------
1 | setFilters(['section' => $section]);
29 | return $this->index();
30 | }
31 |
32 | /**
33 | * Get the map of resource methods to ability names.
34 | *
35 | * @return array
36 | */
37 | protected function resourceAbilityMap()
38 | {
39 | return [
40 | 'index' => 'index',
41 | 'edit' => 'update',
42 | 'update' => 'update',
43 | ];
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/Traits/PivotTrait.php:
--------------------------------------------------------------------------------
1 | id();
20 |
21 | $relation->updateExistingPivot($user_id, $column, false);
22 | ;
23 | }
24 |
25 | /**
26 | * Get pivot column value.
27 | *
28 | * @param Relation $relation
29 | * @param string $columns The column to get from the pivot table.
30 | * @param int $user_id The user id.
31 | * @return \Illuminate\Http\Response
32 | */
33 | public function getPivotColumn(Relation $relation, $column, $user_id = null)
34 | {
35 | $user_id = $user_id ?? auth()->id();
36 |
37 | if ($relation->wherePivot('user_id', auth()->id())->first() != null) {
38 | return $relation->wherePivot('user_id', auth()->id())
39 | ->first()
40 | ->pivot
41 | ->$column;
42 | }
43 |
44 | return null;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/Traits/Validations/ArticlesValidationTrait.php:
--------------------------------------------------------------------------------
1 | 'required|max:120',
18 | 'image' => 'nullable',
19 | 'description' => 'nullable|max:250',
20 | 'status' => 'required|integer',
21 | 'category_id' => 'required|integer',
22 | 'content' => 'required',
23 | ];
24 | }
25 |
26 | /**
27 | * Return validations for updating current resource.
28 | *
29 | * @return array
30 | */
31 | protected function updateValidations()
32 | {
33 | return [
34 | 'title' => 'required|max:120',
35 | 'image' => 'nullable',
36 | 'description' => 'nullable|max:250',
37 | 'status' => 'required|integer',
38 | 'category_id' => 'required|integer',
39 | 'content' => 'required',
40 | ];
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/Traits/Validations/CategoriesValidationTrait.php:
--------------------------------------------------------------------------------
1 | 'required|max:32',
20 | 'slug' => 'required|unique|max:32',
21 | 'description' => 'nullable|max:120',
22 | 'status' => 'integer',
23 | ];
24 | }
25 |
26 | /**
27 | * Return validations for updating current resource.
28 | *
29 | * @return array
30 | */
31 | protected function updateValidations()
32 | {
33 | $id = Input::get('id');
34 | return [
35 | 'name' => 'required|max:32',
36 | 'slug' => ['required',Rule::unique('categories')->ignore($id),'max:32'],
37 | 'description' => 'nullable|max:120',
38 | 'status' => 'integer',
39 | ];
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/Traits/Validations/ComponentsValidationTrait.php:
--------------------------------------------------------------------------------
1 | 'required|max:120',
18 | 'description' => 'nullable|max:250',
19 | 'status' => 'required|integer',
20 | 'order' => 'required|integer',
21 | 'content' => 'required',
22 | ];
23 | }
24 |
25 | /**
26 | * Return validations for updating current resource.
27 | *
28 | * @return array
29 | */
30 | protected function updateValidations()
31 | {
32 | return [
33 | 'name' => 'required|max:120',
34 | 'description' => 'nullable|max:250',
35 | 'status' => 'required|integer',
36 | 'order' => 'required|integer',
37 | 'content' => 'required',
38 | ];
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/Traits/Validations/MenusValidationTrait.php:
--------------------------------------------------------------------------------
1 | 'required|max:32',
18 | 'slug' => 'required|max:32',
19 | 'status' => 'required|integer',
20 | ];
21 | }
22 |
23 | /**
24 | * Return validations for updating current resource.
25 | *
26 | * @return array
27 | */
28 | protected function updateValidations()
29 | {
30 | return [
31 | 'name' => 'required|max:32',
32 | 'slug' => 'required|max:32',
33 | 'status' => 'required|integer',
34 | ];
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/Traits/Validations/ModulesValidationTrait.php:
--------------------------------------------------------------------------------
1 | 'nullable|max:120',
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/Traits/Validations/PermissionsValidationTrait.php:
--------------------------------------------------------------------------------
1 | 'nullable|max:120',
18 | ];
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/Traits/Validations/RolesValidationTrait.php:
--------------------------------------------------------------------------------
1 | 'required|max:32',
20 | 'slug' => 'required|unique:roles|max:32|alpha_dash',
21 | 'description' => 'nullable|max:120',
22 | ];
23 | }
24 |
25 | /**
26 | * Return validations for updating current resource.
27 | *
28 | * @return array
29 | */
30 | protected function updateValidations()
31 | {
32 | $id = Input::get('id');
33 | return [
34 | 'name' => 'required|max:32',
35 | 'slug' =>['required',Rule::unique('roles')->ignore($id),'max:32','alpha_dash'],
36 | 'description' => 'nullable|max:120',
37 | ];
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ResetPasswordController.php:
--------------------------------------------------------------------------------
1 | redirectTo = URL::route('login');
38 | $this->middleware('guest');
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/VerificationController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
38 | $this->middleware('signed')->only('verify');
39 | $this->middleware('throttle:6,1')->only('verify', 'resend');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | where('slug', $slug)
15 | ->first();
16 |
17 | $articles = Article::where('category_id', $category->id)
18 | ->latest()
19 | ->get();
20 |
21 | return view('front.blog.category')
22 | ->with('articles', $articles);
23 | }
24 |
25 | public function single($category, $slug)
26 | {
27 | $category = Category::select('id')
28 | ->where('slug', $category)
29 | ->first();
30 |
31 | $article = Article::where('url_alias', $slug)
32 | ->where('category_id', $category->id)
33 | ->latest()
34 | ->firstOrFail();
35 |
36 | return view('front.blog.single')
37 | ->with('article', $article);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Front/Home.php:
--------------------------------------------------------------------------------
1 | orderBy('order')
14 | ->orderBy('id')
15 | ->get();
16 |
17 | return view('front.home')
18 | ->with('components', $components);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Traits/AuthorizeActionTrait.php:
--------------------------------------------------------------------------------
1 | user()->id === config('user.superuser')) {
17 | return;
18 | }
19 |
20 | $params = empty($params) ? [$this->name] : $params;
21 |
22 | $arguments = array_merge([$this->model], $params);
23 |
24 | if ($ability != null) {
25 | $this->authorize($ability, $arguments);
26 | } elseif ($this->getAbility($this->request)) {
27 | $this->authorize($this->getAbility(), $arguments);
28 | }
29 | }
30 |
31 | /**
32 | * Get the ability for current route action
33 | *
34 | * @return sting
35 | */
36 | protected function getAbility()
37 | {
38 | if (isset($this->resourceAbilityMap()[$this->getActionMethod()])) {
39 | return $this->resourceAbilityMap()[$this->getActionMethod()];
40 | }
41 | return false;
42 | }
43 |
44 | /**
45 | * Get current route action.
46 | *
47 | * @return string
48 | */
49 | protected function getActionMethod()
50 | {
51 | return $this->request->route()->getActionMethod();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Traits/ResourcesFilterTrait.php:
--------------------------------------------------------------------------------
1 | 'asc'];
27 |
28 | /**
29 | * Get the columns to select for the index.
30 | *
31 | * @return array
32 | */
33 | public function getListable(): array
34 | {
35 | return $this->listable;
36 | }
37 |
38 | /**
39 | * Set the columns to select for the index.
40 | *
41 | * @return array
42 | */
43 | public function setListable(array $listable)
44 | {
45 | $this->listable = $listable;
46 | }
47 |
48 | /**
49 | * Get the filters for the index resource list.
50 | *
51 | * @return array
52 | */
53 | public function getFilters(): array
54 | {
55 | return $this->filters;
56 | }
57 |
58 | /**
59 | * Set the filters for the index resource list.
60 | *
61 | * @return array
62 | */
63 | public function setFilters(array $filters)
64 | {
65 | $this->filters = $filters;
66 | }
67 |
68 | /**
69 | * Get the resources list.
70 | *
71 | * @todo This method should be moved to a trait. And an independent package.
72 | *
73 | * @return array
74 | */
75 | protected function resourcesList(string $model)
76 | {
77 | return $model::resources(
78 | $this->getListable(),
79 | $this->getFilters(),
80 | $this->order
81 | )
82 | ->paginate($this->paginate);
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Http/Middleware/CheckForMaintenanceMode.php:
--------------------------------------------------------------------------------
1 | header('Cache-Control', 'nocache, no-store, max-age=0, must-revalidate')
22 | ->header('Pragma', 'no-cache')
23 | ->header('Expires', 'Sun, 02 Jan 1990 00:00:00 GMT');
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | user();
19 |
20 | if (!routeNameIs(['users.edit', 'users.update'])) {
21 | if ($user->isNew()) {
22 | return redirect()->route('users.edit', $user->id)
23 | ->with('info', 'users.new-user');
24 | } elseif ($user->passwordExpired()) {
25 | return redirect()->route('users.edit', $user->id)
26 | ->with('danger', 'users.password-expired');
27 | }
28 | }
29 |
30 | return $next($request);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect()->route('dashboard.index');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfInactive.php:
--------------------------------------------------------------------------------
1 | user();
20 |
21 | if ($user->isActive() || routeNameIs(['users.show', 'users.edit', 'users.update'])) {
22 | return $next($request);
23 | }
24 |
25 | return redirect()->route('users.show', $user->id)
26 | ->with('warning', 'messages.alert.inactive');
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | user->id)) {
31 | AccessLog::create([
32 | 'user_id' => $event->user->id,
33 | 'user_name' => $event->user->username,
34 | 'user_ip' => request()->getClientIp(),
35 | 'event' => 'failed_login',
36 | ]);
37 | } else {
38 | AccessLog::create([
39 | 'user_name' => $event->credentials['username'],
40 | 'user_ip' => request()->getClientIp(),
41 | 'event' => 'failed_login',
42 | ]);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app/Listeners/LogSuccessfulLogin.php:
--------------------------------------------------------------------------------
1 | $event->user->id,
32 | 'user_name' => $event->user->username,
33 | 'user_ip' => request()->getClientIp(),
34 | 'event' => 'login',
35 | ]);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/Listeners/LogSuccessfulLogout.php:
--------------------------------------------------------------------------------
1 | $event->user->id,
32 | 'user_name' => $event->user->username,
33 | 'user_ip' => request()->getClientIp(),
34 | 'event' => 'logout',
35 | ]);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app/Listeners/UdateLastLogin.php:
--------------------------------------------------------------------------------
1 | user->last_login = Carbon::now();
31 | $event->user->save();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Models/AccessLog.php:
--------------------------------------------------------------------------------
1 | diffForHumans();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Models/Article.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class, 'author_id');
22 | }
23 |
24 | public function category()
25 | {
26 | return $this->belongsTo(Category::class);
27 | }
28 |
29 | public function getCreatedAtAttribute($value)
30 | {
31 | return Carbon::parse($value)->diffForHumans();
32 | }
33 |
34 | public function setUrlAliasAttribute($value)
35 | {
36 | $this->attributes['url_alias'] = str_slug($value);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Models/Builder.php:
--------------------------------------------------------------------------------
1 | makeWith(LengthAwarePaginator::class, compact(
25 | 'items', 'total', 'perPage', 'currentPage', 'options'
26 | ));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/app/Models/Category.php:
--------------------------------------------------------------------------------
1 | attributes['slug'] = str_slug($value);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Models/Component.php:
--------------------------------------------------------------------------------
1 | belongsTo(User::class);
34 | }
35 |
36 | /**
37 | * Get emails with a certain user.
38 | *
39 | * @return mixed
40 | */
41 | public function recipients()
42 | {
43 | return $this->belongsToMany(User::class, 'email_user')
44 | ->latest()
45 | ->withPivot('is_read', 'status');
46 | }
47 |
48 | public function hasOwner($user_id)
49 | {
50 | return $this->user_id == $user_id;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/Models/LengthAwarePaginator.php:
--------------------------------------------------------------------------------
1 | render($view, array_merge($data, [
19 | 'resources' => $this,
20 | ]));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/Models/Menu.php:
--------------------------------------------------------------------------------
1 | hasMany(MenuItem::class)
21 | ->orderBy('order')
22 | ->orderBy('id');
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/Models/MenuItem.php:
--------------------------------------------------------------------------------
1 | belongsTo(Menu::class);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/Models/Module.php:
--------------------------------------------------------------------------------
1 | hasMany(Setting::class, 'section', 'slug');
31 | }
32 |
33 | public function getCanCreateAttribute($value)
34 | {
35 | return (bool) $value;
36 | }
37 |
38 | public function getCanUpdateAttribute($value)
39 | {
40 | return (bool) $value;
41 | }
42 |
43 | public function getCanDeleteAttribute($value)
44 | {
45 | return (bool) $value;
46 | }
47 |
48 | public static function getListable(): array
49 | {
50 | return static::$listable;
51 | }
52 |
53 | public static function setListable(array $listable)
54 | {
55 | static::$listable = $listable;
56 | return self::class;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/Models/ResourceModel.php:
--------------------------------------------------------------------------------
1 | where($filters);
26 |
27 | foreach ($sortables as $column => $order) {
28 | $query->orderBy($column, $order);
29 | }
30 |
31 | return $query;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Models/Role.php:
--------------------------------------------------------------------------------
1 | users as $user) {
26 | $user()->clearCache();
27 | }
28 | });
29 | }
30 |
31 | /**
32 | * Get permission with a certain roles.
33 | *
34 | * @return void
35 | */
36 | public function permissions()
37 | {
38 | return $this->belongsToMany(Permission::class)->where('status', 1);
39 | }
40 |
41 | /**
42 | * Get users with a certain roles.
43 | *
44 | * @return void
45 | */
46 | public function users()
47 | {
48 | return $this->belongsToMany(User::class)->where('status', 1);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/Models/Setting.php:
--------------------------------------------------------------------------------
1 | attributes['type']);
22 | switch ($type[0]) {
23 |
24 | case 'string':
25 | $value = (string) $value;
26 | break;
27 |
28 | case 'boolean':
29 | $value = (bool) $value;
30 | break;
31 |
32 | case 'integer':
33 | $value = (int) $value;
34 | break;
35 |
36 | case 'date':
37 | $value = Carbon::parse($value)->toDateString();
38 | break;
39 |
40 | case 'time':
41 | $value = Carbon::parse($value)->toTimeString();
42 | break;
43 |
44 | case 'timestamp':
45 | $value = Carbon::parse($value)->toDayDateTimeString();
46 | break;
47 |
48 | }
49 | $this->attributes['value'] = json_encode($value);
50 | }
51 |
52 | public function getValueAttribute($value)
53 | {
54 | return json_decode($value);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/Models/Traits/ListableTrait.php:
--------------------------------------------------------------------------------
1 | belongsToMany(Email::class)
17 | ->where('emails.status', '<>', 0)
18 | ->wherePivot('status', '>', 0)
19 | ->latest();
20 | }
21 |
22 | /**
23 | * Get unread emails with a certain user.
24 | *
25 | * @return mixed
26 | */
27 | public function unreadEmails()
28 | {
29 | return $this->belongsToMany(Email::class)
30 | ->where('emails.status', '<>', 0)
31 | ->wherePivot('is_read', '=', 0)
32 | ->wherePivot('status', '>', 0)
33 | ->latest();
34 | }
35 |
36 | /**
37 | * Get sent emails with a certain user.
38 | *
39 | * @return mixed
40 | */
41 | public function sentEmails()
42 | {
43 | return $this->belongsTo(Email::class, 'id', 'user_id')
44 | ->where('emails.status', 1)
45 | ->latest();
46 | }
47 |
48 | /**
49 | * Get draft emails with a certain user.
50 | *
51 | * @return mixed
52 | */
53 | public function draftEmails()
54 | {
55 | return $this->belongsTo(Email::class, 'id', 'user_id')
56 | ->where('emails.status', 0)
57 | ->latest();
58 | }
59 |
60 | /**
61 | * Get trashed emails with a certain user.
62 | *
63 | * @return mixed
64 | */
65 | public function trashedEmails()
66 | {
67 | $sent = $this->belongsTo(Email::class, 'id', 'user_id')
68 | ->where('emails.status', -1)
69 | ->get();
70 |
71 | $received = $this->belongsToMany(Email::class)
72 | ->wherePivot('status', '=', -1)
73 | ->get();
74 |
75 | return $sent->merge($received);
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/app/Policies/ActionPolicy.php:
--------------------------------------------------------------------------------
1 | id == $email->user_id || $email->recipients->where('id', $user->id)->isNotEmpty()) {
27 | return true;
28 | }
29 |
30 | return abort(403, __('messages.access-denied'));
31 | }
32 |
33 | /**
34 | * Determine whether the user can update the model.
35 | *
36 | * @param \App\Models\User $user
37 | * @return mixed
38 | */
39 | public function update(User $user, Email $email)
40 | {
41 | if ($user->id == $email->user_id && $email->status == 0) {
42 | return true;
43 | }
44 |
45 | return abort(404);
46 | }
47 |
48 | /**
49 | * Determine whether the user can delete the model.
50 | *
51 | * @param \App\Models\User $user
52 | * @return mixed
53 | */
54 | public function delete(User $user, Email $email)
55 | {
56 | return true;
57 | if ($user->id == $email->user_id || $email->recipients->where('id', $user->id)->isNotEmpty()) {
58 | return true;
59 | }
60 |
61 | return abort(403, __('messages.access-denied'));
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/Policies/Traits/BeforePolicyTraits.php:
--------------------------------------------------------------------------------
1 | isSuperAdmin()) {
10 | return true;
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | \App\Policies\ActionPolicy::class,
17 | \App\Models\Article::class => \App\Policies\ActionPolicy::class,
18 | \App\Models\Category::class => \App\Policies\ActionPolicy::class,
19 | \App\Models\Component::class => \App\Policies\ActionPolicy::class,
20 | \App\Models\Email::class => \App\Policies\EmailPolicy::class,
21 | \App\Models\Menu::class => \App\Policies\ActionPolicy::class,
22 | \App\Models\Module::class => \App\Policies\ActionPolicy::class,
23 | \App\Models\Permission::class => \App\Policies\ActionPolicy::class,
24 | \App\Models\Role::class => \App\Policies\ActionPolicy::class,
25 | \App\Models\User::class => \App\Policies\UserPolicy::class,
26 | \App\Models\Setting::class => \App\Policies\ActionPolicy::class,
27 | ];
28 |
29 | /**
30 | * Register any authentication / authorization services.
31 | *
32 | * @return void
33 | */
34 | public function boot()
35 | {
36 | $this->registerPolicies();
37 |
38 | //
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/Providers/BlankBoardServiceProvider.php:
--------------------------------------------------------------------------------
1 | ";
20 | });
21 |
22 | // Render column celss
23 | Blade::directive('td', function () {
24 | return '';
25 | });
26 |
27 | // Render column header cells
28 | Blade::directive('th', function () {
29 | return 'slug . \'.table.\' . $column)); ?>';
30 | });
31 |
32 | // Permission custom if
33 | Blade::if('permission', function ($permissions, $module = false) {
34 | return auth()->user()->hasPermission($permissions, $module);
35 | });
36 | }
37 |
38 | /**
39 | * Register any application services.
40 | *
41 | * @return void
42 | */
43 | public function register()
44 | {
45 | //
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | 'App\Events\Event' => [
22 | 'App\Listeners\EventListener',
23 | ],
24 | 'Illuminate\Auth\Events\Login' => [
25 | 'App\Listeners\LogSuccessfulLogin',
26 | ],
27 | 'Illuminate\Auth\Events\Failed' => [
28 | 'App\Listeners\LogFailedLogin',
29 | ],
30 | 'Illuminate\Auth\Events\Logout' => [
31 | 'App\Listeners\LogSuccessfulLogout',
32 | ],
33 | ];
34 |
35 | /**
36 | * Register any events for your application.
37 | *
38 | * @return void
39 | */
40 | public function boot()
41 | {
42 | parent::boot();
43 |
44 | //
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/Providers/RouteServiceProvider.php:
--------------------------------------------------------------------------------
1 | mapApiRoutes();
39 |
40 | $this->mapWebRoutes();
41 |
42 | //
43 | }
44 |
45 | /**
46 | * Define the "web" routes for the application.
47 | *
48 | * These routes all receive session state, CSRF protection, etc.
49 | *
50 | * @return void
51 | */
52 | protected function mapWebRoutes()
53 | {
54 | Route::middleware('web')
55 | ->namespace($this->namespace)
56 | ->group(base_path('routes/web.php'));
57 | }
58 |
59 | /**
60 | * Define the "api" routes for the application.
61 | *
62 | * These routes are typically stateless.
63 | *
64 | * @return void
65 | */
66 | protected function mapApiRoutes()
67 | {
68 | Route::prefix('api')
69 | ->middleware('api')
70 | ->namespace($this->namespace)
71 | ->group(base_path('routes/api.php'));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/app/Route.php:
--------------------------------------------------------------------------------
1 | name($name . '.register');
12 | return parent::resource($name, $controller, $options);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/User.php:
--------------------------------------------------------------------------------
1 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/bootstrap/app.php:
--------------------------------------------------------------------------------
1 | singleton(
30 | Illuminate\Contracts\Http\Kernel::class,
31 | App\Http\Kernel::class
32 | );
33 |
34 | $app->singleton(
35 | Illuminate\Contracts\Console\Kernel::class,
36 | App\Console\Kernel::class
37 | );
38 |
39 | $app->singleton(
40 | Illuminate\Contracts\Debug\ExceptionHandler::class,
41 | App\Exceptions\Handler::class
42 | );
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Return The Application
47 | |--------------------------------------------------------------------------
48 | |
49 | | This script returns the application instance. The instance is given to
50 | | the calling script so we can separate the building of the instances
51 | | from the actual running of the application and sending responses.
52 | |
53 | */
54 |
55 | return $app;
56 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'encrypted' => true,
41 | ],
42 | ],
43 |
44 | 'redis' => [
45 | 'driver' => 'redis',
46 | 'connection' => 'default',
47 | ],
48 |
49 | 'log' => [
50 | 'driver' => 'log',
51 | ],
52 |
53 | 'null' => [
54 | 'driver' => 'null',
55 | ],
56 |
57 | ],
58 |
59 | ];
60 |
--------------------------------------------------------------------------------
/config/hashing.php:
--------------------------------------------------------------------------------
1 | 'bcrypt',
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Bcrypt Options
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may specify the configuration options that should be used when
26 | | passwords are hashed using the Bcrypt algorithm. This will allow you
27 | | to control the amount of time it takes to hash the given password.
28 | |
29 | */
30 |
31 | 'bcrypt' => [
32 | 'rounds' => env('BCRYPT_ROUNDS', 10),
33 | ],
34 |
35 | /*
36 | |--------------------------------------------------------------------------
37 | | Argon Options
38 | |--------------------------------------------------------------------------
39 | |
40 | | Here you may specify the configuration options that should be used when
41 | | passwords are hashed using the Argon algorithm. These will allow you
42 | | to control the amount of time it takes to hash the given password.
43 | |
44 | */
45 |
46 | 'argon' => [
47 | 'memory' => 1024,
48 | 'threads' => 2,
49 | 'time' => 2,
50 | ],
51 |
52 | ];
53 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'ses' => [
24 | 'key' => env('SES_KEY'),
25 | 'secret' => env('SES_SECRET'),
26 | 'region' => env('SES_REGION', 'us-east-1'),
27 | ],
28 |
29 | 'sparkpost' => [
30 | 'secret' => env('SPARKPOST_SECRET'),
31 | ],
32 |
33 | 'stripe' => [
34 | 'model' => App\User::class,
35 | 'key' => env('STRIPE_KEY'),
36 | 'secret' => env('STRIPE_SECRET'),
37 | 'webhook' => [
38 | 'secret' => env('STRIPE_WEBHOOK_SECRET'),
39 | 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
40 | ],
41 | ],
42 |
43 | ];
44 |
--------------------------------------------------------------------------------
/config/view.php:
--------------------------------------------------------------------------------
1 | [
17 | resource_path('views'),
18 | ],
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Compiled View Path
23 | |--------------------------------------------------------------------------
24 | |
25 | | This option determines where all the compiled Blade templates will be
26 | | stored for your application. Typically, this is within the storage
27 | | directory. However, as usual, you are free to change this value.
28 | |
29 | */
30 |
31 | 'compiled' => env(
32 | 'VIEW_COMPILED_PATH',
33 | realpath(storage_path('framework/views'))
34 | ),
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | define(App\User::class, function (Faker $faker) {
17 | return [
18 | 'name' => $faker->name,
19 | 'email' => $faker->unique()->safeEmail,
20 | 'email_verified_at' => now(),
21 | 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
22 | 'remember_token' => str_random(10),
23 | ];
24 | });
25 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_000000_create_users_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('username', 50);
19 | $table->string('name', 50);
20 | $table->string('last_name', 50)->nullable();
21 | $table->string('email', 100);
22 | $table->string('password', 255);
23 | $table->smallInteger('status')->default(1);
24 | $table->string('image', 255)->nullable();
25 | $table->text('description')->nullable();
26 | $table->dateTime('last_login')->nullable();
27 | $table->dateTime('last_password_change')->nullable();
28 | $table->rememberToken();
29 | $table->timestamps();
30 | $table->softDeletes();
31 | });
32 | }
33 |
34 | /**
35 | * Reverse the migrations.
36 | *
37 | * @return void
38 | */
39 | public function down()
40 | {
41 | Schema::dropIfExists('users');
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email', 50)->index();
18 | $table->string('token');
19 | $table->string('password');
20 | $table->timestamp('created_at')->nullable();
21 | });
22 | }
23 |
24 | /**
25 | * Reverse the migrations.
26 | *
27 | * @return void
28 | */
29 | public function down()
30 | {
31 | Schema::dropIfExists('password_resets');
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/database/migrations/2017_10_14_214212_create_roles_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name', 50);
19 | $table->string('slug', 50)->unique();
20 | $table->text('description')->nullable();
21 | $table->smallInteger('status')->default('1');
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('roles');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/database/migrations/2017_10_14_214643_create_role_user_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('user_id')->unsigned();
19 | $table->integer('role_id')->unsigned();
20 |
21 | $table->foreign('user_id')
22 | ->references('id')
23 | ->on('users')
24 | ->onDelete('cascade');
25 |
26 | $table->foreign('role_id')
27 | ->references('id')
28 | ->on('roles')
29 | ->onDelete('cascade');
30 | });
31 | }
32 |
33 | /**
34 | * Reverse the migrations.
35 | *
36 | * @return void
37 | */
38 | public function down()
39 | {
40 | Schema::dropIfExists('role_user');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/database/migrations/2017_10_15_214014_create_permissions_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name', 50);
19 | $table->string('slug', 50)->unique();
20 | $table->string('module', 50)->nullable();
21 | $table->text('description')->nullable();
22 | $table->smallInteger('status')->default('1');
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('permissions');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/database/migrations/2017_10_15_214209_create_permission_role_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('permission_id')->unsigned();
19 | $table->integer('role_id')->unsigned();
20 |
21 | $table->foreign('role_id')
22 | ->references('id')
23 | ->on('roles')
24 | ->onDelete('cascade');
25 |
26 | $table->foreign('permission_id')
27 | ->references('id')
28 | ->on('permissions')
29 | ->onDelete('cascade');
30 | });
31 | }
32 |
33 | /**
34 | * Reverse the migrations.
35 | *
36 | * @return void
37 | */
38 | public function down()
39 | {
40 | Schema::dropIfExists('permission_role');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/database/migrations/2017_11_05_021227_create_emails_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('user_id');
19 | $table->string('subject')->nullable();
20 | $table->longText('body')->nullable();
21 | $table->smallInteger('status')->default(1);
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('emails');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/database/migrations/2017_11_05_021609_create_email_user_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('email_id')->unsigned();
19 | $table->integer('user_id')->unsigned();
20 | $table->integer('status')->default(1);
21 | $table->integer('is_read')->default(0);
22 |
23 | $table->foreign('user_id')
24 | ->references('id')
25 | ->on('users')
26 | ->onDelete('cascade');
27 |
28 | $table->foreign('email_id')
29 | ->references('id')
30 | ->on('emails')
31 | ->onDelete('cascade');
32 | });
33 | }
34 |
35 | /**
36 | * Reverse the migrations.
37 | *
38 | * @return void
39 | */
40 | public function down()
41 | {
42 | Schema::dropIfExists('email_user');
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/database/migrations/2017_12_19_191727_AccessLogsTable.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('user_id')->nullable();
19 | $table->string('user_name', 50);
20 | $table->string('user_ip', 50);
21 | $table->string('event', 50);
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('access_logs');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_31_094233_create_categories_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name', 50);
19 | $table->string('slug', 50)->unique();
20 | $table->string('description')->nullable();
21 | $table->smallInteger('status')->default('1');
22 | $table->integer('created_by')->unsigned();
23 | $table->integer('updated_by')->unsigned();
24 | $table->timestamps();
25 | $table->softDeletes();
26 |
27 | $table->foreign('created_by')
28 | ->references('id')
29 | ->on('users');
30 |
31 | $table->foreign('updated_by')
32 | ->references('id')
33 | ->on('users');
34 | });
35 | }
36 |
37 | /**
38 | * Reverse the migrations.
39 | *
40 | * @return void
41 | */
42 | public function down()
43 | {
44 | Schema::dropIfExists('categories');
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/database/migrations/2018_12_31_103509_create_articles_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('title', 124);
19 | $table->integer('category_id')->unsigned();
20 | $table->string('url_alias', 124);
21 | $table->string('author_alias', 50)->nullable();
22 | $table->text('description')->nullable();
23 | $table->string('image', 256)->nullable();
24 | $table->longText('content');
25 | $table->smallInteger('status')->default(1);
26 | $table->smallInteger('highlighted')->default(0);
27 | $table->integer('author_id')->unsigned();
28 | $table->timestamps();
29 | $table->softDeletes();
30 |
31 | $table->foreign('author_id')
32 | ->references('id')
33 | ->on('users');
34 |
35 | $table->foreign('category_id')
36 | ->references('id')
37 | ->on('categories');
38 | });
39 | }
40 |
41 | /**
42 | * Reverse the migrations.
43 | *
44 | * @return void
45 | */
46 | public function down()
47 | {
48 | Schema::dropIfExists('articles');
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/database/migrations/2019_01_12_213959_create_menus_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name', 32);
19 | $table->string('slug', 32);
20 | $table->text('description')->nullable();
21 | $table->smallInteger('status')->default(1);
22 | $table->timestamps();
23 | });
24 | }
25 |
26 | /**
27 | * Reverse the migrations.
28 | *
29 | * @return void
30 | */
31 | public function down()
32 | {
33 | Schema::dropIfExists('menus');
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/database/migrations/2019_01_14_000737_create_settings_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name', 124)->nullable();
19 | $table->string('slug', 124);
20 | $table->string('description', 258)->nullable();
21 | $table->string('section', 64);
22 | $table->string('value', 124)->nullable();
23 | $table->string('type', 32)->default('string');
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('settings');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/database/migrations/2019_01_17_225345_create_modules_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name', 32);
19 | $table->string('slug', 320)->unique();
20 | $table->string('description', 250)->nullable();
21 | $table->smallInteger('can_create')->default(0);
22 | $table->smallInteger('can_read')->default(0);
23 | $table->smallInteger('can_update')->default(0);
24 | $table->smallInteger('can_delete')->default(0);
25 | $table->smallInteger('status')->default(1);
26 | $table->timestamps();
27 | });
28 | }
29 |
30 | /**
31 | * Reverse the migrations.
32 | *
33 | * @return void
34 | */
35 | public function down()
36 | {
37 | Schema::dropIfExists('modules');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/database/migrations/2019_01_19_194442_create_components_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name', 124)->unique();
19 | $table->smallInteger('order')->default(0);
20 | $table->smallInteger('status')->default(1);
21 | $table->text('description')->nullable();
22 | $table->longText('content');
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('components');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/database/migrations/2019_02_11_185344_create_menu_items_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('title', 32);
19 | $table->text('description')->nullable();
20 | $table->string('url', 120);
21 | $table->smallInteger('status')->default(1);
22 | $table->smallInteger('order')->unsigned()->default(1);
23 | $table->integer('menu_id')->unsigned();
24 | $table->timestamps();
25 |
26 | $table->foreign('menu_id')
27 | ->references('id')
28 | ->on('menus')
29 | ->onDelete('cascade');
30 | });
31 | }
32 |
33 | /**
34 | * Reverse the migrations.
35 | *
36 | * @return void
37 | */
38 | public function down()
39 | {
40 | Schema::dropIfExists('menu_items');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/database/seeds/CategoriesTableSeeder.php:
--------------------------------------------------------------------------------
1 | insert([
16 | [
17 | 'name' => 'Default',
18 | 'slug' => 'default',
19 | 'created_by' => 1,
20 | 'created_at' => Carbon::now(),
21 | 'updated_by' => 1,
22 | 'updated_at' => Carbon::now(),
23 | ],
24 | ]);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/database/seeds/ComponentsTableSeeder.php:
--------------------------------------------------------------------------------
1 | insert([]);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call(UsersTableSeeder::class);
15 | $this->call(RolesTableSeeder::class);
16 | $this->call(RoleUserTableSeeder::class);
17 | $this->call(PermissionsTableSeeder::class);
18 | $this->call(PermissionRoleTableSeeder::class);
19 | //$this->call(EmailsTableSeeder::class);
20 | //$this->call(EmailUserTableSeeder::class);
21 | $this->call(CategoriesTableSeeder::class);
22 | $this->call(ArticlesTableSeeder::class);
23 | $this->call(MenusTableSeeder::class);
24 | $this->call(MenuItemsTableSeeder::class);
25 | $this->call(SettingsTableSeeder::class);
26 | //$this->call(ComponentsTableSeeder::class);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/database/seeds/EmailUserTableSeeder.php:
--------------------------------------------------------------------------------
1 | insert([
15 | ['email_id' => 1, 'user_id' => 2],
16 | ['email_id' => 1, 'user_id' => 3],
17 | ]);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/database/seeds/EmailsTableSeeder.php:
--------------------------------------------------------------------------------
1 | insert([
16 | ['user_id' => 1, 'subject' => 'Test 0', 'body' => 'Test', 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()],
17 | ]);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/database/seeds/MenuItemsTableSeeder.php:
--------------------------------------------------------------------------------
1 | insert([
16 | [
17 | 'title' => 'Default',
18 | 'url' => 'default',
19 | 'menu_id' => 1,
20 | 'created_at' => Carbon::now(),
21 | 'updated_at' => Carbon::now(),
22 | ],
23 | ]);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/database/seeds/MenusTableSeeder.php:
--------------------------------------------------------------------------------
1 | insert([
16 | [
17 | 'name' => 'Main menu',
18 | 'slug' => 'main-menu',
19 | 'created_at' => Carbon::now(),
20 | 'updated_at' => Carbon::now(),
21 | ],
22 | ]);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/database/seeds/PermissionRoleTableSeeder.php:
--------------------------------------------------------------------------------
1 | ', 'Modules')
19 | ->get(['id']);
20 |
21 | foreach ($admin_permissions as $value) {
22 | $permissions[] = ['role_id' => 2, 'permission_id' => $value->id];
23 | }
24 |
25 | // Manager permissions
26 | $manager_permissions = Permission::where('module', 'Articles')
27 | ->orWhere('module', 'Categories')
28 | ->orWhere('module', 'Menus')
29 | ->orWhere('module', 'Components')
30 | ->get(['id']);
31 |
32 | foreach ($manager_permissions as $value) {
33 | $permissions[] = ['role_id' => 3, 'permission_id' => $value->id];
34 | }
35 |
36 | DB::table('permission_role')->insert($permissions);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/database/seeds/RoleUserTableSeeder.php:
--------------------------------------------------------------------------------
1 | insert([
15 | ['user_id' => 1, 'role_id' => 1],
16 | ['user_id' => 2, 'role_id' => 2],
17 | ['user_id' => 3, 'role_id' => 3],
18 | ]);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/database/seeds/RolesTableSeeder.php:
--------------------------------------------------------------------------------
1 | insert([
17 | ['name' => 'Super Admin', 'slug' => 'superadmin', 'created_at' => Carbon::now()],
18 | ['name' => 'Administrator', 'slug' => 'admin', 'created_at' => Carbon::now()],
19 | ['name' => 'Manager', 'slug' => 'manager', 'created_at' => Carbon::now()],
20 | ['name' => 'User', 'slug' => 'user', 'created_at' => Carbon::now()],
21 | ]);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "watch": "npm run development -- --watch",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "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",
9 | "prod": "npm run production",
10 | "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"
11 | },
12 | "devDependencies": {
13 | "axios": "^0.18",
14 | "bootstrap": "^4.0.0",
15 | "cross-env": "^5.1",
16 | "jquery": "^3.2",
17 | "laravel-mix": "^4.0.7",
18 | "lodash": "^4.17.5",
19 | "popper.js": "^1.12",
20 | "resolve-url-loader": "^2.3.1",
21 | "sass": "^1.15.2",
22 | "sass-loader": "^7.1.0",
23 | "vue": "^2.5.17"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
{{ __('messages.table.action') }} | 10 | @endif 11 |
---|
22 | 23 | @if ($module->can_read) 24 | @permission('view_' . $module->slug) 25 | {!! show_btn($item->id, $module->slug) !!} 26 | @endif 27 | @endif 28 | 29 | @if ($module->can_update) 30 | @permission('update_' . $module->slug) 31 | {!! edit_btn($item->id, $module->slug) !!} 32 | @endif 33 | @endif 34 | 35 | @if ($module->can_delete) 36 | @permission('delete_' . $module->slug) 37 | {!! delete_btn($item->id, $module->slug) !!} 38 | @endif 39 | @endif 40 | 41 | | 42 |
{{ __('messages.no-results') }} |
6 | {{ $resource->roles->implode('name', ', ') }}. 7 |
8 |{{ $resource->description }}
17 |{{ __('messages.required-fields') }}
36 |5 | | {{ __($name . '.table.to') }} | 6 |{{ __($name . '.table.subject') }} | 7 |{{ __($name . '.table.date') }} | 8 |9 | |
---|---|---|---|---|
15 | 18 | | 19 |20 | 21 | {{ $resource->recipients->pluck('name')->implode(', ') }} 22 | 23 | | 24 |{{ $resource->subject }} | 25 |{{ $resource->created_at->diffForHumans() }} | 26 |27 | {{ Form::open(['method' => 'DELETE','route' => [$name . '.destroy', $resource->id]]) }} 28 | {{ Form::button('', array( 29 | 'type' => 'submit', 30 | 'class'=> 'btn-danger btn-xs', 31 | 'onclick'=>'return confirm("' . __($name . '.confirm-trash') . '")' 32 | )) }} 33 | {{ Form::close() }} 34 | | 35 |
{{ __('emails.table-empty') }} | 39 |
5 | | {{ __($name . '.table.from') }} | 6 |{{ __($name . '.table.subject') }} | 7 |{{ __($name . '.table.date') }} | 8 |9 | | 14 | @if ($resource->recipients->where('id', Auth::id())->first()->pivot->is_read === 0) 15 | 18 | @else 19 | 22 | @endif 23 | | 24 |25 | {{ $resource->user->name }} 26 | | 27 |{{ $resource->subject }} | 28 |{{ $resource->created_at->diffForHumans() }} | 29 |30 | {{ Form::open(['method' => 'DELETE','route' => [$name . '.destroy', $resource->id]]) }} 31 | {{ Form::button('', array( 32 | 'type' => 'submit', 33 | 'class'=> 'btn-danger btn-xs', 34 | 'onclick'=>'return confirm("' . __($name . '.confirm-trash') . '")' 35 | )) }} 36 | {{ Form::close() }} 37 | | 38 | 39 | @empty 40 |
---|---|---|---|---|
{{ __('emails.table-empty') }} | 42 |
5 | | {{ __($name . '.table.to') }} | 6 |{{ __($name . '.table.subject') }} | 7 |{{ __($name . '.table.date') }} | 8 |9 | |
---|---|---|---|---|
15 | 16 | | 17 |18 | 19 | {{ $resource->recipients->pluck('name')->implode(', ') }} 20 | 21 | | 22 |{{ $resource->subject }} | 23 |{{ $resource->created_at->diffForHumans() }} | 24 |25 | {{ Form::open(['method' => 'DELETE','route' => [$name . '.destroy', $resource->id]]) }} 26 | {{ Form::button('', array( 27 | 'type' => 'submit', 28 | 'class'=> 'btn-danger btn-xs', 29 | 'onclick'=>'return confirm("' . __($name . '.confirm-trash') . '")' 30 | )) }} 31 | {{ Form::close() }} 32 | | 33 |
{{ __('emails.table-empty') }} | 37 |
5 | | {{ __($name . '.table.from') }} | 6 |{{ __($name . '.table.subject') }} | 7 |{{ __($name . '.table.date') }} | 8 |9 | | |
---|---|---|---|---|---|
15 | 16 | | 17 |18 | 19 | {{ $resource->user->name }} 20 | 21 | | 22 |{{ $resource->subject }} | 23 |{{ $resource->created_at->diffForHumans() }} | 24 |25 | {{ Form::open(['method' => 'PATCH','route' => [$name . '.restore', $resource->id], 'class' => 'pull-right']) }} 26 | {{ Form::button('', [ 27 | 'type' => 'submit', 28 | 'class'=> 'btn-info btn-xs', 29 | ]) }} 30 | {{ Form::close() }} 31 | | 32 |33 | {{ Form::open(['method' => 'DELETE','route' => [$name . '.destroy', $resource->id], 'class' => 'pull-right']) }} 34 | {{ Form::button('', [ 35 | 'type' => 'submit', 36 | 'class'=> 'btn-danger btn-xs', 37 | 'onclick'=>'return confirm("' . __($name . '.confirm-delete') . '")' 38 | ]) }} 39 | {{ Form::close() }} 40 | | 41 |
{{ __('emails.table-empty') }} | 45 |
{{ str_limit($resource->body, 40) }}
12 | 13 |{{ __('emails.table-empty') }}
18 | 19 |{{ __($name . '.table.id') }} | 5 |{{ __($name . '.table.action') }} | 6 |{{ __($name . '.table.title') }} | 7 |{{ __($name . '.table.author') }} | 8 |{{ __($name . '.table.category') }} | 9 |{{ __($name . '.table.created_at') }} | 10 |{{ __($name . '.table.status') }} | 11 |
---|---|---|---|---|---|---|
{{ $resource->id }} | 18 | @permission('delete_' . $name) 19 |{!! delete_btn($resource->id, $name) !!} | 20 | @endif 21 |22 | @permission('update_' . $name) 23 | {{ $resource->title }} 24 | @else 25 | {{ $resource->title }} 26 | @endif 27 | | 28 |{{ optional($resource->author)->name }} | 29 |{{ optional($resource->category)->name }} | 30 |{{ $resource->created_at->diffForHumans() }} | 31 |{!! status_label($resource->status) !!} | 32 |
{{ __('messages.no-results') }} |
5 | {{ $resource->user->name }} 6 | | 7 |8 | 9 | {{ str_limit($resource->subject, 30) }} 10 | 11 | {{ str_limit($resource->body, 20) }} 12 | | 13 |14 | {{ $resource->created_at->diffForHumans() }} 15 | | 16 |
20 | {{ __('emails.table-empty') }} 21 | | 22 |
{!! str_limit($article->description ?? $article->content, 126, '... read more') !!}
56 |{{ $article->created_at }}
57 |{!! $article->description !!}
30 |Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim.
26 |