├── .editorconfig
├── .env.example
├── .gitattributes
├── .gitignore
├── .styleci.yml
├── README.md
├── app
├── Console
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── Http
│ ├── Controllers
│ │ ├── Admin
│ │ │ ├── HomeController.php
│ │ │ ├── PermissionsController.php
│ │ │ ├── ProductsController.php
│ │ │ ├── RolesController.php
│ │ │ └── UsersController.php
│ │ ├── Api
│ │ │ └── V1
│ │ │ │ └── Admin
│ │ │ │ ├── PermissionsApiController.php
│ │ │ │ ├── ProductsApiController.php
│ │ │ │ ├── RolesApiController.php
│ │ │ │ └── UsersApiController.php
│ │ ├── Auth
│ │ │ ├── ConfirmPasswordController.php
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── RegisterController.php
│ │ │ ├── ResetPasswordController.php
│ │ │ └── VerificationController.php
│ │ ├── Controller.php
│ │ ├── HomeController.php
│ │ ├── ProductsController.php
│ │ └── Traits
│ │ │ └── MediaUploadingTrait.php
│ ├── Kernel.php
│ ├── Middleware
│ │ ├── AuthGates.php
│ │ ├── Authenticate.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── EncryptCookies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── SetLocale.php
│ │ ├── TrimStrings.php
│ │ ├── TrustProxies.php
│ │ └── VerifyCsrfToken.php
│ ├── Requests
│ │ ├── MassDestroyPermissionRequest.php
│ │ ├── MassDestroyProductRequest.php
│ │ ├── MassDestroyRoleRequest.php
│ │ ├── MassDestroyUserRequest.php
│ │ ├── StorePermissionRequest.php
│ │ ├── StoreProductRequest.php
│ │ ├── StoreRoleRequest.php
│ │ ├── StoreUserRequest.php
│ │ ├── UpdatePermissionRequest.php
│ │ ├── UpdateProductRequest.php
│ │ ├── UpdateRoleRequest.php
│ │ └── UpdateUserRequest.php
│ └── Resources
│ │ └── Admin
│ │ ├── PermissionResource.php
│ │ ├── ProductResource.php
│ │ ├── RoleResource.php
│ │ └── UserResource.php
├── Permission.php
├── Product.php
├── Providers
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── BroadcastServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── Role.php
├── Traits
│ └── MultiTenantModelTrait.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
├── panel.php
├── queue.php
├── services.php
├── session.php
└── view.php
├── database
├── .gitignore
├── factories
│ └── UserFactory.php
├── migrations
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ ├── 2019_11_15_000001_create_media_table.php
│ ├── 2019_11_15_000002_create_permissions_table.php
│ ├── 2019_11_15_000003_create_roles_table.php
│ ├── 2019_11_15_000004_create_users_table.php
│ ├── 2019_11_15_000005_create_products_table.php
│ ├── 2019_11_15_000006_create_permission_role_pivot_table.php
│ ├── 2019_11_15_000007_create_role_user_pivot_table.php
│ └── 2019_11_15_000008_add_relationship_fields_to_products_table.php
└── seeds
│ ├── DatabaseSeeder.php
│ ├── PermissionRoleTableSeeder.php
│ ├── PermissionsTableSeeder.php
│ ├── ProductsTableSeeder.php
│ ├── RoleUserTableSeeder.php
│ ├── RolesTableSeeder.php
│ └── UsersTableSeeder.php
├── package-lock.json
├── package.json
├── phpunit.xml
├── public
├── .htaccess
├── css
│ ├── app.css
│ ├── bootstrap.min.css
│ ├── custom.css
│ ├── demo.css
│ ├── font-awesome.min.css
│ ├── magnific-popup.css
│ ├── set1.css
│ ├── set2.css
│ ├── simple-line-icons.css
│ ├── style.css
│ ├── style.css.map
│ ├── swiper.min.css
│ └── themify-icons.css
├── favicon.ico
├── fonts
│ ├── FontAwesome.otf
│ ├── Simple-Line-Icons.eot
│ ├── Simple-Line-Icons.svg
│ ├── Simple-Line-Icons.ttf
│ ├── Simple-Line-Icons.woff
│ ├── Simple-Line-Icons.woff2
│ ├── fontawesome-webfont.eot
│ ├── fontawesome-webfont.svg
│ ├── fontawesome-webfont.ttf
│ ├── fontawesome-webfont.woff
│ ├── fontawesome-webfont.woff2
│ ├── slick.eot
│ ├── slick.svg
│ ├── slick.ttf
│ ├── slick.woff
│ ├── themify.eot
│ ├── themify.svg
│ ├── themify.ttf
│ └── themify.woff
├── images
│ ├── customer-img1.jpg
│ ├── customer-img2.jpg
│ ├── featured1.jpg
│ ├── featured2.jpg
│ ├── featured3.jpg
│ ├── featured4.jpg
│ ├── find-place1.jpg
│ ├── find-place2.jpg
│ ├── find-place3.jpg
│ ├── find-place4.jpg
│ ├── find-place5.jpg
│ ├── follow-img.jpg
│ ├── map.jpg
│ ├── no-image.jpg
│ ├── reserve-slide1.jpg
│ ├── reserve-slide2.jpg
│ ├── reserve-slide3.jpg
│ ├── review-img1.jpg
│ ├── review-img2.jpg
│ ├── review-img3.jpg
│ └── slider.jpg
├── index.php
├── js
│ ├── app.js
│ ├── bootstrap.js
│ ├── bootstrap.min.js
│ ├── jquery-3.2.1.min.js
│ ├── jquery.magnific-popup.js
│ ├── main.js
│ ├── popper.min.js
│ └── swiper.min.js
├── mix-manifest.json
├── robots.txt
└── scss
│ └── style.scss
├── resources
├── js
│ ├── app.js
│ ├── bootstrap.js
│ └── components
│ │ └── ExampleComponent.vue
├── lang
│ └── en
│ │ ├── auth.php
│ │ ├── cruds.php
│ │ ├── global.php
│ │ ├── pagination.php
│ │ ├── panel.php
│ │ ├── passwords.php
│ │ └── validation.php
├── sass
│ ├── _variables.scss
│ └── app.scss
└── views
│ ├── admin
│ ├── home.blade.php
│ ├── permissions
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── products
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── roles
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ └── users
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── auth
│ ├── login.blade.php
│ ├── passwords
│ │ ├── confirm.blade.php
│ │ ├── email.blade.php
│ │ └── reset.blade.php
│ ├── register.blade.php
│ └── verify.blade.php
│ ├── home.blade.php
│ ├── layouts
│ ├── admin.blade.php
│ ├── app.blade.php
│ └── main.blade.php
│ ├── partials
│ ├── footer.blade.php
│ ├── header.blade.php
│ └── menu.blade.php
│ ├── products
│ ├── index.blade.php
│ └── show.blade.php
│ └── search.blade.php
├── routes
├── api.php
├── channels.php
├── console.php
└── web.php
├── server.php
├── storage
├── app
│ └── .gitignore
├── framework
│ ├── .gitignore
│ ├── cache
│ │ └── .gitignore
│ ├── sessions
│ │ └── .gitignore
│ ├── testing
│ │ └── .gitignore
│ └── views
│ │ └── .gitignore
└── logs
│ └── .gitignore
├── tests
├── Browser
│ ├── PermissionsTest.php
│ ├── ProductsTest.php
│ ├── RolesTest.php
│ └── UsersTest.php
├── 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,yaml}]
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=laravel
13 | DB_USERNAME=root
14 | DB_PASSWORD=
15 |
16 | BROADCAST_DRIVER=log
17 | CACHE_DRIVER=file
18 | QUEUE_CONNECTION=sync
19 | SESSION_DRIVER=file
20 | SESSION_LIFETIME=120
21 |
22 | REDIS_HOST=127.0.0.1
23 | REDIS_PASSWORD=null
24 | REDIS_PORT=6379
25 |
26 | MAIL_DRIVER=smtp
27 | MAIL_HOST=smtp.mailtrap.io
28 | MAIL_PORT=2525
29 | MAIL_USERNAME=null
30 | MAIL_PASSWORD=null
31 | MAIL_ENCRYPTION=null
32 |
33 | AWS_ACCESS_KEY_ID=
34 | AWS_SECRET_ACCESS_KEY=
35 | AWS_DEFAULT_REGION=us-east-1
36 | AWS_BUCKET=
37 |
38 | PUSHER_APP_ID=
39 | PUSHER_APP_KEY=
40 | PUSHER_APP_SECRET=
41 | PUSHER_APP_CLUSTER=mt1
42 |
43 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
44 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
45 |
--------------------------------------------------------------------------------
/.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 | .env.backup
8 | .phpunit.result.cache
9 | Homestead.json
10 | Homestead.yaml
11 | npm-debug.log
12 | yarn-error.log
13 |
--------------------------------------------------------------------------------
/.styleci.yml:
--------------------------------------------------------------------------------
1 | php:
2 | preset: laravel
3 | enabled:
4 | - alpha_ordered_imports
5 | disabled:
6 | - length_ordered_imports
7 | - unused_use
8 | finder:
9 | not-name:
10 | - index.php
11 | - server.php
12 | js:
13 | finder:
14 | not-name:
15 | - webpack.mix.js
16 | css: true
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Demo Laravel 6 to show subdomains for every user, so user can register with subdomain "my-company", and their own URL will become `my-company.[main_project].com`
2 |
3 | Project is partly generated with [QuickAdminPanel](https://2019.quickadminpanel.com)
4 |
5 | Front-end theme is [Listing](https://colorlib.com/wp/template/listing/) by [Colorlib](https://colorlib.com/wp/)
6 |
7 | ---
8 |
9 | ## How to use
10 |
11 | - Clone the repository with __git clone__
12 | - Copy __.env.example__ file to __.env__ and edit database credentials there
13 | - Run __composer install__
14 | - Run __php artisan key:generate__
15 | - Run __php artisan migrate --seed__ (it has some seeded data for your testing)
16 | - That's it: launch the main URL
17 | - If you want to login, click `Login` on top-right and use credentials __admin@admin.com__ - __password__
18 | - To configure subdomains, search for your web-server documentation, example `Homestead.yaml` snippet below:
19 |
20 | ```
21 | sites:
22 | - map: company1.project.test
23 | to: /home/vagrant/Code/project/public
24 | - map: company2.project.test
25 | to: /home/vagrant/Code/project/public
26 | - map: project.test
27 | to: /home/vagrant/Code/project/public
28 | ```
29 |
30 | ---
31 |
32 | ## License
33 |
34 | Basically, feel free to use and re-use any way you want.
35 |
36 | ---
37 |
38 | ## More from our LaravelDaily Team
39 |
40 | - Check out our adminpanel generator [QuickAdminPanel](https://quickadminpanel.com)
41 | - Read our [Blog with Laravel Tutorials](https://laraveldaily.com)
42 | - FREE E-book: [50 Laravel Quick Tips (and counting)](https://laraveldaily.com/free-e-book-40-laravel-quick-tips-and-counting/)
43 | - Subscribe to our [YouTube channel Laravel Business](https://www.youtube.com/channel/UCTuplgOBi6tJIlesIboymGA)
44 | - Enroll in our [Laravel Online Courses](https://laraveldaily.teachable.com/)
45 |
--------------------------------------------------------------------------------
/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/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | all());
35 |
36 | return redirect()->route('admin.permissions.index');
37 | }
38 |
39 | public function edit(Permission $permission)
40 | {
41 | abort_if(Gate::denies('permission_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden');
42 |
43 | return view('admin.permissions.edit', compact('permission'));
44 | }
45 |
46 | public function update(UpdatePermissionRequest $request, Permission $permission)
47 | {
48 | $permission->update($request->all());
49 |
50 | return redirect()->route('admin.permissions.index');
51 | }
52 |
53 | public function show(Permission $permission)
54 | {
55 | abort_if(Gate::denies('permission_show'), Response::HTTP_FORBIDDEN, '403 Forbidden');
56 |
57 | return view('admin.permissions.show', compact('permission'));
58 | }
59 |
60 | public function destroy(Permission $permission)
61 | {
62 | abort_if(Gate::denies('permission_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');
63 |
64 | $permission->delete();
65 |
66 | return back();
67 | }
68 |
69 | public function massDestroy(MassDestroyPermissionRequest $request)
70 | {
71 | Permission::whereIn('id', request('ids'))->delete();
72 |
73 | return response(null, Response::HTTP_NO_CONTENT);
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/RolesController.php:
--------------------------------------------------------------------------------
1 | pluck('title', 'id');
31 |
32 | return view('admin.roles.create', compact('permissions'));
33 | }
34 |
35 | public function store(StoreRoleRequest $request)
36 | {
37 | $role = Role::create($request->all());
38 | $role->permissions()->sync($request->input('permissions', []));
39 |
40 | return redirect()->route('admin.roles.index');
41 | }
42 |
43 | public function edit(Role $role)
44 | {
45 | abort_if(Gate::denies('role_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden');
46 |
47 | $permissions = Permission::all()->pluck('title', 'id');
48 |
49 | $role->load('permissions');
50 |
51 | return view('admin.roles.edit', compact('permissions', 'role'));
52 | }
53 |
54 | public function update(UpdateRoleRequest $request, Role $role)
55 | {
56 | $role->update($request->all());
57 | $role->permissions()->sync($request->input('permissions', []));
58 |
59 | return redirect()->route('admin.roles.index');
60 | }
61 |
62 | public function show(Role $role)
63 | {
64 | abort_if(Gate::denies('role_show'), Response::HTTP_FORBIDDEN, '403 Forbidden');
65 |
66 | $role->load('permissions');
67 |
68 | return view('admin.roles.show', compact('role'));
69 | }
70 |
71 | public function destroy(Role $role)
72 | {
73 | abort_if(Gate::denies('role_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');
74 |
75 | $role->delete();
76 |
77 | return back();
78 | }
79 |
80 | public function massDestroy(MassDestroyRoleRequest $request)
81 | {
82 | Role::whereIn('id', request('ids'))->delete();
83 |
84 | return response(null, Response::HTTP_NO_CONTENT);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Admin/UsersController.php:
--------------------------------------------------------------------------------
1 | pluck('title', 'id');
31 |
32 | return view('admin.users.create', compact('roles'));
33 | }
34 |
35 | public function store(StoreUserRequest $request)
36 | {
37 | $user = User::create($request->all());
38 | $user->roles()->sync($request->input('roles', []));
39 |
40 | return redirect()->route('admin.users.index');
41 | }
42 |
43 | public function edit(User $user)
44 | {
45 | abort_if(Gate::denies('user_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden');
46 |
47 | $roles = Role::all()->pluck('title', 'id');
48 |
49 | $user->load('roles');
50 |
51 | return view('admin.users.edit', compact('roles', 'user'));
52 | }
53 |
54 | public function update(UpdateUserRequest $request, User $user)
55 | {
56 | $user->update($request->all());
57 | $user->roles()->sync($request->input('roles', []));
58 |
59 | return redirect()->route('admin.users.index');
60 | }
61 |
62 | public function show(User $user)
63 | {
64 | abort_if(Gate::denies('user_show'), Response::HTTP_FORBIDDEN, '403 Forbidden');
65 |
66 | $user->load('roles');
67 |
68 | return view('admin.users.show', compact('user'));
69 | }
70 |
71 | public function destroy(User $user)
72 | {
73 | abort_if(Gate::denies('user_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');
74 |
75 | $user->delete();
76 |
77 | return back();
78 | }
79 |
80 | public function massDestroy(MassDestroyUserRequest $request)
81 | {
82 | User::whereIn('id', request('ids'))->delete();
83 |
84 | return response(null, Response::HTTP_NO_CONTENT);
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/V1/Admin/PermissionsApiController.php:
--------------------------------------------------------------------------------
1 | all());
26 |
27 | return (new PermissionResource($permission))
28 | ->response()
29 | ->setStatusCode(Response::HTTP_CREATED);
30 | }
31 |
32 | public function show(Permission $permission)
33 | {
34 | abort_if(Gate::denies('permission_show'), Response::HTTP_FORBIDDEN, '403 Forbidden');
35 |
36 | return new PermissionResource($permission);
37 | }
38 |
39 | public function update(UpdatePermissionRequest $request, Permission $permission)
40 | {
41 | $permission->update($request->all());
42 |
43 | return (new PermissionResource($permission))
44 | ->response()
45 | ->setStatusCode(Response::HTTP_ACCEPTED);
46 | }
47 |
48 | public function destroy(Permission $permission)
49 | {
50 | abort_if(Gate::denies('permission_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');
51 |
52 | $permission->delete();
53 |
54 | return response(null, Response::HTTP_NO_CONTENT);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/V1/Admin/ProductsApiController.php:
--------------------------------------------------------------------------------
1 | get());
24 | }
25 |
26 | public function store(StoreProductRequest $request)
27 | {
28 | $product = Product::create($request->all());
29 |
30 | if ($request->input('main_photo', false)) {
31 | $product->addMedia(storage_path('tmp/uploads/' . $request->input('main_photo')))->toMediaCollection('main_photo');
32 | }
33 |
34 | if ($request->input('additional_photos', false)) {
35 | $product->addMedia(storage_path('tmp/uploads/' . $request->input('additional_photos')))->toMediaCollection('additional_photos');
36 | }
37 |
38 | return (new ProductResource($product))
39 | ->response()
40 | ->setStatusCode(Response::HTTP_CREATED);
41 | }
42 |
43 | public function show(Product $product)
44 | {
45 | abort_if(Gate::denies('product_show'), Response::HTTP_FORBIDDEN, '403 Forbidden');
46 |
47 | return new ProductResource($product->load(['created_by']));
48 | }
49 |
50 | public function update(UpdateProductRequest $request, Product $product)
51 | {
52 | $product->update($request->all());
53 |
54 | if ($request->input('main_photo', false)) {
55 | if (!$product->main_photo || $request->input('main_photo') !== $product->main_photo->file_name) {
56 | $product->addMedia(storage_path('tmp/uploads/' . $request->input('main_photo')))->toMediaCollection('main_photo');
57 | }
58 | } elseif ($product->main_photo) {
59 | $product->main_photo->delete();
60 | }
61 |
62 | if ($request->input('additional_photos', false)) {
63 | if (!$product->additional_photos || $request->input('additional_photos') !== $product->additional_photos->file_name) {
64 | $product->addMedia(storage_path('tmp/uploads/' . $request->input('additional_photos')))->toMediaCollection('additional_photos');
65 | }
66 | } elseif ($product->additional_photos) {
67 | $product->additional_photos->delete();
68 | }
69 |
70 | return (new ProductResource($product))
71 | ->response()
72 | ->setStatusCode(Response::HTTP_ACCEPTED);
73 | }
74 |
75 | public function destroy(Product $product)
76 | {
77 | abort_if(Gate::denies('product_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');
78 |
79 | $product->delete();
80 |
81 | return response(null, Response::HTTP_NO_CONTENT);
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/V1/Admin/RolesApiController.php:
--------------------------------------------------------------------------------
1 | get());
21 | }
22 |
23 | public function store(StoreRoleRequest $request)
24 | {
25 | $role = Role::create($request->all());
26 | $role->permissions()->sync($request->input('permissions', []));
27 |
28 | return (new RoleResource($role))
29 | ->response()
30 | ->setStatusCode(Response::HTTP_CREATED);
31 | }
32 |
33 | public function show(Role $role)
34 | {
35 | abort_if(Gate::denies('role_show'), Response::HTTP_FORBIDDEN, '403 Forbidden');
36 |
37 | return new RoleResource($role->load(['permissions']));
38 | }
39 |
40 | public function update(UpdateRoleRequest $request, Role $role)
41 | {
42 | $role->update($request->all());
43 | $role->permissions()->sync($request->input('permissions', []));
44 |
45 | return (new RoleResource($role))
46 | ->response()
47 | ->setStatusCode(Response::HTTP_ACCEPTED);
48 | }
49 |
50 | public function destroy(Role $role)
51 | {
52 | abort_if(Gate::denies('role_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');
53 |
54 | $role->delete();
55 |
56 | return response(null, Response::HTTP_NO_CONTENT);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/V1/Admin/UsersApiController.php:
--------------------------------------------------------------------------------
1 | get());
21 | }
22 |
23 | public function store(StoreUserRequest $request)
24 | {
25 | $user = User::create($request->all());
26 | $user->roles()->sync($request->input('roles', []));
27 |
28 | return (new UserResource($user))
29 | ->response()
30 | ->setStatusCode(Response::HTTP_CREATED);
31 | }
32 |
33 | public function show(User $user)
34 | {
35 | abort_if(Gate::denies('user_show'), Response::HTTP_FORBIDDEN, '403 Forbidden');
36 |
37 | return new UserResource($user->load(['roles']));
38 | }
39 |
40 | public function update(UpdateUserRequest $request, User $user)
41 | {
42 | $user->update($request->all());
43 | $user->roles()->sync($request->input('roles', []));
44 |
45 | return (new UserResource($user))
46 | ->response()
47 | ->setStatusCode(Response::HTTP_ACCEPTED);
48 | }
49 |
50 | public function destroy(User $user)
51 | {
52 | abort_if(Gate::denies('user_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden');
53 |
54 | $user->delete();
55 |
56 | return response(null, Response::HTTP_NO_CONTENT);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ConfirmPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('auth');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ForgotPasswordController.php:
--------------------------------------------------------------------------------
1 | middleware('guest')->except('logout');
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/RegisterController.php:
--------------------------------------------------------------------------------
1 | middleware('guest');
41 | }
42 |
43 | /**
44 | * Get a validator for an incoming registration request.
45 | *
46 | * @param array $data
47 | * @return \Illuminate\Contracts\Validation\Validator
48 | */
49 | protected function validator(array $data)
50 | {
51 | return Validator::make($data, [
52 | 'name' => ['required', 'string', 'max:255'],
53 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
54 | 'password' => ['required', 'string', 'min:8', 'confirmed'],
55 | 'subdomain' => ['required', 'unique:users', 'alpha_dash'],
56 | ]);
57 | }
58 |
59 | /**
60 | * Create a new user instance after a valid registration.
61 | *
62 | * @param array $data
63 | * @return \App\User
64 | */
65 | protected function create(array $data)
66 | {
67 | return User::create([
68 | 'name' => $data['name'],
69 | 'email' => $data['email'],
70 | 'password' => Hash::make($data['password']),
71 | 'subdomain' => $data['subdomain'],
72 | ]);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Auth/ResetPasswordController.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 | take(3)->get();
14 | $companies = User::whereHas('roles', function ($q) {
15 | $q->whereTitle('User');
16 | })->inRandomOrder()->take(8)->get();
17 | return view('home', compact('products', 'companies'));
18 | }
19 |
20 | public function search(Request $request)
21 | {
22 | $products = Product::with('created_by')
23 | ->where('name', 'LIKE', "%$request->search%")
24 | ->orWhere('description', 'LIKE', "%$request->search%")
25 | ->get();
26 |
27 | return view('search', compact('products'));
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/Http/Controllers/ProductsController.php:
--------------------------------------------------------------------------------
1 | whereSubdomain($subdomain)
14 | ->firstOrFail();
15 |
16 | return view('products.index', compact('shop'));
17 | }
18 |
19 | public function show($subdomain, Product $product)
20 | {
21 | $product->load('created_by');
22 |
23 | return view('products.show', compact('product'));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Traits/MediaUploadingTrait.php:
--------------------------------------------------------------------------------
1 | has('size')) {
13 | $this->validate(request(), [
14 | 'file' => 'max:' . request()->input('size') * 1024,
15 | ]);
16 | }
17 |
18 | // If width or height is preset - we are validating it as an image
19 | if (request()->has('width') || request()->has('height')) {
20 | $this->validate(request(), [
21 | 'file' => sprintf(
22 | 'image|dimensions:max_width=%s,max_height=%s',
23 | request()->input('width', 100000),
24 | request()->input('height', 100000)
25 | ),
26 | ]);
27 | }
28 |
29 | $path = storage_path('tmp/uploads');
30 |
31 | try {
32 | if (!file_exists($path)) {
33 | mkdir($path, 0755, true);
34 | }
35 | } catch (\Exception $e) {
36 | }
37 |
38 | $file = $request->file('file');
39 |
40 | $name = uniqid() . '_' . trim($file->getClientOriginalName());
41 |
42 | $file->move($path, $name);
43 |
44 | return response()->json([
45 | 'name' => $name,
46 | 'original_name' => $file->getClientOriginalName(),
47 | ]);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/Http/Kernel.php:
--------------------------------------------------------------------------------
1 | [
19 | 'throttle:60,1',
20 | 'bindings',
21 | \App\Http\Middleware\AuthGates::class,
22 | ],
23 | 'web' => [
24 | \App\Http\Middleware\EncryptCookies::class,
25 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
26 | \Illuminate\Session\Middleware\StartSession::class,
27 | \Illuminate\View\Middleware\ShareErrorsFromSession::class,
28 | \App\Http\Middleware\VerifyCsrfToken::class,
29 | \Illuminate\Routing\Middleware\SubstituteBindings::class,
30 | \App\Http\Middleware\AuthGates::class,
31 | \App\Http\Middleware\SetLocale::class,
32 | ],
33 | ];
34 |
35 | protected $routeMiddleware = [
36 | 'can' => \Illuminate\Auth\Middleware\Authorize::class,
37 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
38 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
39 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
40 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
41 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
42 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
43 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
44 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
45 | ];
46 | }
47 |
--------------------------------------------------------------------------------
/app/Http/Middleware/AuthGates.php:
--------------------------------------------------------------------------------
1 | runningInConsole() && $user) {
16 | $roles = Role::with('permissions')->get();
17 | $permissionsArray = [];
18 |
19 | foreach ($roles as $role) {
20 | foreach ($role->permissions as $permissions) {
21 | $permissionsArray[$permissions->title][] = $role->id;
22 | }
23 | }
24 |
25 | foreach ($permissionsArray as $title => $roles) {
26 | Gate::define($title, function (\App\User $user) use ($roles) {
27 | return count(array_intersect($user->roles->pluck('id')->toArray(), $roles)) > 0;
28 | });
29 | }
30 | }
31 |
32 | return $next($request);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Http/Middleware/Authenticate.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/app/Http/Middleware/CheckForMaintenanceMode.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/home');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Middleware/SetLocale.php:
--------------------------------------------------------------------------------
1 | put('language', request('change_language'));
13 | $language = request('change_language');
14 | } elseif (session('language')) {
15 | $language = session('language');
16 | } elseif (config('panel.primary_language')) {
17 | $language = config('panel.primary_language');
18 | }
19 |
20 | if (isset($language)) {
21 | app()->setLocale($language);
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Middleware/TrimStrings.php:
--------------------------------------------------------------------------------
1 | 'required|array',
23 | 'ids.*' => 'exists:permissions,id',
24 | ];
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Requests/MassDestroyProductRequest.php:
--------------------------------------------------------------------------------
1 | 'required|array',
23 | 'ids.*' => 'exists:products,id',
24 | ];
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Requests/MassDestroyRoleRequest.php:
--------------------------------------------------------------------------------
1 | 'required|array',
23 | 'ids.*' => 'exists:roles,id',
24 | ];
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Requests/MassDestroyUserRequest.php:
--------------------------------------------------------------------------------
1 | 'required|array',
23 | 'ids.*' => 'exists:users,id',
24 | ];
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/Http/Requests/StorePermissionRequest.php:
--------------------------------------------------------------------------------
1 | [
23 | 'required',
24 | ],
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Http/Requests/StoreProductRequest.php:
--------------------------------------------------------------------------------
1 | [
23 | 'required',
24 | ],
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Http/Requests/StoreRoleRequest.php:
--------------------------------------------------------------------------------
1 | [
23 | 'required',
24 | ],
25 | 'permissions.*' => [
26 | 'integer',
27 | ],
28 | 'permissions' => [
29 | 'required',
30 | 'array',
31 | ],
32 | ];
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Http/Requests/StoreUserRequest.php:
--------------------------------------------------------------------------------
1 | [
23 | 'required',
24 | ],
25 | 'email' => [
26 | 'required',
27 | 'unique:users',
28 | ],
29 | 'password' => [
30 | 'required',
31 | ],
32 | 'roles.*' => [
33 | 'integer',
34 | ],
35 | 'roles' => [
36 | 'required',
37 | 'array',
38 | ],
39 | ];
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/Http/Requests/UpdatePermissionRequest.php:
--------------------------------------------------------------------------------
1 | [
23 | 'required',
24 | ],
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Http/Requests/UpdateProductRequest.php:
--------------------------------------------------------------------------------
1 | [
23 | 'required',
24 | ],
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/Http/Requests/UpdateRoleRequest.php:
--------------------------------------------------------------------------------
1 | [
23 | 'required',
24 | ],
25 | 'permissions.*' => [
26 | 'integer',
27 | ],
28 | 'permissions' => [
29 | 'required',
30 | 'array',
31 | ],
32 | ];
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/Http/Requests/UpdateUserRequest.php:
--------------------------------------------------------------------------------
1 | [
23 | 'required',
24 | ],
25 | 'email' => [
26 | 'required',
27 | 'unique:users,email,' . request()->route('user')->id,
28 | ],
29 | 'roles.*' => [
30 | 'integer',
31 | ],
32 | 'roles' => [
33 | 'required',
34 | 'array',
35 | ],
36 | ];
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/Http/Resources/Admin/PermissionResource.php:
--------------------------------------------------------------------------------
1 | belongsToMany(Role::class);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/Product.php:
--------------------------------------------------------------------------------
1 | addMediaConversion('thumb')->width(400)->height(291);
42 | }
43 |
44 | public function getMainPhotoAttribute()
45 | {
46 | $file = $this->getMedia('main_photo')->last();
47 |
48 | if ($file) {
49 | $file->url = $file->getUrl();
50 | $file->thumbnail = $file->getUrl('thumb');
51 | }
52 |
53 | return $file;
54 | }
55 |
56 | public function getAdditionalPhotosAttribute()
57 | {
58 | $files = $this->getMedia('additional_photos');
59 | $files->each(function ($item) {
60 | $item->url = $item->getUrl();
61 | $item->thumbnail = $item->getUrl('thumb');
62 | });
63 |
64 | return $files;
65 | }
66 |
67 | public function created_by()
68 | {
69 | return $this->belongsTo(User::class, 'created_by_id');
70 | }
71 |
72 | public function getPrice()
73 | {
74 | return $this->price ? '$'.number_format($this->price, 2) : 'FREE';
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'App\Policies\ModelPolicy',
18 | ];
19 |
20 | /**
21 | * Register any authentication / authorization services.
22 | *
23 | * @return void
24 | */
25 | public function boot()
26 | {
27 | $this->registerPolicies();
28 |
29 | if (!app()->runningInConsole()) {
30 | Passport::routes();
31 | };
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | [
19 | SendEmailVerificationNotification::class,
20 | ],
21 | ];
22 |
23 | /**
24 | * Register any events for your application.
25 | *
26 | * @return void
27 | */
28 | public function boot()
29 | {
30 | parent::boot();
31 |
32 | //
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/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/Role.php:
--------------------------------------------------------------------------------
1 | belongsToMany(User::class);
30 | }
31 |
32 | public function permissions()
33 | {
34 | return $this->belongsToMany(Permission::class);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Traits/MultiTenantModelTrait.php:
--------------------------------------------------------------------------------
1 | runningInConsole() && auth()->check()) {
13 | $isAdmin = auth()->user()->roles->contains(1);
14 | static::creating(function ($model) use ($isAdmin) {
15 | // Prevent admin from setting his own id - admin entries are global.
16 |
17 | // If required, remove the surrounding IF condition and admins will act as users
18 | if (!$isAdmin) {
19 | $model->created_by_id = auth()->id();
20 | }
21 | });
22 | if (!$isAdmin) {
23 | static::addGlobalScope('created_by_id', function (Builder $builder) {
24 | $builder->where('created_by_id', auth()->id())->orWhereNull('created_by_id');
25 | });
26 | }
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/User.php:
--------------------------------------------------------------------------------
1 | roles()->get()->contains($registrationRole)) {
54 | $user->roles()->attach($registrationRole);
55 | }
56 | });
57 | }
58 |
59 | public function products()
60 | {
61 | return $this->hasMany(Product::class, 'created_by_id', 'id');
62 | }
63 |
64 | public function getEmailVerifiedAtAttribute($value)
65 | {
66 | return $value ? Carbon::createFromFormat('Y-m-d H:i:s', $value)->format(config('panel.date_format') . ' ' . config('panel.time_format')) : null;
67 | }
68 |
69 | public function setEmailVerifiedAtAttribute($value)
70 | {
71 | $this->attributes['email_verified_at'] = $value ? Carbon::createFromFormat(config('panel.date_format') . ' ' . config('panel.time_format'), $value)->format('Y-m-d H:i:s') : null;
72 | }
73 |
74 | public function setPasswordAttribute($input)
75 | {
76 | if ($input) {
77 | $this->attributes['password'] = app('hash')->needsRehash($input) ? Hash::make($input) : $input;
78 | }
79 | }
80 |
81 | public function sendPasswordResetNotification($token)
82 | {
83 | $this->notify(new ResetPassword($token));
84 | }
85 |
86 | public function roles()
87 | {
88 | return $this->belongsToMany(Role::class);
89 | }
90 |
91 | public function randomProductImage()
92 | {
93 | $products = $this->products->pluck('id');
94 | //logger($this->products);
95 | $media = Media::whereCollectionName('main_photo')
96 | ->whereIn('model_id', $products)
97 | ->inRandomOrder()
98 | ->first();
99 |
100 | return $media ? $media->getUrl() : url('images/no-image.jpg');
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/artisan:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env php
2 | make(Illuminate\Contracts\Console\Kernel::class);
34 |
35 | $status = $kernel->handle(
36 | $input = new Symfony\Component\Console\Input\ArgvInput,
37 | new Symfony\Component\Console\Output\ConsoleOutput
38 | );
39 |
40 | /*
41 | |--------------------------------------------------------------------------
42 | | Shutdown The Application
43 | |--------------------------------------------------------------------------
44 | |
45 | | Once Artisan has finished running, we will fire off the shutdown events
46 | | so that any final work may be done by the application before we shut
47 | | down the process. This is the last thing to happen to the request.
48 | |
49 | */
50 |
51 | $kernel->terminate($input, $status);
52 |
53 | exit($status);
54 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "laravel/laravel",
3 | "type": "project",
4 | "description": "The Laravel Framework.",
5 | "keywords": [
6 | "framework",
7 | "laravel"
8 | ],
9 | "license": "MIT",
10 | "require": {
11 | "php": "^7.2",
12 | "bugsnag/bugsnag-laravel": "^2.17",
13 | "doctrine/dbal": "^2.9",
14 | "fideloper/proxy": "^4.0",
15 | "laravel/framework": "^6.2",
16 | "laravel/tinker": "^1.0",
17 | "yajra/laravel-datatables-oracle": "^9.7",
18 | "spatie/laravel-medialibrary": "^7.12",
19 | "laravel/passport": "^7.4"
20 | },
21 | "require-dev": {
22 | "facade/ignition": "^1.4",
23 | "fzaninotto/faker": "^1.4",
24 | "mockery/mockery": "^1.0",
25 | "nunomaduro/collision": "^3.0",
26 | "phpunit/phpunit": "^8.0"
27 | },
28 | "config": {
29 | "optimize-autoloader": true,
30 | "preferred-install": "dist",
31 | "sort-packages": true
32 | },
33 | "extra": {
34 | "laravel": {
35 | "dont-discover": []
36 | }
37 | },
38 | "autoload": {
39 | "psr-4": {
40 | "App\\": "app/"
41 | },
42 | "classmap": [
43 | "database/seeds",
44 | "database/factories"
45 | ]
46 | },
47 | "autoload-dev": {
48 | "psr-4": {
49 | "Tests\\": "tests/"
50 | }
51 | },
52 | "minimum-stability": "dev",
53 | "prefer-stable": true,
54 | "scripts": {
55 | "post-autoload-dump": [
56 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
57 | "@php artisan package:discover --ansi"
58 | ],
59 | "post-root-package-install": [
60 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
61 | ],
62 | "post-create-project-cmd": [
63 | "@php artisan key:generate --ansi"
64 | ]
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 |
44 | 'api' => [
45 | 'driver' => 'passport',
46 | 'provider' => 'users',
47 | 'hash' => false,
48 | ],
49 | ],
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | User Providers
54 | |--------------------------------------------------------------------------
55 | |
56 | | All authentication drivers have a user provider. This defines how the
57 | | users are actually retrieved out of your database or other storage
58 | | mechanisms used by this application to persist your user's data.
59 | |
60 | | If you have multiple user tables or models you may configure multiple
61 | | sources which represent each model / table. These sources may then
62 | | be assigned to any extra authentication guards you have defined.
63 | |
64 | | Supported: "database", "eloquent"
65 | |
66 | */
67 |
68 | 'providers' => [
69 | 'users' => [
70 | 'driver' => 'eloquent',
71 | 'model' => App\User::class,
72 | ],
73 |
74 | // 'users' => [
75 | // 'driver' => 'database',
76 | // 'table' => 'users',
77 | // ],
78 | ],
79 |
80 | /*
81 | |--------------------------------------------------------------------------
82 | | Resetting Passwords
83 | |--------------------------------------------------------------------------
84 | |
85 | | You may specify multiple password reset configurations if you have more
86 | | than one user table or model in the application and you want to have
87 | | separate password reset settings based on the specific user types.
88 | |
89 | | The expire time is the number of minutes that the reset token should be
90 | | considered valid. This security feature keeps tokens short-lived so
91 | | they have less time to be guessed. You may change this as needed.
92 | |
93 | */
94 |
95 | 'passwords' => [
96 | 'users' => [
97 | 'provider' => 'users',
98 | 'table' => 'password_resets',
99 | 'expire' => 60,
100 | ],
101 | ],
102 |
103 | ];
104 |
--------------------------------------------------------------------------------
/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 | 'useTLS' => 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/cache.php:
--------------------------------------------------------------------------------
1 | env('CACHE_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Cache Stores
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may define all of the cache "stores" for your application as
29 | | well as their drivers. You may even define multiple stores for the
30 | | same cache driver to group types of items stored in your caches.
31 | |
32 | */
33 |
34 | 'stores' => [
35 |
36 | 'apc' => [
37 | 'driver' => 'apc',
38 | ],
39 |
40 | 'array' => [
41 | 'driver' => 'array',
42 | ],
43 |
44 | 'database' => [
45 | 'driver' => 'database',
46 | 'table' => 'cache',
47 | 'connection' => null,
48 | ],
49 |
50 | 'file' => [
51 | 'driver' => 'file',
52 | 'path' => storage_path('framework/cache/data'),
53 | ],
54 |
55 | 'memcached' => [
56 | 'driver' => 'memcached',
57 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
58 | 'sasl' => [
59 | env('MEMCACHED_USERNAME'),
60 | env('MEMCACHED_PASSWORD'),
61 | ],
62 | 'options' => [
63 | // Memcached::OPT_CONNECT_TIMEOUT => 2000,
64 | ],
65 | 'servers' => [
66 | [
67 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
68 | 'port' => env('MEMCACHED_PORT', 11211),
69 | 'weight' => 100,
70 | ],
71 | ],
72 | ],
73 |
74 | 'redis' => [
75 | 'driver' => 'redis',
76 | 'connection' => 'cache',
77 | ],
78 |
79 | 'dynamodb' => [
80 | 'driver' => 'dynamodb',
81 | 'key' => env('AWS_ACCESS_KEY_ID'),
82 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
83 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
84 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
85 | 'endpoint' => env('DYNAMODB_ENDPOINT'),
86 | ],
87 |
88 | ],
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Cache Key Prefix
93 | |--------------------------------------------------------------------------
94 | |
95 | | When utilizing a RAM based store such as APC or Memcached, there might
96 | | be other applications utilizing the same cache. So, we'll specify a
97 | | value to get prefixed to all our keys so we can avoid collisions.
98 | |
99 | */
100 |
101 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
102 |
103 | ];
104 |
--------------------------------------------------------------------------------
/config/filesystems.php:
--------------------------------------------------------------------------------
1 | env('FILESYSTEM_DRIVER', 'local'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Default Cloud Filesystem Disk
21 | |--------------------------------------------------------------------------
22 | |
23 | | Many applications store files both locally and in the cloud. For this
24 | | reason, you may specify a default "cloud" driver here. This driver
25 | | will be bound as the Cloud disk implementation in the container.
26 | |
27 | */
28 |
29 | 'cloud' => env('FILESYSTEM_CLOUD', 's3'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Filesystem Disks
34 | |--------------------------------------------------------------------------
35 | |
36 | | Here you may configure as many filesystem "disks" as you wish, and you
37 | | may even configure multiple disks of the same driver. Defaults have
38 | | been setup for each driver as an example of the required options.
39 | |
40 | | Supported Drivers: "local", "ftp", "sftp", "s3"
41 | |
42 | */
43 |
44 | 'disks' => [
45 |
46 | 'local' => [
47 | 'driver' => 'local',
48 | 'root' => storage_path('app'),
49 | ],
50 |
51 | 'public' => [
52 | 'driver' => 'local',
53 | 'root' => storage_path('app/public'),
54 | 'url' => env('APP_URL').'/storage',
55 | 'visibility' => 'public',
56 | ],
57 |
58 | 's3' => [
59 | 'driver' => 's3',
60 | 'key' => env('AWS_ACCESS_KEY_ID'),
61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
62 | 'region' => env('AWS_DEFAULT_REGION'),
63 | 'bucket' => env('AWS_BUCKET'),
64 | 'url' => env('AWS_URL'),
65 | ],
66 |
67 | ],
68 |
69 | ];
70 |
--------------------------------------------------------------------------------
/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/logging.php:
--------------------------------------------------------------------------------
1 | env('LOG_CHANNEL', 'stack'),
21 |
22 | /*
23 | |--------------------------------------------------------------------------
24 | | Log Channels
25 | |--------------------------------------------------------------------------
26 | |
27 | | Here you may configure the log channels for your application. Out of
28 | | the box, Laravel uses the Monolog PHP logging library. This gives
29 | | you a variety of powerful log handlers / formatters to utilize.
30 | |
31 | | Available Drivers: "single", "daily", "slack", "syslog",
32 | | "errorlog", "monolog",
33 | | "custom", "stack"
34 | |
35 | */
36 |
37 | 'channels' => [
38 | 'stack' => [
39 | 'driver' => 'stack',
40 | 'channels' => ['single', 'bugsnag'],
41 | 'ignore_exceptions' => false,
42 | ],
43 |
44 | 'single' => [
45 | 'driver' => 'single',
46 | 'path' => storage_path('logs/laravel.log'),
47 | 'level' => 'debug',
48 | ],
49 |
50 | 'daily' => [
51 | 'driver' => 'daily',
52 | 'path' => storage_path('logs/laravel.log'),
53 | 'level' => 'debug',
54 | 'days' => 14,
55 | ],
56 |
57 | 'slack' => [
58 | 'driver' => 'slack',
59 | 'url' => env('LOG_SLACK_WEBHOOK_URL'),
60 | 'username' => 'Laravel Log',
61 | 'emoji' => ':boom:',
62 | 'level' => 'critical',
63 | ],
64 |
65 | 'papertrail' => [
66 | 'driver' => 'monolog',
67 | 'level' => 'debug',
68 | 'handler' => SyslogUdpHandler::class,
69 | 'handler_with' => [
70 | 'host' => env('PAPERTRAIL_URL'),
71 | 'port' => env('PAPERTRAIL_PORT'),
72 | ],
73 | ],
74 |
75 | 'stderr' => [
76 | 'driver' => 'monolog',
77 | 'handler' => StreamHandler::class,
78 | 'formatter' => env('LOG_STDERR_FORMATTER'),
79 | 'with' => [
80 | 'stream' => 'php://stderr',
81 | ],
82 | ],
83 |
84 | 'syslog' => [
85 | 'driver' => 'syslog',
86 | 'level' => 'debug',
87 | ],
88 |
89 | 'errorlog' => [
90 | 'driver' => 'errorlog',
91 | 'level' => 'debug',
92 | ],
93 |
94 | 'null' => [
95 | 'driver' => 'monolog',
96 | 'handler' => NullHandler::class,
97 | ],
98 |
99 | 'bugsnag' => [
100 | 'driver' => 'bugsnag',
101 | ],
102 | ],
103 |
104 | ];
105 |
--------------------------------------------------------------------------------
/config/panel.php:
--------------------------------------------------------------------------------
1 | 'Y-m-d',
5 | 'time_format' => 'H:i:s',
6 | 'primary_language' => 'en',
7 | 'available_languages' => [
8 | 'en' => 'English',
9 | ],
10 | 'registration_default_role' => '2',
11 | ];
12 |
--------------------------------------------------------------------------------
/config/queue.php:
--------------------------------------------------------------------------------
1 | env('QUEUE_CONNECTION', 'sync'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Queue Connections
21 | |--------------------------------------------------------------------------
22 | |
23 | | Here you may configure the connection information for each server that
24 | | is used by your application. A default configuration has been added
25 | | for each back-end shipped with Laravel. You are free to add more.
26 | |
27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'sync' => [
34 | 'driver' => 'sync',
35 | ],
36 |
37 | 'database' => [
38 | 'driver' => 'database',
39 | 'table' => 'jobs',
40 | 'queue' => 'default',
41 | 'retry_after' => 90,
42 | ],
43 |
44 | 'beanstalkd' => [
45 | 'driver' => 'beanstalkd',
46 | 'host' => 'localhost',
47 | 'queue' => 'default',
48 | 'retry_after' => 90,
49 | 'block_for' => 0,
50 | ],
51 |
52 | 'sqs' => [
53 | 'driver' => 'sqs',
54 | 'key' => env('AWS_ACCESS_KEY_ID'),
55 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
56 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
57 | 'queue' => env('SQS_QUEUE', 'your-queue-name'),
58 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
59 | ],
60 |
61 | 'redis' => [
62 | 'driver' => 'redis',
63 | 'connection' => 'default',
64 | 'queue' => env('REDIS_QUEUE', 'default'),
65 | 'retry_after' => 90,
66 | 'block_for' => null,
67 | ],
68 |
69 | ],
70 |
71 | /*
72 | |--------------------------------------------------------------------------
73 | | Failed Queue Jobs
74 | |--------------------------------------------------------------------------
75 | |
76 | | These options configure the behavior of failed queue job logging so you
77 | | can control which database and table are used to store the jobs that
78 | | have failed. You may change them to any database / table you wish.
79 | |
80 | */
81 |
82 | 'failed' => [
83 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
84 | 'database' => env('DB_CONNECTION', 'mysql'),
85 | 'table' => 'failed_jobs',
86 | ],
87 |
88 | ];
89 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'postmark' => [
24 | 'token' => env('POSTMARK_TOKEN'),
25 | ],
26 |
27 | 'ses' => [
28 | 'key' => env('AWS_ACCESS_KEY_ID'),
29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'),
30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
31 | ],
32 |
33 | ];
34 |
--------------------------------------------------------------------------------
/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 | *.sqlite-journal
3 |
--------------------------------------------------------------------------------
/database/factories/UserFactory.php:
--------------------------------------------------------------------------------
1 | define(User::class, function (Faker $faker) {
20 | return [
21 | 'name' => $faker->name,
22 | 'email' => $faker->unique()->safeEmail,
23 | 'email_verified_at' => now(),
24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
25 | 'remember_token' => Str::random(10),
26 | ];
27 | });
28 |
--------------------------------------------------------------------------------
/database/migrations/2014_10_12_100000_create_password_resets_table.php:
--------------------------------------------------------------------------------
1 | string('email')->index();
18 | $table->string('token');
19 | $table->timestamp('created_at')->nullable();
20 | });
21 | }
22 |
23 | /**
24 | * Reverse the migrations.
25 | *
26 | * @return void
27 | */
28 | public function down()
29 | {
30 | Schema::dropIfExists('password_resets');
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/migrations/2019_11_15_000001_create_media_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
13 | $table->morphs('model');
14 | $table->string('collection_name');
15 | $table->string('name');
16 | $table->string('file_name');
17 | $table->string('mime_type')->nullable();
18 | $table->string('disk');
19 | $table->unsignedInteger('size');
20 | $table->json('manipulations');
21 | $table->json('custom_properties');
22 | $table->json('responsive_images');
23 | $table->unsignedInteger('order_column')->nullable();
24 | $table->nullableTimestamps();
25 | });
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/database/migrations/2019_11_15_000002_create_permissions_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
13 |
14 | $table->string('title')->nullable();
15 |
16 | $table->timestamps();
17 |
18 | $table->softDeletes();
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/database/migrations/2019_11_15_000003_create_roles_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
13 |
14 | $table->string('title')->nullable();
15 |
16 | $table->timestamps();
17 |
18 | $table->softDeletes();
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/database/migrations/2019_11_15_000004_create_users_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
13 |
14 | $table->string('name');
15 |
16 | $table->string('email')->unique();
17 |
18 | $table->datetime('email_verified_at')->nullable();
19 |
20 | $table->string('password');
21 |
22 | $table->string('remember_token')->nullable();
23 |
24 | $table->string('subdomain')->nullable();
25 |
26 | $table->timestamps();
27 |
28 | $table->softDeletes();
29 | });
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/database/migrations/2019_11_15_000005_create_products_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
13 |
14 | $table->string('name');
15 |
16 | $table->longText('description')->nullable();
17 |
18 | $table->decimal('price', 15, 2)->nullable();
19 |
20 | $table->timestamps();
21 |
22 | $table->softDeletes();
23 | });
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/database/migrations/2019_11_15_000006_create_permission_role_pivot_table.php:
--------------------------------------------------------------------------------
1 | unsignedInteger('role_id');
13 |
14 | $table->foreign('role_id', 'role_id_fk_608129')->references('id')->on('roles')->onDelete('cascade');
15 |
16 | $table->unsignedInteger('permission_id');
17 |
18 | $table->foreign('permission_id', 'permission_id_fk_608129')->references('id')->on('permissions')->onDelete('cascade');
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/database/migrations/2019_11_15_000007_create_role_user_pivot_table.php:
--------------------------------------------------------------------------------
1 | unsignedInteger('user_id');
13 |
14 | $table->foreign('user_id', 'user_id_fk_608138')->references('id')->on('users')->onDelete('cascade');
15 |
16 | $table->unsignedInteger('role_id');
17 |
18 | $table->foreign('role_id', 'role_id_fk_608138')->references('id')->on('roles')->onDelete('cascade');
19 | });
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/database/migrations/2019_11_15_000008_add_relationship_fields_to_products_table.php:
--------------------------------------------------------------------------------
1 | unsignedInteger('created_by_id')->nullable();
13 |
14 | $table->foreign('created_by_id', 'created_by_fk_608185')->references('id')->on('users');
15 | });
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/database/seeds/DatabaseSeeder.php:
--------------------------------------------------------------------------------
1 | call([
10 | PermissionsTableSeeder::class,
11 | RolesTableSeeder::class,
12 | PermissionRoleTableSeeder::class,
13 | UsersTableSeeder::class,
14 | RoleUserTableSeeder::class,
15 | ProductsTableSeeder::class,
16 | ]);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/database/seeds/PermissionRoleTableSeeder.php:
--------------------------------------------------------------------------------
1 | permissions()->sync($admin_permissions->pluck('id'));
13 | $user_permissions = $admin_permissions->filter(function ($permission) {
14 | return substr($permission->title, 0, 5) != 'user_' && substr($permission->title, 0, 5) != 'role_' && substr($permission->title, 0, 11) != 'permission_';
15 | });
16 | Role::findOrFail(2)->permissions()->sync($user_permissions);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/database/seeds/PermissionsTableSeeder.php:
--------------------------------------------------------------------------------
1 | '1',
13 | 'title' => 'user_management_access',
14 | ],
15 | [
16 | 'id' => '2',
17 | 'title' => 'permission_create',
18 | ],
19 | [
20 | 'id' => '3',
21 | 'title' => 'permission_edit',
22 | ],
23 | [
24 | 'id' => '4',
25 | 'title' => 'permission_show',
26 | ],
27 | [
28 | 'id' => '5',
29 | 'title' => 'permission_delete',
30 | ],
31 | [
32 | 'id' => '6',
33 | 'title' => 'permission_access',
34 | ],
35 | [
36 | 'id' => '7',
37 | 'title' => 'role_create',
38 | ],
39 | [
40 | 'id' => '8',
41 | 'title' => 'role_edit',
42 | ],
43 | [
44 | 'id' => '9',
45 | 'title' => 'role_show',
46 | ],
47 | [
48 | 'id' => '10',
49 | 'title' => 'role_delete',
50 | ],
51 | [
52 | 'id' => '11',
53 | 'title' => 'role_access',
54 | ],
55 | [
56 | 'id' => '12',
57 | 'title' => 'user_create',
58 | ],
59 | [
60 | 'id' => '13',
61 | 'title' => 'user_edit',
62 | ],
63 | [
64 | 'id' => '14',
65 | 'title' => 'user_show',
66 | ],
67 | [
68 | 'id' => '15',
69 | 'title' => 'user_delete',
70 | ],
71 | [
72 | 'id' => '16',
73 | 'title' => 'user_access',
74 | ],
75 | [
76 | 'id' => '17',
77 | 'title' => 'product_create',
78 | ],
79 | [
80 | 'id' => '18',
81 | 'title' => 'product_edit',
82 | ],
83 | [
84 | 'id' => '19',
85 | 'title' => 'product_show',
86 | ],
87 | [
88 | 'id' => '20',
89 | 'title' => 'product_delete',
90 | ],
91 | [
92 | 'id' => '21',
93 | 'title' => 'product_access',
94 | ],
95 | ];
96 |
97 | Permission::insert($permissions);
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/database/seeds/ProductsTableSeeder.php:
--------------------------------------------------------------------------------
1 | $faker->sentence(4),
22 | 'description' => $faker->paragraph(4),
23 | 'price' => $faker->randomFloat(2, 0, 100),
24 | 'created_by_id' => $id,
25 | ]);
26 |
27 | $product->addMediaFromUrl(public_path("images/featured$index.jpg"))->toMediaCollection('main_photo');
28 | foreach($faker->randomElements(range(1,3), 3) as $index)
29 | {
30 | $product->addMediaFromUrl(public_path("images/reserve-slide$index.jpg"))->toMediaCollection('additional_photos');
31 | }
32 | }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/database/seeds/RoleUserTableSeeder.php:
--------------------------------------------------------------------------------
1 | roles()->sync(1);
11 | User::findOrFail(2)->roles()->sync(2);
12 | User::findOrFail(3)->roles()->sync(2);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/database/seeds/RolesTableSeeder.php:
--------------------------------------------------------------------------------
1 | 1,
13 | 'title' => 'Admin',
14 | ],
15 | [
16 | 'id' => 2,
17 | 'title' => 'User',
18 | ],
19 | ];
20 |
21 | Role::insert($roles);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/database/seeds/UsersTableSeeder.php:
--------------------------------------------------------------------------------
1 | 1,
13 | 'name' => 'Admin',
14 | 'email' => 'admin@admin.com',
15 | 'password' => '$2y$10$bvYhN6JwpRJ/3e8mwEzpiu9YUxDi0QfbJM3GjQAa9fiz0QE5SACB6',
16 | 'remember_token' => null,
17 | 'subdomain' => null,
18 | ],
19 | [
20 | 'id' => 2,
21 | 'name' => 'Company 1',
22 | 'email' => 'company1@company1.com',
23 | 'password' => '$2y$10$bvYhN6JwpRJ/3e8mwEzpiu9YUxDi0QfbJM3GjQAa9fiz0QE5SACB6',
24 | 'remember_token' => null,
25 | 'subdomain' => 'company1',
26 | ],
27 | [
28 | 'id' => 3,
29 | 'name' => 'Company 2',
30 | 'email' => 'company2@company2.com',
31 | 'password' => '$2y$10$bvYhN6JwpRJ/3e8mwEzpiu9YUxDi0QfbJM3GjQAa9fiz0QE5SACB6',
32 | 'remember_token' => null,
33 | 'subdomain' => 'company2',
34 | ],
35 | ];
36 |
37 | User::insert($users);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/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.19",
14 | "bootstrap": "^4.0.0",
15 | "cross-env": "^5.1",
16 | "jquery": "^3.2",
17 | "laravel-mix": "^4.0.7",
18 | "lodash": "^4.17.13",
19 | "popper.js": "^1.12",
20 | "resolve-url-loader": "^2.3.1",
21 | "sass": "^1.20.1",
22 | "sass-loader": "7.*",
23 | "vue": "^2.5.17",
24 | "vue-template-compiler": "^2.6.10"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/phpunit.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 | {{ trans('cruds.permission.fields.id') }} 16 | | 17 |18 | {{ $permission->id }} 19 | | 20 |
---|---|
23 | {{ trans('cruds.permission.fields.title') }} 24 | | 25 |26 | {{ $permission->title }} 27 | | 28 |
15 | {{ trans('cruds.product.fields.id') }} 16 | | 17 |18 | {{ $product->id }} 19 | | 20 |
---|---|
23 | {{ trans('cruds.product.fields.name') }} 24 | | 25 |26 | {{ $product->name }} 27 | | 28 |
31 | {{ trans('cruds.product.fields.description') }} 32 | | 33 |34 | {!! $product->description !!} 35 | | 36 |
39 | {{ trans('cruds.product.fields.price') }} 40 | | 41 |42 | ${{ $product->price }} 43 | | 44 |
47 | {{ trans('cruds.product.fields.main_photo') }} 48 | | 49 |
50 | @if($product->main_photo)
51 |
52 | |
56 |
59 | {{ trans('cruds.product.fields.additional_photos') }} 60 | | 61 |
62 | @foreach($product->additional_photos as $key => $media)
63 |
64 | |
68 |
15 | {{ trans('cruds.role.fields.id') }} 16 | | 17 |18 | {{ $role->id }} 19 | | 20 |
---|---|
23 | {{ trans('cruds.role.fields.title') }} 24 | | 25 |26 | {{ $role->title }} 27 | | 28 |
31 | Permissions 32 | | 33 |34 | @foreach($role->permissions as $id => $permissions) 35 | {{ $permissions->title }} 36 | @endforeach 37 | | 38 |
15 | {{ trans('cruds.user.fields.id') }} 16 | | 17 |18 | {{ $user->id }} 19 | | 20 |
---|---|
23 | {{ trans('cruds.user.fields.name') }} 24 | | 25 |26 | {{ $user->name }} 27 | | 28 |
31 | {{ trans('cruds.user.fields.email') }} 32 | | 33 |34 | {{ $user->email }} 35 | | 36 |
39 | {{ trans('cruds.user.fields.email_verified_at') }} 40 | | 41 |42 | {{ $user->email_verified_at }} 43 | | 44 |
47 | Roles 48 | | 49 |50 | @foreach($user->roles as $id => $roles) 51 | {{ $roles->title }} 52 | @endforeach 53 | | 54 |
57 | {{ trans('cruds.user.fields.subdomain') }} 58 | | 59 |60 | {{ $user->subdomain }} 61 | | 62 |
{{ trans('global.login') }}
10 | 11 | @if(session('status')) 12 |{{ trans('global.reset_password') }}
10 | 11 | @if(session('status')) 12 |{{ trans('global.reset_password') }}
10 | 11 | 46 |{{ $product->description }}
53 |