├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .styleci.yml ├── README.md ├── app ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Admin │ │ │ ├── HomeController.php │ │ │ ├── PermissionsController.php │ │ │ ├── ProductCategoryController.php │ │ │ ├── ProductController.php │ │ │ ├── ProductTagController.php │ │ │ ├── RolesController.php │ │ │ └── UsersController.php │ │ ├── Api │ │ │ └── V1 │ │ │ │ ├── Admin │ │ │ │ ├── PermissionsApiController.php │ │ │ │ ├── ProductApiController.php │ │ │ │ ├── ProductCategoryApiController.php │ │ │ │ ├── ProductTagApiController.php │ │ │ │ ├── RolesApiController.php │ │ │ │ └── UsersApiController.php │ │ │ │ ├── CategoryController.php │ │ │ │ └── ProductController.php │ │ ├── Auth │ │ │ ├── ConfirmPasswordController.php │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ ├── ResetPasswordController.php │ │ │ └── VerificationController.php │ │ ├── Controller.php │ │ ├── HomeController.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 │ │ ├── MassDestroyProductCategoryRequest.php │ │ ├── MassDestroyProductRequest.php │ │ ├── MassDestroyProductTagRequest.php │ │ ├── MassDestroyRoleRequest.php │ │ ├── MassDestroyUserRequest.php │ │ ├── StorePermissionRequest.php │ │ ├── StoreProductCategoryRequest.php │ │ ├── StoreProductRequest.php │ │ ├── StoreProductTagRequest.php │ │ ├── StoreRoleRequest.php │ │ ├── StoreUserRequest.php │ │ ├── UpdatePermissionRequest.php │ │ ├── UpdateProductCategoryRequest.php │ │ ├── UpdateProductRequest.php │ │ ├── UpdateProductTagRequest.php │ │ ├── UpdateRoleRequest.php │ │ └── UpdateUserRequest.php │ └── Resources │ │ └── Admin │ │ ├── PermissionResource.php │ │ ├── ProductCategoryResource.php │ │ ├── ProductResource.php │ │ ├── ProductTagResource.php │ │ ├── RoleResource.php │ │ └── UserResource.php ├── Permission.php ├── Product.php ├── ProductCategory.php ├── ProductTag.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Role.php └── User.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── apidoc.php ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.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 │ ├── 2020_03_23_000001_create_media_table.php │ ├── 2020_03_23_000002_create_permissions_table.php │ ├── 2020_03_23_000003_create_roles_table.php │ ├── 2020_03_23_000004_create_users_table.php │ ├── 2020_03_23_000005_create_product_categories_table.php │ ├── 2020_03_23_000006_create_product_tags_table.php │ ├── 2020_03_23_000007_create_products_table.php │ ├── 2020_03_23_000008_create_permission_role_pivot_table.php │ ├── 2020_03_23_000009_create_role_user_pivot_table.php │ ├── 2020_03_23_000010_create_product_product_category_pivot_table.php │ └── 2020_03_23_000011_create_product_product_tag_pivot_table.php └── seeds │ ├── DatabaseSeeder.php │ ├── PermissionRoleTableSeeder.php │ ├── PermissionsTableSeeder.php │ ├── ProductCategoriesTableSeeder.php │ ├── ProductsTableSeeder.php │ ├── RoleUserTableSeeder.php │ ├── RolesTableSeeder.php │ └── UsersTableSeeder.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── css │ ├── app.css │ ├── custom.css │ ├── loading.css │ └── shop-homepage.css ├── docs │ ├── collection.json │ ├── css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ └── style.css │ ├── images │ │ ├── logo.png │ │ └── navbar.png │ ├── index.html │ └── js │ │ └── all.js ├── favicon.ico ├── images │ └── product.jpg ├── index.php ├── js │ ├── app.js │ ├── app.js.LICENSE.txt │ └── main.js ├── mix-manifest.json ├── robots.txt └── vendor │ ├── bootstrap │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map │ └── jquery │ ├── jquery.js │ ├── jquery.min.js │ ├── jquery.min.map │ ├── jquery.slim.js │ ├── jquery.slim.min.js │ └── jquery.slim.min.map ├── resources ├── docs │ ├── css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ └── style.css │ ├── images │ │ ├── logo.png │ │ └── navbar.png │ ├── js │ │ └── all.js │ └── source │ │ ├── .compare.md │ │ ├── .gitignore │ │ ├── assets │ │ ├── images │ │ │ ├── logo.png │ │ │ └── navbar.png │ │ ├── js │ │ │ ├── lib │ │ │ │ ├── energize.js │ │ │ │ ├── highlight.min.js │ │ │ │ ├── imagesloaded.min.js │ │ │ │ ├── jquery.highlight.js │ │ │ │ ├── jquery.min.js │ │ │ │ ├── jquery.tocify.js │ │ │ │ ├── jquery_ui.js │ │ │ │ └── lunr.js │ │ │ └── script.js │ │ └── stylus │ │ │ ├── _icon_font.styl │ │ │ ├── _monokai.css │ │ │ ├── _normalize.css │ │ │ ├── _variables.styl │ │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ │ │ └── style.styl │ │ ├── config.php │ │ ├── gulpfile.js │ │ ├── includes │ │ └── _errors.md │ │ ├── index.md │ │ └── package.json ├── js │ ├── app.js │ ├── bootstrap.js │ ├── components │ │ ├── Front │ │ │ ├── Category.vue │ │ │ ├── Index.vue │ │ │ └── Product.vue │ │ └── ThePagination.vue │ └── helpers │ │ └── pagination.js ├── 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 │ ├── productCategories │ │ ├── create.blade.php │ │ ├── edit.blade.php │ │ ├── index.blade.php │ │ └── show.blade.php │ ├── productTags │ │ ├── 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 │ └── front.blade.php │ ├── partials │ └── menu.blade.php │ ├── vue.blade.php │ └── welcome.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 │ ├── ProductCategoryTest.php │ ├── ProductTagTest.php │ ├── ProductTest.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_MAILER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | MAIL_FROM_ADDRESS=null 33 | MAIL_FROM_NAME="${APP_NAME}" 34 | 35 | AWS_ACCESS_KEY_ID= 36 | AWS_SECRET_ACCESS_KEY= 37 | AWS_DEFAULT_REGION=us-east-1 38 | AWS_BUCKET= 39 | 40 | PUSHER_APP_ID= 41 | PUSHER_APP_KEY= 42 | PUSHER_APP_SECRET= 43 | PUSHER_APP_CLUSTER=mt1 44 | 45 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 46 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 47 | -------------------------------------------------------------------------------- /.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 | disabled: 4 | - unused_use 5 | finder: 6 | not-name: 7 | - index.php 8 | - server.php 9 | js: 10 | finder: 11 | not-name: 12 | - webpack.mix.js 13 | css: true 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Laravel+Blade vs Laravel+Vue.js: Simple Demo 2 | 3 | Simple project showing how product catalog can be loaded with only back-end MVC with Blade, and with front-end Vue.js, calling data from API. 4 | 5 | ![Laravel + Vue.js](https://quickadminpanel.com/blog/wp-content/uploads/2020/03/Screen-Shot-2020-03-27-at-8.37.39-AM.png) 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 and domain there 13 | - Run __composer install__ 14 | - Run __php artisan key:generate__ 15 | - Run __php artisan migrate --seed__ (it will seed some dummy data for you) 16 | - Run __php artisan passport:install__ 17 | - That's it - load the homepage, use two links on the right to feel the difference 18 | 19 | --- 20 | 21 | ### License 22 | 23 | Please use and re-use however you want. 24 | 25 | --- 26 | 27 | ## More from our LaravelDaily Team 28 | 29 | - Check out our adminpanel generator [QuickAdminPanel](https://quickadminpanel.com) 30 | - Subscribe to our [YouTube channel Laravel Business](https://www.youtube.com/channel/UCTuplgOBi6tJIlesIboymGA) 31 | - Enroll in our [Laravel Online Courses](https://laraveldaily.teachable.com/) 32 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 28 | } 29 | 30 | /** 31 | * Register the commands for the application. 32 | * 33 | * @return void 34 | */ 35 | protected function commands() 36 | { 37 | $this->load(__DIR__.'/Commands'); 38 | 39 | require base_path('routes/console.php'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | all()); 35 | 36 | return redirect()->route('admin.permissions.index'); 37 | 38 | } 39 | 40 | public function edit(Permission $permission) 41 | { 42 | abort_if(Gate::denies('permission_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 43 | 44 | return view('admin.permissions.edit', compact('permission')); 45 | } 46 | 47 | public function update(UpdatePermissionRequest $request, Permission $permission) 48 | { 49 | $permission->update($request->all()); 50 | 51 | return redirect()->route('admin.permissions.index'); 52 | 53 | } 54 | 55 | public function show(Permission $permission) 56 | { 57 | abort_if(Gate::denies('permission_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 58 | 59 | return view('admin.permissions.show', compact('permission')); 60 | } 61 | 62 | public function destroy(Permission $permission) 63 | { 64 | abort_if(Gate::denies('permission_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 65 | 66 | $permission->delete(); 67 | 68 | return back(); 69 | 70 | } 71 | 72 | public function massDestroy(MassDestroyPermissionRequest $request) 73 | { 74 | Permission::whereIn('id', request('ids'))->delete(); 75 | 76 | return response(null, Response::HTTP_NO_CONTENT); 77 | 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/ProductTagController.php: -------------------------------------------------------------------------------- 1 | all()); 35 | 36 | return redirect()->route('admin.product-tags.index'); 37 | 38 | } 39 | 40 | public function edit(ProductTag $productTag) 41 | { 42 | abort_if(Gate::denies('product_tag_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 43 | 44 | return view('admin.productTags.edit', compact('productTag')); 45 | } 46 | 47 | public function update(UpdateProductTagRequest $request, ProductTag $productTag) 48 | { 49 | $productTag->update($request->all()); 50 | 51 | return redirect()->route('admin.product-tags.index'); 52 | 53 | } 54 | 55 | public function show(ProductTag $productTag) 56 | { 57 | abort_if(Gate::denies('product_tag_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 58 | 59 | return view('admin.productTags.show', compact('productTag')); 60 | } 61 | 62 | public function destroy(ProductTag $productTag) 63 | { 64 | abort_if(Gate::denies('product_tag_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 65 | 66 | $productTag->delete(); 67 | 68 | return back(); 69 | 70 | } 71 | 72 | public function massDestroy(MassDestroyProductTagRequest $request) 73 | { 74 | ProductTag::whereIn('id', request('ids'))->delete(); 75 | 76 | return response(null, Response::HTTP_NO_CONTENT); 77 | 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /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 | 44 | public function edit(Role $role) 45 | { 46 | abort_if(Gate::denies('role_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 47 | 48 | $permissions = Permission::all()->pluck('title', 'id'); 49 | 50 | $role->load('permissions'); 51 | 52 | return view('admin.roles.edit', compact('permissions', 'role')); 53 | } 54 | 55 | public function update(UpdateRoleRequest $request, Role $role) 56 | { 57 | $role->update($request->all()); 58 | $role->permissions()->sync($request->input('permissions', [])); 59 | 60 | return redirect()->route('admin.roles.index'); 61 | 62 | } 63 | 64 | public function show(Role $role) 65 | { 66 | abort_if(Gate::denies('role_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 67 | 68 | $role->load('permissions'); 69 | 70 | return view('admin.roles.show', compact('role')); 71 | } 72 | 73 | public function destroy(Role $role) 74 | { 75 | abort_if(Gate::denies('role_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 76 | 77 | $role->delete(); 78 | 79 | return back(); 80 | 81 | } 82 | 83 | public function massDestroy(MassDestroyRoleRequest $request) 84 | { 85 | Role::whereIn('id', request('ids'))->delete(); 86 | 87 | return response(null, Response::HTTP_NO_CONTENT); 88 | 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /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 | 44 | public function edit(User $user) 45 | { 46 | abort_if(Gate::denies('user_edit'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 47 | 48 | $roles = Role::all()->pluck('title', 'id'); 49 | 50 | $user->load('roles'); 51 | 52 | return view('admin.users.edit', compact('roles', 'user')); 53 | } 54 | 55 | public function update(UpdateUserRequest $request, User $user) 56 | { 57 | $user->update($request->all()); 58 | $user->roles()->sync($request->input('roles', [])); 59 | 60 | return redirect()->route('admin.users.index'); 61 | 62 | } 63 | 64 | public function show(User $user) 65 | { 66 | abort_if(Gate::denies('user_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 67 | 68 | $user->load('roles'); 69 | 70 | return view('admin.users.show', compact('user')); 71 | } 72 | 73 | public function destroy(User $user) 74 | { 75 | abort_if(Gate::denies('user_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 76 | 77 | $user->delete(); 78 | 79 | return back(); 80 | 81 | } 82 | 83 | public function massDestroy(MassDestroyUserRequest $request) 84 | { 85 | User::whereIn('id', request('ids'))->delete(); 86 | 87 | return response(null, Response::HTTP_NO_CONTENT); 88 | 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/PermissionsApiController.php: -------------------------------------------------------------------------------- 1 | all()); 27 | 28 | return (new PermissionResource($permission)) 29 | ->response() 30 | ->setStatusCode(Response::HTTP_CREATED); 31 | 32 | } 33 | 34 | public function show(Permission $permission) 35 | { 36 | abort_if(Gate::denies('permission_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 37 | 38 | return new PermissionResource($permission); 39 | 40 | } 41 | 42 | public function update(UpdatePermissionRequest $request, Permission $permission) 43 | { 44 | $permission->update($request->all()); 45 | 46 | return (new PermissionResource($permission)) 47 | ->response() 48 | ->setStatusCode(Response::HTTP_ACCEPTED); 49 | 50 | } 51 | 52 | public function destroy(Permission $permission) 53 | { 54 | abort_if(Gate::denies('permission_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 55 | 56 | $permission->delete(); 57 | 58 | return response(null, Response::HTTP_NO_CONTENT); 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/ProductApiController.php: -------------------------------------------------------------------------------- 1 | get()); 24 | 25 | } 26 | 27 | public function store(StoreProductRequest $request) 28 | { 29 | $product = Product::create($request->all()); 30 | $product->categories()->sync($request->input('categories', [])); 31 | $product->tags()->sync($request->input('tags', [])); 32 | 33 | if ($request->input('photo', false)) { 34 | $product->addMedia(storage_path('tmp/uploads/' . $request->input('photo')))->toMediaCollection('photo'); 35 | } 36 | 37 | return (new ProductResource($product)) 38 | ->response() 39 | ->setStatusCode(Response::HTTP_CREATED); 40 | 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(['categories', 'tags'])); 48 | 49 | } 50 | 51 | public function update(UpdateProductRequest $request, Product $product) 52 | { 53 | $product->update($request->all()); 54 | $product->categories()->sync($request->input('categories', [])); 55 | $product->tags()->sync($request->input('tags', [])); 56 | 57 | if ($request->input('photo', false)) { 58 | if (!$product->photo || $request->input('photo') !== $product->photo->file_name) { 59 | $product->addMedia(storage_path('tmp/uploads/' . $request->input('photo')))->toMediaCollection('photo'); 60 | } 61 | 62 | } elseif ($product->photo) { 63 | $product->photo->delete(); 64 | } 65 | 66 | return (new ProductResource($product)) 67 | ->response() 68 | ->setStatusCode(Response::HTTP_ACCEPTED); 69 | 70 | } 71 | 72 | public function destroy(Product $product) 73 | { 74 | abort_if(Gate::denies('product_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 75 | 76 | $product->delete(); 77 | 78 | return response(null, Response::HTTP_NO_CONTENT); 79 | 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/ProductCategoryApiController.php: -------------------------------------------------------------------------------- 1 | all()); 30 | 31 | if ($request->input('photo', false)) { 32 | $productCategory->addMedia(storage_path('tmp/uploads/' . $request->input('photo')))->toMediaCollection('photo'); 33 | } 34 | 35 | return (new ProductCategoryResource($productCategory)) 36 | ->response() 37 | ->setStatusCode(Response::HTTP_CREATED); 38 | 39 | } 40 | 41 | public function show(ProductCategory $productCategory) 42 | { 43 | abort_if(Gate::denies('product_category_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 44 | 45 | return new ProductCategoryResource($productCategory); 46 | 47 | } 48 | 49 | public function update(UpdateProductCategoryRequest $request, ProductCategory $productCategory) 50 | { 51 | $productCategory->update($request->all()); 52 | 53 | if ($request->input('photo', false)) { 54 | if (!$productCategory->photo || $request->input('photo') !== $productCategory->photo->file_name) { 55 | $productCategory->addMedia(storage_path('tmp/uploads/' . $request->input('photo')))->toMediaCollection('photo'); 56 | } 57 | 58 | } elseif ($productCategory->photo) { 59 | $productCategory->photo->delete(); 60 | } 61 | 62 | return (new ProductCategoryResource($productCategory)) 63 | ->response() 64 | ->setStatusCode(Response::HTTP_ACCEPTED); 65 | 66 | } 67 | 68 | public function destroy(ProductCategory $productCategory) 69 | { 70 | abort_if(Gate::denies('product_category_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 71 | 72 | $productCategory->delete(); 73 | 74 | return response(null, Response::HTTP_NO_CONTENT); 75 | 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/ProductTagApiController.php: -------------------------------------------------------------------------------- 1 | all()); 27 | 28 | return (new ProductTagResource($productTag)) 29 | ->response() 30 | ->setStatusCode(Response::HTTP_CREATED); 31 | 32 | } 33 | 34 | public function show(ProductTag $productTag) 35 | { 36 | abort_if(Gate::denies('product_tag_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 37 | 38 | return new ProductTagResource($productTag); 39 | 40 | } 41 | 42 | public function update(UpdateProductTagRequest $request, ProductTag $productTag) 43 | { 44 | $productTag->update($request->all()); 45 | 46 | return (new ProductTagResource($productTag)) 47 | ->response() 48 | ->setStatusCode(Response::HTTP_ACCEPTED); 49 | 50 | } 51 | 52 | public function destroy(ProductTag $productTag) 53 | { 54 | abort_if(Gate::denies('product_tag_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 55 | 56 | $productTag->delete(); 57 | 58 | return response(null, Response::HTTP_NO_CONTENT); 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/RolesApiController.php: -------------------------------------------------------------------------------- 1 | get()); 21 | 22 | } 23 | 24 | public function store(StoreRoleRequest $request) 25 | { 26 | $role = Role::create($request->all()); 27 | $role->permissions()->sync($request->input('permissions', [])); 28 | 29 | return (new RoleResource($role)) 30 | ->response() 31 | ->setStatusCode(Response::HTTP_CREATED); 32 | 33 | } 34 | 35 | public function show(Role $role) 36 | { 37 | abort_if(Gate::denies('role_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 38 | 39 | return new RoleResource($role->load(['permissions'])); 40 | 41 | } 42 | 43 | public function update(UpdateRoleRequest $request, Role $role) 44 | { 45 | $role->update($request->all()); 46 | $role->permissions()->sync($request->input('permissions', [])); 47 | 48 | return (new RoleResource($role)) 49 | ->response() 50 | ->setStatusCode(Response::HTTP_ACCEPTED); 51 | 52 | } 53 | 54 | public function destroy(Role $role) 55 | { 56 | abort_if(Gate::denies('role_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 57 | 58 | $role->delete(); 59 | 60 | return response(null, Response::HTTP_NO_CONTENT); 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/Admin/UsersApiController.php: -------------------------------------------------------------------------------- 1 | get()); 21 | 22 | } 23 | 24 | public function store(StoreUserRequest $request) 25 | { 26 | $user = User::create($request->all()); 27 | $user->roles()->sync($request->input('roles', [])); 28 | 29 | return (new UserResource($user)) 30 | ->response() 31 | ->setStatusCode(Response::HTTP_CREATED); 32 | 33 | } 34 | 35 | public function show(User $user) 36 | { 37 | abort_if(Gate::denies('user_show'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 38 | 39 | return new UserResource($user->load(['roles'])); 40 | 41 | } 42 | 43 | public function update(UpdateUserRequest $request, User $user) 44 | { 45 | $user->update($request->all()); 46 | $user->roles()->sync($request->input('roles', [])); 47 | 48 | return (new UserResource($user)) 49 | ->response() 50 | ->setStatusCode(Response::HTTP_ACCEPTED); 51 | 52 | } 53 | 54 | public function destroy(User $user) 55 | { 56 | abort_if(Gate::denies('user_delete'), Response::HTTP_FORBIDDEN, '403 Forbidden'); 57 | 58 | $user->delete(); 59 | 60 | return response(null, Response::HTTP_NO_CONTENT); 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/V1/CategoryController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 42 | } 43 | 44 | /** 45 | * Get a validator for an incoming registration request. 46 | * 47 | * @param array $data 48 | * @return \Illuminate\Contracts\Validation\Validator 49 | */ 50 | protected function validator(array $data) 51 | { 52 | return Validator::make($data, [ 53 | 'name' => ['required', 'string', 'max:255'], 54 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 55 | 'password' => ['required', 'string', 'min:8', 'confirmed'], 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 | ]); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 39 | $this->middleware('signed')->only('verify'); 40 | $this->middleware('throttle:6,1')->only('verify', 'resend'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | input('category'), function ($query) { 15 | $query->whereHas('categories', function ($query) { 16 | $query->where('id', request()->input('category')); 17 | }); 18 | }) 19 | ->paginate(6); 20 | 21 | return view('home', compact('categories', 'products')); 22 | } 23 | 24 | public function vue() 25 | { 26 | return view('vue'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /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 | 36 | } catch (\Exception $e) { 37 | } 38 | 39 | $file = $request->file('file'); 40 | 41 | $name = uniqid() . '_' . trim($file->getClientOriginalName()); 42 | 43 | $file->move($path, $name); 44 | 45 | return response()->json([ 46 | 'name' => $name, 47 | 'original_name' => $file->getClientOriginalName(), 48 | ]); 49 | 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /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 | 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 | 26 | foreach ($permissionsArray as $title => $roles) { 27 | Gate::define($title, function (\App\User $user) use ($roles) { 28 | return count(array_intersect($user->roles->pluck('id')->toArray(), $roles)) > 0; 29 | }); 30 | } 31 | 32 | } 33 | 34 | return $next($request); 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/CheckForMaintenanceMode.php: -------------------------------------------------------------------------------- 1 | check()) { 22 | return redirect(RouteServiceProvider::HOME); 23 | } 24 | 25 | return $next($request); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /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 | 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 'required|array', 24 | 'ids.*' => 'exists:permissions,id', 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyProductCategoryRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 24 | 'ids.*' => 'exists:product_categories,id', 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyProductRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 24 | 'ids.*' => 'exists:products,id', 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyProductTagRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 24 | 'ids.*' => 'exists:product_tags,id', 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyRoleRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 24 | 'ids.*' => 'exists:roles,id', 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/MassDestroyUserRequest.php: -------------------------------------------------------------------------------- 1 | 'required|array', 24 | 'ids.*' => 'exists:users,id', 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/StorePermissionRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreProductCategoryRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreProductRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | 'price' => [ 26 | 'required'], 27 | 'categories.*' => [ 28 | 'integer'], 29 | 'categories' => [ 30 | 'array'], 31 | 'tags.*' => [ 32 | 'integer'], 33 | 'tags' => [ 34 | 'array'], 35 | ]; 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreProductTagRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreRoleRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | 'permissions.*' => [ 26 | 'integer'], 27 | 'permissions' => [ 28 | 'required', 29 | 'array'], 30 | ]; 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Requests/StoreUserRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | 'email' => [ 26 | 'required', 27 | 'unique:users'], 28 | 'password' => [ 29 | 'required'], 30 | 'roles.*' => [ 31 | 'integer'], 32 | 'roles' => [ 33 | 'required', 34 | 'array'], 35 | ]; 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdatePermissionRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateProductCategoryRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateProductRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | 'price' => [ 26 | 'required'], 27 | 'categories.*' => [ 28 | 'integer'], 29 | 'categories' => [ 30 | 'array'], 31 | 'tags.*' => [ 32 | 'integer'], 33 | 'tags' => [ 34 | 'array'], 35 | ]; 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateProductTagRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | ]; 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateRoleRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | 'permissions.*' => [ 26 | 'integer'], 27 | 'permissions' => [ 28 | 'required', 29 | 'array'], 30 | ]; 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Http/Requests/UpdateUserRequest.php: -------------------------------------------------------------------------------- 1 | [ 24 | 'required'], 25 | 'email' => [ 26 | 'required', 27 | 'unique:users,email,' . request()->route('user')->id], 28 | 'roles.*' => [ 29 | 'integer'], 30 | 'roles' => [ 31 | 'required', 32 | 'array'], 33 | ]; 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Http/Resources/Admin/PermissionResource.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d H:i:s'); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Product.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d H:i:s'); 40 | 41 | } 42 | 43 | public function registerMediaConversions(Media $media = null) 44 | { 45 | $this->addMediaConversion('thumb')->width(250); 46 | 47 | } 48 | 49 | public function categories() 50 | { 51 | return $this->belongsToMany(ProductCategory::class); 52 | 53 | } 54 | 55 | public function tags() 56 | { 57 | return $this->belongsToMany(ProductTag::class); 58 | 59 | } 60 | 61 | public function getPhotoAttribute() 62 | { 63 | $file = $this->getMedia('photo')->last(); 64 | 65 | if ($file) { 66 | $file->url = $file->getUrl(); 67 | $file->thumbnail = $file->getUrl('thumb'); 68 | } 69 | 70 | return $file; 71 | 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /app/ProductCategory.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d H:i:s'); 39 | 40 | } 41 | 42 | public function registerMediaConversions(Media $media = null) 43 | { 44 | $this->addMediaConversion('thumb')->width(50)->height(50); 45 | 46 | } 47 | 48 | public function getPhotoAttribute() 49 | { 50 | $file = $this->getMedia('photo')->last(); 51 | 52 | if ($file) { 53 | $file->url = $file->getUrl(); 54 | $file->thumbnail = $file->getUrl('thumb'); 55 | } 56 | 57 | return $file; 58 | 59 | } 60 | 61 | public function products() 62 | { 63 | return $this->belongsToMany(Product::class); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /app/ProductTag.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d H:i:s'); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /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 | } 35 | -------------------------------------------------------------------------------- /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(); 46 | 47 | $this->mapWebRoutes(); 48 | 49 | // 50 | } 51 | 52 | /** 53 | * Define the "web" routes for the application. 54 | * 55 | * These routes all receive session state, CSRF protection, etc. 56 | * 57 | * @return void 58 | */ 59 | protected function mapWebRoutes() 60 | { 61 | Route::middleware('web') 62 | ->namespace($this->namespace) 63 | ->group(base_path('routes/web.php')); 64 | } 65 | 66 | /** 67 | * Define the "api" routes for the application. 68 | * 69 | * These routes are typically stateless. 70 | * 71 | * @return void 72 | */ 73 | protected function mapApiRoutes() 74 | { 75 | Route::prefix('api') 76 | ->middleware('api') 77 | ->namespace($this->namespace) 78 | ->group(base_path('routes/api.php')); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/Role.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d H:i:s'); 31 | 32 | } 33 | 34 | public function permissions() 35 | { 36 | return $this->belongsToMany(Permission::class); 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | format('Y-m-d H:i:s'); 47 | 48 | } 49 | 50 | public function getIsAdminAttribute() 51 | { 52 | return $this->roles()->where('id', 1)->exists(); 53 | 54 | } 55 | 56 | public function getEmailVerifiedAtAttribute($value) 57 | { 58 | return $value ? Carbon::createFromFormat('Y-m-d H:i:s', $value)->format(config('panel.date_format') . ' ' . config('panel.time_format')) : null; 59 | 60 | } 61 | 62 | public function setEmailVerifiedAtAttribute($value) 63 | { 64 | $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; 65 | 66 | } 67 | 68 | public function setPasswordAttribute($input) 69 | { 70 | if ($input) { 71 | $this->attributes['password'] = app('hash')->needsRehash($input) ? Hash::make($input) : $input; 72 | } 73 | 74 | } 75 | 76 | public function sendPasswordResetNotification($token) 77 | { 78 | $this->notify(new ResetPassword($token)); 79 | 80 | } 81 | 82 | public function roles() 83 | { 84 | return $this->belongsToMany(Role::class); 85 | 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /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.5", 12 | "bugsnag/bugsnag-laravel": "^2.18", 13 | "doctrine/dbal": "^2.10", 14 | "fideloper/proxy": "^4.2", 15 | "fruitcake/laravel-cors": "^1.0", 16 | "guzzlehttp/guzzle": "^6.3", 17 | "laravel/dusk": "^5.9", 18 | "laravel/framework": "^7.0", 19 | "laravel/tinker": "^2.0", 20 | "laravel/ui": "^2.0", 21 | "yajra/laravel-datatables-oracle": "^9.9", 22 | "spatie/laravel-medialibrary": "^7.19", 23 | "laravel/passport": "^8.4" 24 | }, 25 | "require-dev": { 26 | "facade/ignition": "^2.0", 27 | "fzaninotto/faker": "^1.9.1", 28 | "mockery/mockery": "^1.3.1", 29 | "mpociot/laravel-apidoc-generator": "^4.4", 30 | "nunomaduro/collision": "^4.1", 31 | "phpunit/phpunit": "^8.5" 32 | }, 33 | "config": { 34 | "optimize-autoloader": true, 35 | "preferred-install": "dist", 36 | "sort-packages": true 37 | }, 38 | "extra": { 39 | "laravel": { 40 | "dont-discover": [] 41 | } 42 | }, 43 | "autoload": { 44 | "psr-4": { 45 | "App\\": "app/" 46 | }, 47 | "classmap": [ 48 | "database/seeds", 49 | "database/factories" 50 | ] 51 | }, 52 | "autoload-dev": { 53 | "psr-4": { 54 | "Tests\\": "tests/" 55 | } 56 | }, 57 | "minimum-stability": "dev", 58 | "prefer-stable": true, 59 | "scripts": { 60 | "post-autoload-dump": [ 61 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 62 | "@php artisan package:discover --ansi" 63 | ], 64 | "post-root-package-install": [ 65 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 66 | ], 67 | "post-create-project-cmd": [ 68 | "@php artisan key:generate --ansi" 69 | ] 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /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/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => false, 29 | 30 | 'max_age' => false, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /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 | |-------------------------------------------------------------------------- 71 | | Symbolic Links 72 | |-------------------------------------------------------------------------- 73 | | 74 | | Here you may configure the symbolic links that will be created when the 75 | | `storage:link` Artisan command is executed. The array keys should be 76 | | the locations of the links and the values should be their targets. 77 | | 78 | */ 79 | 80 | 'links' => [ 81 | public_path('storage') => storage_path('app/public'), 82 | ], 83 | 84 | ]; 85 | -------------------------------------------------------------------------------- /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'], 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 | 'emergency' => [ 100 | 'path' => storage_path('logs/laravel.log'), 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 | ]; 11 | -------------------------------------------------------------------------------- /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 | |-------------------------------------------------------------------------- 38 | | Blade View Modification Checking 39 | |-------------------------------------------------------------------------- 40 | | 41 | | On every request the framework will check to see if a view has expired 42 | | to determine if it needs to be recompiled. If you are in production 43 | | and precompiling views this feature may be disabled to save time. 44 | | 45 | */ 46 | 47 | 'expires' => env('VIEW_CHECK_EXPIRATION', true), 48 | 49 | ]; 50 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 21 | return [ 22 | 'name' => $faker->name, 23 | 'email' => $faker->unique()->safeEmail, 24 | 'email_verified_at' => now(), 25 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 26 | 'remember_token' => Str::random(10), 27 | ]; 28 | }); 29 | -------------------------------------------------------------------------------- /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/2020_03_23_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 | } 29 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000002_create_permissions_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | $table->string('title')->nullable(); 14 | $table->timestamps(); 15 | $table->softDeletes(); 16 | }); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000003_create_roles_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | $table->string('title')->nullable(); 14 | $table->timestamps(); 15 | $table->softDeletes(); 16 | }); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000004_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | $table->string('name'); 14 | $table->string('email')->unique(); 15 | $table->datetime('email_verified_at')->nullable(); 16 | $table->string('password'); 17 | $table->string('remember_token')->nullable(); 18 | $table->timestamps(); 19 | $table->softDeletes(); 20 | }); 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000005_create_product_categories_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | $table->string('name')->nullable(); 14 | $table->longText('description')->nullable(); 15 | $table->timestamps(); 16 | $table->softDeletes(); 17 | }); 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000006_create_product_tags_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | $table->string('name')->nullable(); 14 | $table->timestamps(); 15 | $table->softDeletes(); 16 | }); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000007_create_products_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 13 | $table->string('name')->nullable(); 14 | $table->longText('description')->nullable(); 15 | $table->decimal('price', 15, 2)->nullable(); 16 | $table->timestamps(); 17 | $table->softDeletes(); 18 | }); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000008_create_permission_role_pivot_table.php: -------------------------------------------------------------------------------- 1 | unsignedInteger('role_id'); 13 | $table->foreign('role_id', 'role_id_fk_1191779')->references('id')->on('roles')->onDelete('cascade'); 14 | $table->unsignedInteger('permission_id'); 15 | $table->foreign('permission_id', 'permission_id_fk_1191779')->references('id')->on('permissions')->onDelete('cascade'); 16 | }); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000009_create_role_user_pivot_table.php: -------------------------------------------------------------------------------- 1 | unsignedInteger('user_id'); 13 | $table->foreign('user_id', 'user_id_fk_1191788')->references('id')->on('users')->onDelete('cascade'); 14 | $table->unsignedInteger('role_id'); 15 | $table->foreign('role_id', 'role_id_fk_1191788')->references('id')->on('roles')->onDelete('cascade'); 16 | }); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000010_create_product_product_category_pivot_table.php: -------------------------------------------------------------------------------- 1 | unsignedInteger('product_id'); 13 | $table->foreign('product_id', 'product_id_fk_1191809')->references('id')->on('products')->onDelete('cascade'); 14 | $table->unsignedInteger('product_category_id'); 15 | $table->foreign('product_category_id', 'product_category_id_fk_1191809')->references('id')->on('product_categories')->onDelete('cascade'); 16 | }); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /database/migrations/2020_03_23_000011_create_product_product_tag_pivot_table.php: -------------------------------------------------------------------------------- 1 | unsignedInteger('product_id'); 13 | $table->foreign('product_id', 'product_id_fk_1191810')->references('id')->on('products')->onDelete('cascade'); 14 | $table->unsignedInteger('product_tag_id'); 15 | $table->foreign('product_tag_id', 'product_tag_id_fk_1191810')->references('id')->on('product_tags')->onDelete('cascade'); 16 | }); 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call([ 10 | PermissionsTableSeeder::class, 11 | RolesTableSeeder::class, 12 | PermissionRoleTableSeeder::class, 13 | UsersTableSeeder::class, 14 | RoleUserTableSeeder::class, 15 | ProductCategoriesTableSeeder::class, 16 | ProductsTableSeeder::class, 17 | ]); 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /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 | } 20 | -------------------------------------------------------------------------------- /database/seeds/ProductCategoriesTableSeeder.php: -------------------------------------------------------------------------------- 1 | $faker->sentence(3), 21 | 'description' => $faker->paragraph, 22 | ]); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /database/seeds/ProductsTableSeeder.php: -------------------------------------------------------------------------------- 1 | products()->create([ 22 | 'name' => $faker->sentence(2), 23 | 'price' => rand(99, 9999) / 10, 24 | 'description' => $faker->paragraph, 25 | ]); 26 | 27 | $product->addMediaFromUrl(public_path('images/product.jpg'))->toMediaCollection('photo'); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/seeds/RoleUserTableSeeder.php: -------------------------------------------------------------------------------- 1 | roles()->sync(1); 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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 | } 25 | -------------------------------------------------------------------------------- /database/seeds/UsersTableSeeder.php: -------------------------------------------------------------------------------- 1 | 1, 13 | 'name' => 'Admin', 14 | 'email' => 'admin@admin.com', 15 | 'password' => '$2y$10$yRfHIFyppaYVn10cTZ8GnOHdeY7AT.w7E5H6O4tY2xhLO8DDHII1e', 16 | 'remember_token' => null, 17 | ], 18 | ]; 19 | 20 | User::insert($users); 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.19", 14 | "bootstrap": "^4.0.0", 15 | "cross-env": "^7.0", 16 | "jquery": "^3.2", 17 | "laravel-mix": "^5.0.1", 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": "^8.0.0", 23 | "vue": "^2.5.17", 24 | "vue-template-compiler": "^2.6.10" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | ./tests/Unit 9 | 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/css/custom.css: -------------------------------------------------------------------------------- 1 | .ck-editor__editable, 2 | textarea { 3 | min-height: 150px; 4 | } 5 | 6 | .datatable { 7 | width: 100% !important; 8 | } 9 | 10 | .dataTables_length, 11 | .dataTables_filter, 12 | .dt-buttons { 13 | margin-bottom: 0.333em; 14 | margin-top: .2rem; 15 | } 16 | 17 | .dataTables_filter { 18 | margin-right: .2rem; 19 | } 20 | 21 | .dt-buttons .btn { 22 | margin-left: 0.333em; 23 | border-radius: 0; 24 | } 25 | 26 | .table.datatable { 27 | box-sizing: border-box; 28 | border-collapse: collapse; 29 | } 30 | 31 | table.dataTable thead th { 32 | border-bottom: 2px solid #c8ced3; 33 | } 34 | 35 | .dataTables_wrapper.no-footer .dataTables_scrollBody { 36 | border-bottom: 1px solid #c8ced3; 37 | } 38 | 39 | .select2 { 40 | max-width: 100%; 41 | width: 100% !important; 42 | } 43 | 44 | .select2-selection__rendered { 45 | padding-bottom: 5px !important; 46 | } 47 | 48 | .has-error .invalid-feedback { 49 | display: block !important; 50 | } 51 | 52 | .btn-info, 53 | .badge-info { 54 | color: white; 55 | } 56 | 57 | table.dataTable thead .sorting, 58 | table.dataTable thead .sorting_asc, 59 | table.dataTable thead .sorting_desc { 60 | background-image: none; 61 | } 62 | 63 | .sidebar .nav-item { 64 | cursor: pointer; 65 | } 66 | 67 | .btn-default { 68 | color: #23282c; 69 | background-color: #f0f3f5; 70 | border-color: #f0f3f5; 71 | } 72 | 73 | .btn-default.focus, 74 | .btn-default:focus { 75 | box-shadow: 0 0 0 .2rem rgba(209, 213, 215, .5); 76 | } 77 | 78 | .btn-default:hover { 79 | color: #23282c; 80 | background-color: #d9e1e6; 81 | border-color: #d1dbe1; 82 | } 83 | 84 | .btn-group-xs > .btn, 85 | .btn-xs { 86 | padding: 1px 5px; 87 | font-size: 12px; 88 | line-height: 1.5; 89 | border-radius: 3px; 90 | } 91 | 92 | .searchable-title { 93 | font-weight: bold; 94 | } 95 | .searchable-fields { 96 | padding-left:5px; 97 | } 98 | .searchable-link { 99 | padding:0 5px 0 5px; 100 | } 101 | .searchable-link:hover { 102 | cursor: pointer; 103 | background: #eaeaea; 104 | } 105 | .select2-results__option { 106 | padding-left: 0px; 107 | padding-right: 0px; 108 | } 109 | 110 | .form-group .required::after { 111 | content: " *"; 112 | color: red; 113 | } 114 | 115 | .form-check.is-invalid ~ .invalid-feedback { 116 | display: block; 117 | } 118 | -------------------------------------------------------------------------------- /public/css/shop-homepage.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Start Bootstrap - Shop Homepage (https://startbootstrap.com/template-overviews/shop-homepage) 3 | * Copyright 2013-2019 Start Bootstrap 4 | * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-shop-homepage/blob/master/LICENSE) 5 | */ 6 | body { 7 | padding-top: 56px; 8 | } 9 | -------------------------------------------------------------------------------- /public/docs/css/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/public/docs/css/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /public/docs/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/public/docs/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /public/docs/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/public/docs/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /public/docs/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/public/docs/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /public/docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/public/docs/images/logo.png -------------------------------------------------------------------------------- /public/docs/images/navbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/public/docs/images/navbar.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/public/favicon.ico -------------------------------------------------------------------------------- /public/images/product.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/public/images/product.jpg -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | define('LARAVEL_START', microtime(true)); 11 | 12 | /* 13 | |-------------------------------------------------------------------------- 14 | | Register The Auto Loader 15 | |-------------------------------------------------------------------------- 16 | | 17 | | Composer provides a convenient, automatically generated class loader for 18 | | our application. We just need to utilize it! We'll simply require it 19 | | into the script here so that we don't have to worry about manual 20 | | loading any of our classes later on. It feels great to relax. 21 | | 22 | */ 23 | 24 | require __DIR__.'/../vendor/autoload.php'; 25 | 26 | /* 27 | |-------------------------------------------------------------------------- 28 | | Turn On The Lights 29 | |-------------------------------------------------------------------------- 30 | | 31 | | We need to illuminate PHP development, so let us turn on the lights. 32 | | This bootstraps the framework and gets it ready for use, then it 33 | | will load up this application so that we can run it and send 34 | | the responses back to the browser and delight our users. 35 | | 36 | */ 37 | 38 | $app = require_once __DIR__.'/../bootstrap/app.php'; 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Run The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once we have the application, we can handle the incoming request 46 | | through the kernel, and send the associated response back to 47 | | the client's browser allowing them to enjoy the creative 48 | | and wonderful application we have prepared for them. 49 | | 50 | */ 51 | 52 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 53 | 54 | $response = $kernel->handle( 55 | $request = Illuminate\Http\Request::capture() 56 | ); 57 | 58 | $response->send(); 59 | 60 | $kernel->terminate($request, $response); 61 | -------------------------------------------------------------------------------- /public/js/app.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v4.4.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | /*! 8 | * Sizzle CSS Selector Engine v2.3.4 9 | * https://sizzlejs.com/ 10 | * 11 | * Copyright JS Foundation and other contributors 12 | * Released under the MIT license 13 | * https://js.foundation/ 14 | * 15 | * Date: 2019-04-08 16 | */ 17 | 18 | /*! 19 | * Vue.js v2.6.11 20 | * (c) 2014-2019 Evan You 21 | * Released under the MIT License. 22 | */ 23 | 24 | /*! 25 | * jQuery JavaScript Library v3.4.1 26 | * https://jquery.com/ 27 | * 28 | * Includes Sizzle.js 29 | * https://sizzlejs.com/ 30 | * 31 | * Copyright JS Foundation and other contributors 32 | * Released under the MIT license 33 | * https://jquery.org/license 34 | * 35 | * Date: 2019-05-01T21:04Z 36 | */ 37 | 38 | /** 39 | * @license 40 | * Lodash 41 | * Copyright OpenJS Foundation and other contributors 42 | * Released under MIT license 43 | * Based on Underscore.js 1.8.3 44 | * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 45 | */ 46 | 47 | /**! 48 | * @fileOverview Kickass library to create and place poppers near their reference elements. 49 | * @version 1.16.1 50 | * @license 51 | * Copyright (c) 2016 Federico Zivolo and contributors 52 | * 53 | * Permission is hereby granted, free of charge, to any person obtaining a copy 54 | * of this software and associated documentation files (the "Software"), to deal 55 | * in the Software without restriction, including without limitation the rights 56 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 57 | * copies of the Software, and to permit persons to whom the Software is 58 | * furnished to do so, subject to the following conditions: 59 | * 60 | * The above copyright notice and this permission notice shall be included in all 61 | * copies or substantial portions of the Software. 62 | * 63 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 64 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 65 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 66 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 67 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 68 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 69 | * SOFTWARE. 70 | */ 71 | -------------------------------------------------------------------------------- /public/js/main.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | window._token = $('meta[name="csrf-token"]').attr('content') 3 | 4 | moment.updateLocale('en', { 5 | week: {dow: 1} // Monday is the first day of the week 6 | }) 7 | 8 | $('.date').datetimepicker({ 9 | format: 'YYYY-MM-DD', 10 | locale: 'en', 11 | icons: { 12 | up: 'fas fa-chevron-up', 13 | down: 'fas fa-chevron-down', 14 | previous: 'fas fa-chevron-left', 15 | next: 'fas fa-chevron-right' 16 | } 17 | }) 18 | 19 | $('.datetime').datetimepicker({ 20 | format: 'YYYY-MM-DD HH:mm:ss', 21 | locale: 'en', 22 | sideBySide: true, 23 | icons: { 24 | up: 'fas fa-chevron-up', 25 | down: 'fas fa-chevron-down', 26 | previous: 'fas fa-chevron-left', 27 | next: 'fas fa-chevron-right' 28 | } 29 | }) 30 | 31 | $('.timepicker').datetimepicker({ 32 | format: 'HH:mm:ss', 33 | icons: { 34 | up: 'fas fa-chevron-up', 35 | down: 'fas fa-chevron-down', 36 | previous: 'fas fa-chevron-left', 37 | next: 'fas fa-chevron-right' 38 | } 39 | }) 40 | 41 | $('.select-all').click(function () { 42 | let $select2 = $(this).parent().siblings('.select2') 43 | $select2.find('option').prop('selected', 'selected') 44 | $select2.trigger('change') 45 | }) 46 | $('.deselect-all').click(function () { 47 | let $select2 = $(this).parent().siblings('.select2') 48 | $select2.find('option').prop('selected', '') 49 | $select2.trigger('change') 50 | }) 51 | 52 | $('.select2').select2() 53 | 54 | $('.treeview').each(function () { 55 | var shouldExpand = false 56 | $(this).find('li').each(function () { 57 | if ($(this).hasClass('active')) { 58 | shouldExpand = true 59 | } 60 | }) 61 | if (shouldExpand) { 62 | $(this).addClass('active') 63 | } 64 | }) 65 | }) 66 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js", 3 | "/css/app.css": "/css/app.css" 4 | } 5 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /resources/docs/css/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/css/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /resources/docs/css/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/css/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /resources/docs/css/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/css/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /resources/docs/css/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/css/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /resources/docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/images/logo.png -------------------------------------------------------------------------------- /resources/docs/images/navbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/images/navbar.png -------------------------------------------------------------------------------- /resources/docs/source/.gitignore: -------------------------------------------------------------------------------- 1 | /_tmp/ 2 | /node_modules/ -------------------------------------------------------------------------------- /resources/docs/source/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/source/assets/images/logo.png -------------------------------------------------------------------------------- /resources/docs/source/assets/images/navbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/source/assets/images/navbar.png -------------------------------------------------------------------------------- /resources/docs/source/assets/stylus/_icon_font.styl: -------------------------------------------------------------------------------- 1 | @font-face 2 | font-family: FontAwesome 3 | font-style: normal 4 | font-weight: normal 5 | src: url($font-icon-path + ".eot?v=#" + $font-icon-version) 6 | src: url($font-icon-path + ".eot?#iefix&v=#" + $font-icon-version) format("embedded-opentype"), 7 | url($font-icon-path + ".woff?v=#" + $font-icon-version) format("woff"), 8 | url($font-icon-path + ".ttf?v=#" + $font-icon-version) format("truetype"), 9 | url($font-icon-path + ".svg#fontawesomeregular?v=#" + $font-icon-version) format("svg") 10 | 11 | $icon 12 | font-family: 'FontAwesome' 13 | speak: none 14 | font-style: normal 15 | font-weight: normal 16 | font-variant: normal 17 | text-transform: none 18 | line-height: 1 19 | 20 | $icon-exclamation-sign 21 | @extend $icon 22 | content: "\f06a" 23 | 24 | $icon-info-sign 25 | @extend $icon 26 | content: "\f05a" 27 | 28 | $icon-ok-sign 29 | @extend $icon 30 | content: "\f058" 31 | 32 | $icon-search 33 | @extend $icon 34 | content: "\f002" 35 | -------------------------------------------------------------------------------- /resources/docs/source/assets/stylus/_monokai.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/ 4 | 5 | */ 6 | 7 | .hljs { 8 | display: block; 9 | overflow-x: auto; 10 | padding: 0.5em; 11 | background: #23241f; 12 | } 13 | 14 | .hljs, 15 | .hljs-tag, 16 | .hljs-subst { 17 | color: #f8f8f2; 18 | } 19 | 20 | .hljs-strong, 21 | .hljs-emphasis { 22 | color: #a8a8a2; 23 | } 24 | 25 | .hljs-bullet, 26 | .hljs-quote, 27 | .hljs-number, 28 | .hljs-regexp, 29 | .hljs-literal, 30 | .hljs-link { 31 | color: #ae81ff; 32 | } 33 | 34 | .hljs-code, 35 | .hljs-title, 36 | .hljs-section, 37 | .hljs-selector-class { 38 | color: #a6e22e; 39 | } 40 | 41 | .hljs-strong { 42 | font-weight: bold; 43 | } 44 | 45 | .hljs-emphasis { 46 | font-style: italic; 47 | } 48 | 49 | .hljs-keyword, 50 | .hljs-selector-tag, 51 | .hljs-name, 52 | .hljs-attr { 53 | color: #f92672; 54 | } 55 | 56 | .hljs-symbol, 57 | .hljs-attribute { 58 | color: #66d9ef; 59 | } 60 | 61 | .hljs-params, 62 | .hljs-class .hljs-title { 63 | color: #f8f8f2; 64 | } 65 | 66 | .hljs-string, 67 | .hljs-type, 68 | .hljs-built_in, 69 | .hljs-builtin-name, 70 | .hljs-selector-id, 71 | .hljs-selector-attr, 72 | .hljs-selector-pseudo, 73 | .hljs-addition, 74 | .hljs-variable, 75 | .hljs-template-variable { 76 | color: #e6db74; 77 | } 78 | 79 | .hljs-comment, 80 | .hljs-deletion, 81 | .hljs-meta { 82 | color: #75715e; 83 | } 84 | -------------------------------------------------------------------------------- /resources/docs/source/assets/stylus/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/source/assets/stylus/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /resources/docs/source/assets/stylus/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/source/assets/stylus/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /resources/docs/source/assets/stylus/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/source/assets/stylus/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /resources/docs/source/assets/stylus/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LaravelDaily/Laravel-Vue-Shop-Catalog/e1843a9224b697b370b13a770a1212c68d3b6f53/resources/docs/source/assets/stylus/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /resources/docs/source/config.php: -------------------------------------------------------------------------------- 1 | [ 16 | 17 | 'type' => 'git', 18 | 19 | 'repository' => '', 20 | 21 | 'branch' => 'gh-pages', 22 | 23 | 'message' => 'Site updated: ' . strftime('%YYYY-%MM-%DD %HH:%mm:%ss') 24 | 25 | ] 26 | ]; -------------------------------------------------------------------------------- /resources/docs/source/gulpfile.js: -------------------------------------------------------------------------------- 1 | var elixir = require('laravel-elixir'); 2 | require('laravel-elixir-stylus'); 3 | var gulp = require('gulp'); 4 | var shell = require('gulp-shell'); 5 | var Task = elixir.Task; 6 | var path = require('path'); 7 | 8 | /*s 9 | |-------------------------------------------------------------------------- 10 | | Elixir Asset Management 11 | |-------------------------------------------------------------------------- 12 | | 13 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 14 | | for your Laravel application. By default, we are compiling the Sass 15 | | file for our application, as well as publishing vendor resources. 16 | | 17 | */ 18 | elixir.config.assetsPath = 'assets'; 19 | elixir.config.publicPath = '../'; 20 | 21 | elixir.extend('generate_docs', function() { 22 | new Task('x_generate_docs', function() { 23 | return gulp.src('').pipe( 24 | shell([ 25 | 'sleep 0.2', 26 | 'documentarian generate' 27 | ], { 28 | cwd: path.resolve(process.cwd(), '..') 29 | }) 30 | ); 31 | }) 32 | .watch('./**/*.md') 33 | .watch('./assets/**/*.js') 34 | .watch('./assets/**/*.styl'); 35 | }); 36 | 37 | elixir(function(mix) { 38 | mix.scripts([ 39 | 'lib/jquery.min.js', 40 | 'lib/energize.js', 41 | 'lib/imagesloaded.min.js', 42 | 'lib/highlight.min.js', 43 | 'lib/jquery.highlight.js', 44 | 'lib/jquery_ui.js', 45 | 'lib/jquery.tocify.js', 46 | 'lib/lunr.js', 47 | 'script.js' 48 | ]).stylus('style.styl', null, { 49 | 'sourcemap': false, 50 | 'include css': true 51 | }).generate_docs(); 52 | }); 53 | -------------------------------------------------------------------------------- /resources/docs/source/includes/_errors.md: -------------------------------------------------------------------------------- 1 | # Errors 2 | 3 | 4 | 5 | The Kittn API uses the following error codes: 6 | 7 | 8 | Error Code | Meaning 9 | ---------- | ------- 10 | 400 | Bad Request -- Your request sucks 11 | 401 | Unauthorized -- Your API key is wrong 12 | 403 | Forbidden -- The kitten requested is hidden for administrators only 13 | 404 | Not Found -- The specified kitten could not be found 14 | 405 | Method Not Allowed -- You tried to access a kitten with an invalid method 15 | 406 | Not Acceptable -- You requested a format that isn't json 16 | 410 | Gone -- The kitten requested has been removed from our servers 17 | 418 | I'm a teapot 18 | 429 | Too Many Requests -- You're requesting too many kittens! Slow down! 19 | 500 | Internal Server Error -- We had a problem with our server. Try again later. 20 | 503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. 21 | -------------------------------------------------------------------------------- /resources/docs/source/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "prod": "gulp --production", 5 | "dev": "gulp watch" 6 | }, 7 | "devDependencies": { 8 | "gulp": "^3.9.1", 9 | "laravel-elixir": "^5.0.0", 10 | "laravel-elixir-stylus": "^1.0.1" 11 | } 12 | } -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * First we will load all of this project's JavaScript dependencies which 3 | * includes Vue and other libraries. It is a great starting point when 4 | * building robust, powerful web applications using Vue and Laravel. 5 | */ 6 | 7 | require('./bootstrap'); 8 | 9 | window.Vue = require('vue'); 10 | 11 | /** 12 | * The following block of code may be used to automatically register your 13 | * Vue components. It will recursively scan this directory for the Vue 14 | * components and automatically register them with their "basename". 15 | * 16 | * Eg. ./components/ExampleComponent.vue -> 17 | */ 18 | 19 | // const files = require.context('./', true, /\.vue$/i) 20 | // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)) 21 | 22 | Vue.component('front-page', require('./components/Front/Index.vue').default); 23 | Vue.component('the-pagination', require('./components/ThePagination.vue').default); 24 | Vue.component('category', require('./components/Front/Category.vue').default); 25 | Vue.component('product', require('./components/Front/Product.vue').default); 26 | 27 | /** 28 | * Next, we will create a fresh Vue application instance and attach it to 29 | * the page. Then, you may begin adding components to this application 30 | * or customize the JavaScript scaffolding to fit your unique needs. 31 | */ 32 | 33 | const app = new Vue({ 34 | el: '#app', 35 | }); 36 | -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | window._ = require('lodash'); 2 | 3 | /** 4 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support 5 | * for JavaScript based Bootstrap features such as modals and tabs. This 6 | * code may be modified to fit the specific needs of your application. 7 | */ 8 | 9 | try { 10 | window.Popper = require('popper.js').default; 11 | window.$ = window.jQuery = require('jquery'); 12 | 13 | require('bootstrap'); 14 | } catch (e) {} 15 | 16 | /** 17 | * We'll load the axios HTTP library which allows us to easily issue requests 18 | * to our Laravel back-end. This library automatically handles sending the 19 | * CSRF token as a header based on the value of the "XSRF" token cookie. 20 | */ 21 | 22 | window.axios = require('axios'); 23 | 24 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 25 | 26 | /** 27 | * Echo exposes an expressive API for subscribing to channels and listening 28 | * for events that are broadcast by Laravel. Echo and event broadcasting 29 | * allows your team to easily build robust real-time web applications. 30 | */ 31 | 32 | // import Echo from 'laravel-echo'; 33 | 34 | // window.Pusher = require('pusher-js'); 35 | 36 | // window.Echo = new Echo({ 37 | // broadcaster: 'pusher', 38 | // key: process.env.MIX_PUSHER_APP_KEY, 39 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 40 | // encrypted: true 41 | // }); 42 | -------------------------------------------------------------------------------- /resources/js/components/Front/Category.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 19 | 20 | 33 | -------------------------------------------------------------------------------- /resources/js/components/Front/Index.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 86 | 87 | 90 | -------------------------------------------------------------------------------- /resources/js/components/Front/Product.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 31 | -------------------------------------------------------------------------------- /resources/js/components/ThePagination.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 46 | 47 | 62 | -------------------------------------------------------------------------------- /resources/js/helpers/pagination.js: -------------------------------------------------------------------------------- 1 | export function pagination(c, m) { 2 | var current = c, 3 | last = m, 4 | delta = 2, 5 | left = current - delta, 6 | right = current + delta + 1, 7 | range = [], 8 | rangeWithDots = [], 9 | l; 10 | 11 | for (let i = 1; i <= last; i++) { 12 | if (i == 1 || i == last || i >= left && i < right) { 13 | range.push(i); 14 | } 15 | } 16 | 17 | for (let i of range) { 18 | if (l) { 19 | if (i - l === 2) { 20 | rangeWithDots.push(l + 1); 21 | } else if (i - l !== 1) { 22 | rangeWithDots.push('...'); 23 | } 24 | } 25 | rangeWithDots.push(i); 26 | l = i; 27 | } 28 | 29 | return rangeWithDots; 30 | } 31 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 5 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 6 | ]; 7 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 5 | 'next' => 'Next »', 6 | ]; 7 | -------------------------------------------------------------------------------- /resources/lang/en/panel.php: -------------------------------------------------------------------------------- 1 | 'Shop Catalog', 5 | ]; 6 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least six characters and match the confirmation.', 5 | 'reset' => 'Your password has been reset!', 6 | 'sent' => 'We have e-mailed your password reset link!', 7 | 'token' => 'This password reset token is invalid.', 8 | 'user' => 'We can\'t find a user with that e-mail address.', 9 | 'updated' => 'Your password has been changed!', 10 | ]; 11 | -------------------------------------------------------------------------------- /resources/sass/_variables.scss: -------------------------------------------------------------------------------- 1 | // Body 2 | $body-bg: #f8fafc; 3 | 4 | // Typography 5 | $font-family-sans-serif: 'Nunito', sans-serif; 6 | $font-size-base: 0.9rem; 7 | $line-height-base: 1.6; 8 | 9 | // Colors 10 | $blue: #3490dc; 11 | $indigo: #6574cd; 12 | $purple: #9561e2; 13 | $pink: #f66d9b; 14 | $red: #e3342f; 15 | $orange: #f6993f; 16 | $yellow: #ffed4a; 17 | $green: #38c172; 18 | $teal: #4dc0b5; 19 | $cyan: #6cb2eb; 20 | -------------------------------------------------------------------------------- /resources/sass/app.scss: -------------------------------------------------------------------------------- 1 | // Fonts 2 | @import url('https://fonts.googleapis.com/css?family=Nunito'); 3 | 4 | // Variables 5 | @import 'variables'; 6 | 7 | // Bootstrap 8 | @import '~bootstrap/scss/bootstrap'; 9 | -------------------------------------------------------------------------------- /resources/views/admin/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 |
4 |
5 |
6 |
7 |
8 | Dashboard 9 |
10 | 11 |
12 | @if(session('status')) 13 | 16 | @endif 17 | 18 | You are logged in! 19 |
20 |
21 |
22 |
23 |
24 | @endsection 25 | @section('scripts') 26 | @parent 27 | 28 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/permissions/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.create') }} {{ trans('cruds.permission.title_singular') }} 7 |
8 | 9 |
10 |
11 | @csrf 12 |
13 | 14 | 15 | @if($errors->has('title')) 16 |
17 | {{ $errors->first('title') }} 18 |
19 | @endif 20 | {{ trans('cruds.permission.fields.title_helper') }} 21 |
22 |
23 | 26 |
27 |
28 |
29 |
30 | 31 | 32 | 33 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/permissions/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.edit') }} {{ trans('cruds.permission.title_singular') }} 7 |
8 | 9 |
10 |
id]) }}" enctype="multipart/form-data"> 11 | @method('PUT') 12 | @csrf 13 |
14 | 15 | 16 | @if($errors->has('title')) 17 |
18 | {{ $errors->first('title') }} 19 |
20 | @endif 21 | {{ trans('cruds.permission.fields.title_helper') }} 22 |
23 |
24 | 27 |
28 |
29 |
30 |
31 | 32 | 33 | 34 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/permissions/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.permission.title') }} 7 |
8 | 9 |
10 |
11 | 16 | 17 | 18 | 19 | 22 | 25 | 26 | 27 | 30 | 33 | 34 | 35 |
20 | {{ trans('cruds.permission.fields.id') }} 21 | 23 | {{ $permission->id }} 24 |
28 | {{ trans('cruds.permission.fields.title') }} 29 | 31 | {{ $permission->title }} 32 |
36 | 41 |
42 |
43 |
44 | 45 | 46 | 47 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/productCategories/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.productCategory.title') }} 7 |
8 | 9 |
10 |
11 | 16 | 17 | 18 | 19 | 22 | 25 | 26 | 27 | 30 | 33 | 34 | 35 | 38 | 41 | 42 | 43 | 46 | 53 | 54 | 55 |
20 | {{ trans('cruds.productCategory.fields.id') }} 21 | 23 | {{ $productCategory->id }} 24 |
28 | {{ trans('cruds.productCategory.fields.name') }} 29 | 31 | {{ $productCategory->name }} 32 |
36 | {{ trans('cruds.productCategory.fields.description') }} 37 | 39 | {{ $productCategory->description }} 40 |
44 | {{ trans('cruds.productCategory.fields.photo') }} 45 | 47 | @if($productCategory->photo) 48 | 49 | 50 | 51 | @endif 52 |
56 | 61 |
62 |
63 |
64 | 65 | 66 | 67 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/productTags/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.create') }} {{ trans('cruds.productTag.title_singular') }} 7 |
8 | 9 |
10 |
11 | @csrf 12 |
13 | 14 | 15 | @if($errors->has('name')) 16 |
17 | {{ $errors->first('name') }} 18 |
19 | @endif 20 | {{ trans('cruds.productTag.fields.name_helper') }} 21 |
22 |
23 | 26 |
27 |
28 |
29 |
30 | 31 | 32 | 33 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/productTags/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.edit') }} {{ trans('cruds.productTag.title_singular') }} 7 |
8 | 9 |
10 |
id]) }}" enctype="multipart/form-data"> 11 | @method('PUT') 12 | @csrf 13 |
14 | 15 | 16 | @if($errors->has('name')) 17 |
18 | {{ $errors->first('name') }} 19 |
20 | @endif 21 | {{ trans('cruds.productTag.fields.name_helper') }} 22 |
23 |
24 | 27 |
28 |
29 |
30 |
31 | 32 | 33 | 34 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/productTags/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.productTag.title') }} 7 |
8 | 9 |
10 |
11 | 16 | 17 | 18 | 19 | 22 | 25 | 26 | 27 | 30 | 33 | 34 | 35 |
20 | {{ trans('cruds.productTag.fields.id') }} 21 | 23 | {{ $productTag->id }} 24 |
28 | {{ trans('cruds.productTag.fields.name') }} 29 | 31 | {{ $productTag->name }} 32 |
36 | 41 |
42 |
43 |
44 | 45 | 46 | 47 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/roles/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.create') }} {{ trans('cruds.role.title_singular') }} 7 |
8 | 9 |
10 |
11 | @csrf 12 |
13 | 14 | 15 | @if($errors->has('title')) 16 |
17 | {{ $errors->first('title') }} 18 |
19 | @endif 20 | {{ trans('cruds.role.fields.title_helper') }} 21 |
22 |
23 | 24 |
25 | {{ trans('global.select_all') }} 26 | {{ trans('global.deselect_all') }} 27 |
28 | 33 | @if($errors->has('permissions')) 34 |
35 | {{ $errors->first('permissions') }} 36 |
37 | @endif 38 | {{ trans('cruds.role.fields.permissions_helper') }} 39 |
40 |
41 | 44 |
45 |
46 |
47 |
48 | 49 | 50 | 51 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/roles/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.edit') }} {{ trans('cruds.role.title_singular') }} 7 |
8 | 9 |
10 |
id]) }}" enctype="multipart/form-data"> 11 | @method('PUT') 12 | @csrf 13 |
14 | 15 | 16 | @if($errors->has('title')) 17 |
18 | {{ $errors->first('title') }} 19 |
20 | @endif 21 | {{ trans('cruds.role.fields.title_helper') }} 22 |
23 |
24 | 25 |
26 | {{ trans('global.select_all') }} 27 | {{ trans('global.deselect_all') }} 28 |
29 | 34 | @if($errors->has('permissions')) 35 |
36 | {{ $errors->first('permissions') }} 37 |
38 | @endif 39 | {{ trans('cruds.role.fields.permissions_helper') }} 40 |
41 |
42 | 45 |
46 |
47 |
48 |
49 | 50 | 51 | 52 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/roles/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.role.title') }} 7 |
8 | 9 |
10 |
11 | 16 | 17 | 18 | 19 | 22 | 25 | 26 | 27 | 30 | 33 | 34 | 35 | 38 | 43 | 44 | 45 |
20 | {{ trans('cruds.role.fields.id') }} 21 | 23 | {{ $role->id }} 24 |
28 | {{ trans('cruds.role.fields.title') }} 29 | 31 | {{ $role->title }} 32 |
36 | {{ trans('cruds.role.fields.permissions') }} 37 | 39 | @foreach($role->permissions as $key => $permissions) 40 | {{ $permissions->title }} 41 | @endforeach 42 |
46 | 51 |
52 |
53 |
54 | 55 | 56 | 57 | @endsection -------------------------------------------------------------------------------- /resources/views/admin/users/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.admin') 2 | @section('content') 3 | 4 |
5 |
6 | {{ trans('global.show') }} {{ trans('cruds.user.title') }} 7 |
8 | 9 |
10 |
11 | 16 | 17 | 18 | 19 | 22 | 25 | 26 | 27 | 30 | 33 | 34 | 35 | 38 | 41 | 42 | 43 | 46 | 49 | 50 | 51 | 54 | 59 | 60 | 61 |
20 | {{ trans('cruds.user.fields.id') }} 21 | 23 | {{ $user->id }} 24 |
28 | {{ trans('cruds.user.fields.name') }} 29 | 31 | {{ $user->name }} 32 |
36 | {{ trans('cruds.user.fields.email') }} 37 | 39 | {{ $user->email }} 40 |
44 | {{ trans('cruds.user.fields.email_verified_at') }} 45 | 47 | {{ $user->email_verified_at }} 48 |
52 | {{ trans('cruds.user.fields.roles') }} 53 | 55 | @foreach($user->roles as $key => $roles) 56 | {{ $roles->title }} 57 | @endforeach 58 |
62 | 67 |
68 |
69 |
70 | 71 | 72 | 73 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/passwords/confirm.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Confirm Password') }}
9 | 10 |
11 |
12 | {{ __('Please confirm your password before continuing.') }} 13 |
14 | 15 |
16 | @csrf 17 | 18 |
19 | 20 | 21 |
22 | 23 | 24 | @error('password') 25 | 26 | {{ $message }} 27 | 28 | @enderror 29 |
30 |
31 | 32 |
33 |
34 | 37 | 38 | @if(Route::has('password.request')) 39 | 40 | {{ __('Forgot Your Password?') }} 41 | 42 | @endif 43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | 52 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |
7 |

{{ trans('panel.site_title') }}

8 | 9 |

{{ trans('global.reset_password') }}

10 | 11 | @if(session('status')) 12 | 15 | @endif 16 | 17 |
18 | @csrf 19 | 20 |
21 | 22 | 23 | @if($errors->has('email')) 24 |
25 | {{ $errors->first('email') }} 26 |
27 | @endif 28 |
29 | 30 |
31 |
32 | 35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | @section('content') 3 |
4 |
5 |
6 |
7 |

{{ trans('panel.site_title') }}

8 | 9 |

{{ trans('global.reset_password') }}

10 | 11 |
12 | @csrf 13 | 14 | 15 | 16 |
17 | 18 | 19 | @if($errors->has('email')) 20 |
21 | {{ $errors->first('email') }} 22 |
23 | @endif 24 |
25 |
26 | 27 | 28 | @if($errors->has('password')) 29 |
30 | {{ $errors->first('password') }} 31 |
32 | @endif 33 |
34 |
35 | 36 |
37 | 38 |
39 |
40 | 43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | @endsection -------------------------------------------------------------------------------- /resources/views/auth/verify.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Verify Your Email Address') }}
9 | 10 |
11 | @if (session('resent')) 12 | 15 | @endif 16 | 17 | {{ __('Before proceeding, please check your email for a verification link.') }} 18 | {{ __('If you did not receive the email') }}, 19 |
20 | @csrf 21 | . 22 |
23 |
24 |
25 |
26 |
27 |
28 | @endsection 29 | -------------------------------------------------------------------------------- /resources/views/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.front') 2 | 3 | @section('content') 4 | 5 | 6 |
7 |
8 |
9 |

Shop Catalog

10 |
11 | @foreach($categories as $category) 12 | 13 | {{ $category->name }} 14 | 15 | @endforeach 16 |
17 | 18 |
19 |
20 |
21 | @foreach($products as $product) 22 |
23 |
24 | 25 | 26 | 27 |
28 |

29 | {{ $product->name }} 30 |

31 |
$ {{ $product->price }}
32 |

{{ Str::limit($product->description, 50) }}

33 |
34 |
35 |
36 | @endforeach 37 |
38 |
39 | {{ $products->appends(request()->query())->links() }} 40 |
41 |
42 |
43 |
44 | @endsection 45 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ trans('panel.site_title') }} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | @yield('styles') 22 | 23 | 24 | 25 |
26 |
27 | @yield("content") 28 |
29 |
30 | @yield('scripts') 31 | 32 | 33 | -------------------------------------------------------------------------------- /resources/views/layouts/front.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Shop Catalog 11 | 12 | 13 | @yield('head') 14 | 15 | 16 | 34 | 35 | @yield('content') 36 | 37 |
38 |
39 |

Copyright © Your Website {{ date('Y') }}

40 |
41 |
42 | 43 | 44 | 45 | @yield('scripts') 46 | 47 | 48 | -------------------------------------------------------------------------------- /resources/views/vue.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.front') 2 | 3 | @section('content') 4 |
5 | 6 |
7 | @endsection 8 | 9 | @section('head') 10 | 11 | @endsection 12 | 13 | @section('scripts') 14 | 15 | @endsection 16 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Laravel 8 | 9 | 10 | 11 | 12 | 13 | 65 | 66 | 67 |
68 | @if (Route::has('login')) 69 | 80 | @endif 81 | 82 |
83 |
84 | Laravel 85 |
86 | 87 | 97 |
98 |
99 | 100 | 101 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | name('api.front.products'); 4 | Route::get('categories', 'Api\V1\CategoryController@index')->name('api.front.categories'); 5 | 6 | Route::group(['prefix' => 'v1', 'as' => 'api.admin.', 'namespace' => 'Api\V1\Admin', 'middleware' => ['auth:api']], function () { 7 | // Permissions 8 | Route::apiResource('permissions', 'PermissionsApiController'); 9 | 10 | // Roles 11 | Route::apiResource('roles', 'RolesApiController'); 12 | 13 | // Users 14 | Route::apiResource('users', 'UsersApiController'); 15 | 16 | // Product Categories 17 | Route::post('product-categories/media', 'ProductCategoryApiController@storeMedia')->name('product-categories.storeMedia'); 18 | Route::apiResource('product-categories', 'ProductCategoryApiController'); 19 | 20 | // Product Tags 21 | Route::apiResource('product-tags', 'ProductTagApiController'); 22 | 23 | // Products 24 | Route::post('products/media', 'ProductApiController@storeMedia')->name('products.storeMedia'); 25 | Route::apiResource('products', 'ProductApiController'); 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->describe('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('home'); 4 | Route::get('vue', 'HomeController@vue')->name('vue'); 5 | 6 | Route::get('/home', function () { 7 | if (session('status')) { 8 | return redirect()->route('admin.home')->with('status', session('status')); 9 | } 10 | 11 | return redirect()->route('admin.home'); 12 | }); 13 | 14 | Auth::routes(['register' => false]); 15 | // Admin 16 | 17 | Route::group(['prefix' => 'admin', 'as' => 'admin.', 'namespace' => 'Admin', 'middleware' => ['auth']], function () { 18 | Route::get('/', 'HomeController@index')->name('home'); 19 | // Permissions 20 | Route::delete('permissions/destroy', 'PermissionsController@massDestroy')->name('permissions.massDestroy'); 21 | Route::resource('permissions', 'PermissionsController'); 22 | 23 | // Roles 24 | Route::delete('roles/destroy', 'RolesController@massDestroy')->name('roles.massDestroy'); 25 | Route::resource('roles', 'RolesController'); 26 | 27 | // Users 28 | Route::delete('users/destroy', 'UsersController@massDestroy')->name('users.massDestroy'); 29 | Route::resource('users', 'UsersController'); 30 | 31 | // Product Categories 32 | Route::delete('product-categories/destroy', 'ProductCategoryController@massDestroy')->name('product-categories.massDestroy'); 33 | Route::post('product-categories/media', 'ProductCategoryController@storeMedia')->name('product-categories.storeMedia'); 34 | Route::post('product-categories/ckmedia', 'ProductCategoryController@storeCKEditorImages')->name('product-categories.storeCKEditorImages'); 35 | Route::resource('product-categories', 'ProductCategoryController'); 36 | 37 | // Product Tags 38 | Route::delete('product-tags/destroy', 'ProductTagController@massDestroy')->name('product-tags.massDestroy'); 39 | Route::resource('product-tags', 'ProductTagController'); 40 | 41 | // Products 42 | Route::delete('products/destroy', 'ProductController@massDestroy')->name('products.massDestroy'); 43 | Route::post('products/media', 'ProductController@storeMedia')->name('products.storeMedia'); 44 | Route::post('products/ckmedia', 'ProductController@storeCKEditorImages')->name('products.storeCKEditorImages'); 45 | Route::resource('products', 'ProductController'); 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | schedule-* 4 | compiled.php 5 | services.json 6 | events.scanned.php 7 | routes.scanned.php 8 | down 9 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/Browser/PermissionsTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.permissions.index')); 17 | $browser->assertRouteIs('admin.permissions.index'); 18 | }); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/Browser/ProductCategoryTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.productcategory.index')); 17 | $browser->assertRouteIs('admin.productcategory.index'); 18 | }); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/Browser/ProductTagTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.producttag.index')); 17 | $browser->assertRouteIs('admin.producttag.index'); 18 | }); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/Browser/ProductTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.product.index')); 17 | $browser->assertRouteIs('admin.product.index'); 18 | }); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/Browser/RolesTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.roles.index')); 17 | $browser->assertRouteIs('admin.roles.index'); 18 | }); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/Browser/UsersTest.php: -------------------------------------------------------------------------------- 1 | browse(function (Browser $browser) use ($admin) { 15 | $browser->loginAs($admin); 16 | $browser->visit(route('admin.users.index')); 17 | $browser->assertRouteIs('admin.users.index'); 18 | }); 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /webpack.mix.js: -------------------------------------------------------------------------------- 1 | const mix = require('laravel-mix'); 2 | 3 | /* 4 | |-------------------------------------------------------------------------- 5 | | Mix Asset Management 6 | |-------------------------------------------------------------------------- 7 | | 8 | | Mix provides a clean, fluent API for defining some Webpack build steps 9 | | for your Laravel application. By default, we are compiling the Sass 10 | | file for the application as well as bundling up all the JS files. 11 | | 12 | */ 13 | 14 | mix.js('resources/js/app.js', 'public/js') 15 | .sass('resources/sass/app.scss', 'public/css'); 16 | --------------------------------------------------------------------------------