├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .styleci.yml ├── app ├── Console │ ├── Commands │ │ └── CleanUploads.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Admin │ │ │ ├── AdminController.php │ │ │ ├── Auth │ │ │ │ └── LoginController.php │ │ │ ├── ProductController.php │ │ │ └── UserController.php │ │ ├── Controller.php │ │ └── User │ │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ ├── ResetPasswordController.php │ │ │ └── VerificationController.php │ │ │ └── UserController.php │ ├── Kernel.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── CheckForMaintenanceMode.php │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php ├── Models │ ├── Admin.php │ ├── Product.php │ └── User.php ├── Policies │ └── AdminRolePolicy.php └── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── permission.php ├── project.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_admins_table.php │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_07_01_060651_create_permission_tables.php │ └── 2019_07_19_174507_create_products_table.php └── seeds │ ├── AdminSeeder.php │ ├── DatabaseSeeder.php │ ├── ProductSeeder.php │ └── UserSeeder.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── css │ ├── .gitignore │ ├── admin │ │ ├── datatables.min.css │ │ └── switcher3.css │ └── app.css ├── favicon.ico ├── fonts │ ├── password.ttf │ └── vendor │ │ └── .gitignore ├── images │ ├── admin.jpg │ ├── admin │ │ ├── blue.png │ │ ├── sort_asc.png │ │ ├── sort_asc_disabled.png │ │ ├── sort_both.png │ │ ├── sort_desc.png │ │ └── sort_desc_disabled.png │ ├── default_watermarks │ │ ├── large_watermark.png │ │ ├── medium_watermark.png │ │ └── small_watermark.png │ ├── dwf-loading-icon.gif │ ├── no_image │ │ ├── large.jpg │ │ ├── medium.jpg │ │ └── small.jpg │ ├── user.jpg │ └── watermarks │ │ ├── large_watermark.png │ │ ├── medium_watermark.png │ │ └── small_watermark.png ├── index.php ├── js │ ├── .gitignore │ ├── admin │ │ └── jquery.dataTables.min.js │ └── app.js ├── mix-manifest.json ├── robots.txt ├── under-construction │ ├── css │ │ ├── font-awesome.min.css │ │ ├── loader.css │ │ ├── normalize.css │ │ └── style.css │ ├── favicon │ │ ├── android-icon-144x144.png │ │ ├── android-icon-192x192.png │ │ ├── android-icon-36x36.png │ │ ├── android-icon-48x48.png │ │ ├── android-icon-72x72.png │ │ ├── android-icon-96x96.png │ │ ├── apple-icon-114x114.png │ │ ├── apple-icon-120x120.png │ │ ├── apple-icon-144x144.png │ │ ├── apple-icon-152x152.png │ │ ├── apple-icon-180x180.png │ │ ├── apple-icon-57x57.png │ │ ├── apple-icon-60x60.png │ │ ├── apple-icon-72x72.png │ │ ├── apple-icon-76x76.png │ │ ├── apple-icon-precomposed.png │ │ ├── apple-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon-96x96.png │ │ ├── favicon.ico │ │ ├── manifest.json │ │ ├── ms-icon-144x144.png │ │ ├── ms-icon-150x150.png │ │ ├── ms-icon-310x310.png │ │ └── ms-icon-70x70.png │ ├── images │ │ ├── background.jpg │ │ ├── favicon.png │ │ ├── flakes │ │ │ ├── depth1 │ │ │ │ ├── flakes1.png │ │ │ │ ├── flakes2.png │ │ │ │ ├── flakes3.png │ │ │ │ └── flakes4.png │ │ │ ├── depth2 │ │ │ │ ├── flakes1.png │ │ │ │ └── flakes2.png │ │ │ ├── depth3 │ │ │ │ ├── flakes1.png │ │ │ │ ├── flakes2.png │ │ │ │ ├── flakes3.png │ │ │ │ └── flakes4.png │ │ │ ├── depth4 │ │ │ │ └── flakes.png │ │ │ └── depth5 │ │ │ │ └── flakes.png │ │ └── sphere.png │ └── js │ │ ├── jquery.countdown.min.js │ │ ├── jquery.js │ │ ├── main.js │ │ └── plugins.js ├── uploads │ └── .gitignore └── web.config ├── readme.md ├── resources ├── js │ ├── app.js │ ├── bootstrap.js │ ├── components │ │ └── ExampleComponent.vue │ └── dashboard.js ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php ├── sass │ ├── _variables.scss │ ├── app.scss │ └── dashboard.scss └── views │ ├── admin │ ├── auth │ │ └── login.blade.php │ ├── components │ │ ├── modal-delete.blade.php │ │ └── switcher2.blade.php │ ├── layouts │ │ └── app.blade.php │ ├── pages │ │ ├── dashboard.blade.php │ │ ├── products │ │ │ ├── create.blade.php │ │ │ ├── edit.blade.php │ │ │ ├── index.blade.php │ │ │ └── show.blade.php │ │ └── users │ │ │ ├── index.blade.php │ │ │ └── show.blade.php │ └── partials │ │ ├── aside.blade.php │ │ ├── flashes.blade.php │ │ ├── footer.blade.php │ │ ├── head.blade.php │ │ ├── header.blade.php │ │ └── scripts.blade.php │ ├── user │ ├── auth │ │ ├── login.blade.php │ │ ├── passwords │ │ │ ├── email.blade.php │ │ │ └── reset.blade.php │ │ ├── register.blade.php │ │ └── verify.blade.php │ ├── home.blade.php │ └── layouts │ │ └── app.blade.php │ └── welcome.blade.php ├── routes ├── admin.php ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore └── framework │ ├── .gitignore │ ├── cache │ ├── .gitignore │ └── data │ │ └── .gitignore │ ├── sessions │ └── .gitignore │ ├── testing │ └── .gitignore │ └── views │ └── .gitignore ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php └── webpack.mix.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 4 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.yml] 15 | indent_size = 2 16 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Laravel 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://localhost 6 | 7 | LOG_CHANNEL=stack 8 | 9 | DB_CONNECTION=mysql 10 | DB_HOST=127.0.0.1 11 | DB_PORT=3306 12 | DB_DATABASE=homestead 13 | DB_USERNAME=homestead 14 | DB_PASSWORD=secret 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | QUEUE_CONNECTION=sync 19 | SESSION_DRIVER=file 20 | SESSION_LIFETIME=120 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_DRIVER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | AWS_ACCESS_KEY_ID= 34 | AWS_SECRET_ACCESS_KEY= 35 | AWS_DEFAULT_REGION=us-east-1 36 | AWS_BUCKET= 37 | 38 | PUSHER_APP_ID= 39 | PUSHER_APP_KEY= 40 | PUSHER_APP_SECRET= 41 | PUSHER_APP_CLUSTER=mt1 42 | 43 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 44 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 45 | 46 | DEV_NAME="Test" 47 | DEV_EMAIL="test@gmail.com" 48 | DEV_PASSWORD="secret" 49 | ADMIN_PREFIX="admin" 50 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/node,laravel,phpstorm+all,webstorm+all 3 | # Edit at https://www.gitignore.io/?templates=node,laravel,phpstorm+all,webstorm+all 4 | 5 | ### Laravel ### 6 | /vendor/ 7 | node_modules/ 8 | npm-debug.log 9 | yarn-error.log 10 | 11 | # Laravel 4 specific 12 | bootstrap/compiled.php 13 | app/storage/ 14 | 15 | # Laravel 5 & Lumen specific 16 | public/storage 17 | public/hot 18 | storage/*.key 19 | .env 20 | Homestead.yaml 21 | Homestead.json 22 | /.vagrant 23 | .phpunit.result.cache 24 | 25 | ### Node ### 26 | # Logs 27 | logs 28 | *.log 29 | npm-debug.log* 30 | yarn-debug.log* 31 | yarn-error.log* 32 | lerna-debug.log* 33 | 34 | # Diagnostic reports (https://nodejs.org/api/report.html) 35 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 36 | 37 | # Runtime data 38 | pids 39 | *.pid 40 | *.seed 41 | *.pid.lock 42 | 43 | # Directory for instrumented libs generated by jscoverage/JSCover 44 | lib-cov 45 | 46 | # Coverage directory used by tools like istanbul 47 | coverage 48 | *.lcov 49 | 50 | # nyc test coverage 51 | .nyc_output 52 | 53 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 54 | .grunt 55 | 56 | # Bower dependency directory (https://bower.io/) 57 | bower_components 58 | 59 | # node-waf configuration 60 | .lock-wscript 61 | 62 | # Compiled binary addons (https://nodejs.org/api/addons.html) 63 | build/Release 64 | 65 | # Dependency directories 66 | jspm_packages/ 67 | 68 | # TypeScript v1 declaration files 69 | typings/ 70 | 71 | # TypeScript cache 72 | *.tsbuildinfo 73 | 74 | # Optional npm cache directory 75 | .npm 76 | 77 | # Optional eslint cache 78 | .eslintcache 79 | 80 | # Optional REPL history 81 | .node_repl_history 82 | 83 | # Output of 'npm pack' 84 | *.tgz 85 | 86 | # Yarn Integrity file 87 | .yarn-integrity 88 | 89 | # dotenv environment variables file 90 | .env.test 91 | 92 | # parcel-bundler cache (https://parceljs.org/) 93 | .cache 94 | 95 | # next.js build output 96 | .next 97 | 98 | # nuxt.js build output 99 | .nuxt 100 | 101 | # vuepress build output 102 | .vuepress/dist 103 | 104 | # Serverless directories 105 | .serverless/ 106 | 107 | # FuseBox cache 108 | .fusebox/ 109 | 110 | # DynamoDB Local files 111 | .dynamodb/ 112 | 113 | ### PhpStorm+all ### 114 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 115 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 116 | 117 | # User-specific stuff 118 | .idea/**/workspace.xml 119 | .idea/**/tasks.xml 120 | .idea/**/usage.statistics.xml 121 | .idea/**/dictionaries 122 | .idea/**/shelf 123 | 124 | # Generated files 125 | .idea/**/contentModel.xml 126 | 127 | # Sensitive or high-churn files 128 | .idea/**/dataSources/ 129 | .idea/**/dataSources.ids 130 | .idea/**/dataSources.local.xml 131 | .idea/**/sqlDataSources.xml 132 | .idea/**/dynamic.xml 133 | .idea/**/uiDesigner.xml 134 | .idea/**/dbnavigator.xml 135 | 136 | # Gradle 137 | .idea/**/gradle.xml 138 | .idea/**/libraries 139 | 140 | # Gradle and Maven with auto-import 141 | # When using Gradle or Maven with auto-import, you should exclude module files, 142 | # since they will be recreated, and may cause churn. Uncomment if using 143 | # auto-import. 144 | # .idea/modules.xml 145 | # .idea/*.iml 146 | # .idea/modules 147 | # *.iml 148 | # *.ipr 149 | 150 | # CMake 151 | cmake-build-*/ 152 | 153 | # Mongo Explorer plugin 154 | .idea/**/mongoSettings.xml 155 | 156 | # File-based project format 157 | *.iws 158 | 159 | # IntelliJ 160 | out/ 161 | 162 | # mpeltonen/sbt-idea plugin 163 | .idea_modules/ 164 | 165 | # JIRA plugin 166 | atlassian-ide-plugin.xml 167 | 168 | # Cursive Clojure plugin 169 | .idea/replstate.xml 170 | 171 | # Crashlytics plugin (for Android Studio and IntelliJ) 172 | com_crashlytics_export_strings.xml 173 | crashlytics.properties 174 | crashlytics-build.properties 175 | fabric.properties 176 | 177 | # Editor-based Rest Client 178 | .idea/httpRequests 179 | 180 | # Android studio 3.1+ serialized cache file 181 | .idea/caches/build_file_checksums.ser 182 | 183 | ### PhpStorm+all Patch ### 184 | # Ignores the whole .idea folder and all .iml files 185 | # See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 186 | 187 | .idea/ 188 | 189 | # Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 190 | 191 | *.iml 192 | modules.xml 193 | .idea/misc.xml 194 | *.ipr 195 | 196 | # Sonarlint plugin 197 | .idea/sonarlint 198 | 199 | ### WebStorm+all ### 200 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 201 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 202 | 203 | # User-specific stuff 204 | 205 | # Generated files 206 | 207 | # Sensitive or high-churn files 208 | 209 | # Gradle 210 | 211 | # Gradle and Maven with auto-import 212 | # When using Gradle or Maven with auto-import, you should exclude module files, 213 | # since they will be recreated, and may cause churn. Uncomment if using 214 | # auto-import. 215 | # .idea/modules.xml 216 | # .idea/*.iml 217 | # .idea/modules 218 | # *.iml 219 | # *.ipr 220 | 221 | # CMake 222 | 223 | # Mongo Explorer plugin 224 | 225 | # File-based project format 226 | 227 | # IntelliJ 228 | 229 | # mpeltonen/sbt-idea plugin 230 | 231 | # JIRA plugin 232 | 233 | # Cursive Clojure plugin 234 | 235 | # Crashlytics plugin (for Android Studio and IntelliJ) 236 | 237 | # Editor-based Rest Client 238 | 239 | # Android studio 3.1+ serialized cache file 240 | 241 | ### WebStorm+all Patch ### 242 | # Ignores the whole .idea folder and all .iml files 243 | # See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 244 | 245 | 246 | # Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 247 | 248 | 249 | # Sonarlint plugin 250 | 251 | # End of https://www.gitignore.io/api/node,laravel,phpstorm+all,webstorm+all -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /app/Console/Commands/CleanUploads.php: -------------------------------------------------------------------------------- 1 | cleanDirectory($directory); 26 | $directory = 'storage' . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . config('project.product.images_folder'); 27 | $file->cleanDirectory($directory); 28 | 29 | // delete uploads from storage 30 | foreach (config('project.user.image_sizes') as $version => $sizes){ 31 | $directory = 'public' . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . config('project.user.images_folder') . DIRECTORY_SEPARATOR . $version; 32 | $file->cleanDirectory($directory); 33 | } 34 | foreach (config('project.product.image_sizes') as $version => $sizes){ 35 | $directory = 'public' . DIRECTORY_SEPARATOR . 'uploads' . DIRECTORY_SEPARATOR . config('project.product.images_folder') . DIRECTORY_SEPARATOR . $version; 36 | $file->cleanDirectory($directory); 37 | } 38 | 39 | echo "Uploads successfully deleted!\n"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 18 | // ->hourly(); 19 | } 20 | 21 | protected function commands() 22 | { 23 | $this->load(__DIR__.'/Commands'); 24 | 25 | require base_path('routes/console.php'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | route('admin.dashboard'); 43 | } 44 | return redirect()->route('front'); 45 | } 46 | 47 | return parent::render($request, $exception); 48 | } 49 | 50 | protected function unauthenticated($request, AuthenticationException $exception) 51 | { 52 | if ($request->expectsJson()) { 53 | return response()->json(['error' => 'Unauthenticated.'],401); 54 | } 55 | $guard = array_get($exception->guards(), 0); 56 | 57 | if($guard == 'admin') { 58 | return redirect()->guest(route('admin.login_page')); 59 | } 60 | 61 | return redirect()->guest(route('login_page')); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/AdminController.php: -------------------------------------------------------------------------------- 1 | middleware('auth:admin'); 13 | 14 | View::share('nav', 'dashboard'); 15 | } 16 | 17 | public function index() 18 | { 19 | return view('admin.pages.dashboard'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | redirectTo = config('project.admin.prefix') . '/dashboard'; 18 | $this->middleware('guest:admin')->except('logout'); 19 | } 20 | 21 | public function showLoginForm() 22 | { 23 | return view('admin.auth.login'); 24 | } 25 | 26 | protected function guard(){ 27 | return Auth::guard('admin'); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/ProductController.php: -------------------------------------------------------------------------------- 1 | select([ 36 | 'products.id', 37 | 'products.admin_id', 38 | 'products.status', 39 | 'products.main_image', 40 | 'products.title', 41 | DB::raw('LEFT(admins.name , ' . config('project.admin.name_length_limit') . ') AS admin_name_for_datatable'), 42 | DB::raw('(CASE WHEN LENGTH(products.title) > ' . config('project.product.title_length_limit') . 43 | ' THEN CONCAT(LEFT(products.title, ' . config('project.product.title_length_limit') . 44 | '), "...") ELSE products.title END) as product_title'), 45 | ]) 46 | ->orderBy('products.id', 'DESC'); 47 | 48 | return DataTables::of($items) 49 | // ->editColumn('title', function($item) { 50 | // return mb_substr($item->title, 0, 5); 51 | // }) 52 | ->make(true); 53 | } 54 | 55 | public function show($item_id) 56 | { 57 | $item = Product::find($item_id); 58 | if(empty($item)){ 59 | return redirect()->route('admin.dashboard'); 60 | } 61 | 62 | return view('admin.pages.products.show', [ 63 | 'item' => $item, 64 | ]); 65 | } 66 | 67 | public function edit($item_id) 68 | { 69 | $item = Product::find($item_id); 70 | if(empty($item)){ 71 | return redirect()->route('admin.dashboard'); 72 | } 73 | 74 | return view('admin.pages.products.edit', [ 75 | 'item' => $item, 76 | ]); 77 | } 78 | 79 | public function create() 80 | { 81 | return view('admin.pages.products.create'); 82 | } 83 | 84 | public function delete(Request $request) 85 | { 86 | $item_id = $request->get('item_id'); 87 | $item = Product::find($item_id); 88 | 89 | if(empty($item)) 90 | { 91 | return response()->json([ 92 | 'success' => false, 93 | 'message' => 'Item not found!', 94 | ]); 95 | } else { 96 | $item->delete(); 97 | 98 | return response()->json([ 99 | 'success' => true, 100 | ]); 101 | } 102 | } 103 | 104 | public function image_delete(Request $request) 105 | { 106 | $image_id = $request->get('image_id'); 107 | $image = ProductImage::find($image_id); 108 | if(empty($image)){ 109 | return response()->json([ 110 | 'success' => false, 111 | 'message' => 'Image not found!', 112 | ]); 113 | } 114 | $item_id = $request->get('item_id'); 115 | 116 | if($item_id == $image->product->id){ 117 | $image->delete(); 118 | 119 | return response()->json([ 120 | 'success' => true, 121 | ]); 122 | } 123 | else { 124 | return response()->json([ 125 | 'success' => false, 126 | 'message' => 'Image not found!', 127 | ]); 128 | } 129 | } 130 | 131 | public function change_status(Request $request) 132 | { 133 | $product_statuses = [ 134 | Product::BLOCKED, 135 | Product::PENDING, 136 | Product::APPROVED, 137 | ]; 138 | $validator = Validator::make($request->all(), [ 139 | 'item_id' => 'required|numeric|min:1', 140 | 'status' => [ 141 | 'required', 142 | 'regex:/^(' . implode('|', $product_statuses) . ')$/', 143 | ], 144 | ]); 145 | if ($validator->fails()) { 146 | echo [ 147 | 'success' => false, 148 | 'message' => implode(' ', $validator->messages()->all()), 149 | ]; 150 | } else { 151 | $item_id = $request->get('item_id'); 152 | $item = Product::find($item_id); 153 | $status = $request->get('status'); 154 | 155 | if(empty($item)) { 156 | return response()->json([ 157 | 'success' => false, 158 | 'message' => 'Item not found!', 159 | ]); 160 | } else { 161 | if($item->status == $status){ 162 | return response()->json([ 163 | 'success' => false, 164 | 'message' => 'Item already have ' . $status . ' status!', 165 | ]); 166 | } else { 167 | $item->status = $status; 168 | $item->save(); 169 | 170 | return response()->json([ 171 | 'success' => true, 172 | ]); 173 | } 174 | } 175 | } 176 | } 177 | } 178 | -------------------------------------------------------------------------------- /app/Http/Controllers/Admin/UserController.php: -------------------------------------------------------------------------------- 1 | middleware('auth:admin'); 16 | 17 | View::share('action', 'no_add'); 18 | View::share('nav', 'users'); 19 | } 20 | 21 | public function index() 22 | { 23 | return view('admin.pages.users.index', [ 24 | 'statuses' => [ 25 | 'active' => User::ACTIVE, 26 | 'not_active' => User::NOT_ACTIVE, 27 | ], 28 | ]); 29 | } 30 | 31 | public function ajax() 32 | { 33 | $items = User::select( 34 | 'name', 35 | 'image', 36 | 'status', 37 | 'email', 38 | 'id' 39 | )->orderBy('id', 'DESC'); 40 | 41 | return DataTables::of($items)->make(true); 42 | } 43 | 44 | public function show($item_id) 45 | { 46 | $item = User::find($item_id); 47 | if(empty($item)){ 48 | return redirect()->route('admin.dashboard'); 49 | } 50 | 51 | return view('admin.pages.users.show', [ 52 | 'item' => $item, 53 | ]); 54 | } 55 | 56 | public function change_status(Request $request) 57 | { 58 | $item_id = $request->get('item_id'); 59 | $item = User::find($item_id); 60 | 61 | if(empty($item)) { 62 | return response()->json([ 63 | 'success' => false, 64 | 'message' => 'Item not found!', 65 | ], 404); 66 | } else { 67 | if($item->status == User::ACTIVE || $item->status == User::NOT_ACTIVE){ 68 | $item->status = ($item->status == User::ACTIVE ? User::NOT_ACTIVE : User::ACTIVE); 69 | $item->save(); 70 | 71 | return response()->json([ 72 | 'success' => true, 73 | 'message' => 'Item status successfully changed.', 74 | ], 200); 75 | } else { 76 | return response()->json([ 77 | 'success' => false, 78 | 'message' => 'Item not found!', 79 | ], 404); 80 | } 81 | } 82 | } 83 | 84 | public function delete(Request $request) 85 | { 86 | $item_id = $request->get('item_id'); 87 | $item = User::find($item_id); 88 | 89 | if(empty($item)) { 90 | return response()->json([ 91 | 'success' => false, 92 | 'message' => 'Item not found!', 93 | ], 404); 94 | } else { 95 | $item->delete(); 96 | 97 | return response()->json([ 98 | 'success' => true, 99 | 'message' => 'Item successfully deleted.', 100 | ], 200); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 15 | } 16 | 17 | public function showLinkRequestForm() 18 | { 19 | return view('user.auth.passwords.email'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Controllers/User/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest')->except('logout'); 17 | } 18 | 19 | public function showLoginForm() 20 | { 21 | return view('user.auth.login'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/Http/Controllers/User/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 20 | } 21 | 22 | protected function validator(array $data) 23 | { 24 | return Validator::make($data, [ 25 | 'name' => ['required', 'string', 'max:255'], 26 | 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 27 | 'password' => ['required', 'string', 'min:6', 'confirmed'], 28 | ]); 29 | } 30 | 31 | protected function create(array $data) 32 | { 33 | return User::create([ 34 | 'name' => $data['name'], 35 | 'email' => $data['email'], 36 | 'password' => Hash::make($data['password']), 37 | ]); 38 | } 39 | 40 | public function showRegistrationForm() 41 | { 42 | return view('user.auth.register'); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/Http/Controllers/User/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 18 | } 19 | 20 | public function showResetForm(Request $request, $token = null) 21 | { 22 | return view('user.auth.passwords.reset')->with( 23 | ['token' => $token, 'email' => $request->email] 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Controllers/User/Auth/VerificationController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 18 | $this->middleware('signed')->only('verify'); 19 | $this->middleware('throttle:6,1')->only('verify', 'resend'); 20 | } 21 | 22 | public function show(Request $request) 23 | { 24 | return $request->user()->hasVerifiedEmail() 25 | ? redirect($this->redirectPath()) 26 | : view('user.auth.verify'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Controllers/User/UserController.php: -------------------------------------------------------------------------------- 1 | middleware('auth'); 12 | } 13 | 14 | public function index() 15 | { 16 | return view('user.home'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Http/Kernel.php: -------------------------------------------------------------------------------- 1 | [ 41 | EncryptCookies::class, 42 | AddQueuedCookiesToResponse::class, 43 | StartSession::class, 44 | AuthenticateSession::class, //ss commented by default 45 | ShareErrorsFromSession::class, 46 | VerifyCsrfToken::class, 47 | SubstituteBindings::class, 48 | ], 49 | 'admin' => [ 50 | EncryptCookies::class, 51 | AddQueuedCookiesToResponse::class, 52 | StartSession::class, 53 | AuthenticateSession::class, 54 | ShareErrorsFromSession::class, 55 | VerifyCsrfToken::class, 56 | SubstituteBindings::class, 57 | ], 58 | 'api' => [ 59 | 'throttle:60,1', 60 | 'bindings', 61 | ], 62 | ]; 63 | 64 | protected $routeMiddleware = [ 65 | 'auth' => Authenticate::class, 66 | 'auth.basic' => AuthenticateWithBasicAuth::class, 67 | 'bindings' => SubstituteBindings::class, 68 | 'cache.headers' => SetCacheHeaders::class, 69 | 'can' => Authorize::class, 70 | 'guest' => RedirectIfAuthenticated::class, 71 | 'signed' => ValidateSignature::class, 72 | 'throttle' => ThrottleRequests::class, 73 | 'verified' => EnsureEmailIsVerified::class, 74 | 75 | 'role' => RoleMiddleware::class, 76 | // 'permission' => PermissionMiddleware::class, 77 | ]; 78 | 79 | protected $middlewarePriority = [ 80 | StartSession::class, 81 | ShareErrorsFromSession::class, 82 | Authenticate::class, 83 | AuthenticateSession::class, 84 | SubstituteBindings::class, 85 | Authorize::class, 86 | ]; 87 | } 88 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 12 | return route('login'); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/Http/Middleware/CheckForMaintenanceMode.php: -------------------------------------------------------------------------------- 1 | check()) { 15 | return redirect()->route('admin.dashboard'); 16 | } 17 | break; 18 | default: 19 | if (Auth::guard($guard)->check()) { 20 | return redirect()->route('home'); 21 | } 22 | break; 23 | } 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 'datetime', 29 | ]; 30 | } 31 | -------------------------------------------------------------------------------- /app/Models/Product.php: -------------------------------------------------------------------------------- 1 | belongsTo(Admin::class, 'admin_id'); 32 | } 33 | 34 | public function getAdminNameAttribute(){ 35 | return $this->admin->name; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 'datetime', 35 | ]; 36 | } 37 | -------------------------------------------------------------------------------- /app/Policies/AdminRolePolicy.php: -------------------------------------------------------------------------------- 1 | getRoleNames()->first(); 13 | return (bool)(config('project.admin.roles_priorities')[$admin_role] >= config('project.admin.roles_priorities.manager')); 14 | } 15 | 16 | public function for_moderator($admin) { 17 | $admin_role = $admin->getRoleNames()->first(); 18 | return (bool)(config('project.admin.roles_priorities')[$admin_role] >= config('project.admin.roles_priorities.moderator')); 19 | } 20 | 21 | public function for_administrator($admin) { 22 | $admin_role = $admin->getRoleNames()->first(); 23 | return (bool)(config('project.admin.roles_priorities')[$admin_role] >= config('project.admin.roles_priorities.administrator')); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | AdminRolePolicy::class, 14 | ]; 15 | 16 | public function boot() 17 | { 18 | $this->registerPolicies(); 19 | 20 | Gate::define('for_manager', 'AdminRolePolicy@for_manager'); 21 | Gate::define('for_moderator', 'AdminRolePolicy@for_moderator'); 22 | Gate::define('for_administrator', 'AdminRolePolicy@for_administrator'); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 14 | SendEmailVerificationNotification::class, 15 | ], 16 | ]; 17 | 18 | public function boot() 19 | { 20 | parent::boot(); 21 | 22 | // 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 20 | $this->mapWebRoutes(); 21 | $this->mapAdminRoutes(); 22 | } 23 | 24 | protected function mapWebRoutes() 25 | { 26 | Route::middleware('web') 27 | ->namespace($this->namespace . '\User') 28 | ->group(base_path('routes/web.php')); 29 | } 30 | 31 | protected function mapAdminRoutes() 32 | { 33 | Route::middleware('web') 34 | ->as('admin.') 35 | ->prefix(config('project.admin.prefix')) 36 | ->namespace($this->namespace . '\Admin') 37 | ->group(base_path('routes/admin.php')); 38 | } 39 | 40 | protected function mapApiRoutes() 41 | { 42 | Route::prefix('api') 43 | ->middleware('api') 44 | ->namespace($this->namespace) 45 | ->group(base_path('routes/api.php')); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /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.1.3", 12 | "boolfalse/clearcaches": "^1.1", 13 | "fideloper/proxy": "^4.0", 14 | "intervention/image": "^2.5", 15 | "laravel/framework": "5.8.*", 16 | "laravel/tinker": "^1.0", 17 | "spatie/laravel-permission": "^2.37", 18 | "yajra/laravel-datatables-oracle": "^9.4" 19 | }, 20 | "require-dev": { 21 | "beyondcode/laravel-dump-server": "^1.0", 22 | "filp/whoops": "^2.0", 23 | "fzaninotto/faker": "^1.4", 24 | "mockery/mockery": "^1.0", 25 | "nunomaduro/collision": "^3.0", 26 | "phpunit/phpunit": "^7.5" 27 | }, 28 | "config": { 29 | "optimize-autoloader": true, 30 | "preferred-install": "dist", 31 | "sort-packages": true 32 | }, 33 | "extra": { 34 | "laravel": { 35 | "dont-discover": [] 36 | } 37 | }, 38 | "autoload": { 39 | "psr-4": { 40 | "App\\": "app/" 41 | }, 42 | "classmap": [ 43 | "database/seeds", 44 | "database/factories" 45 | ] 46 | }, 47 | "autoload-dev": { 48 | "psr-4": { 49 | "Tests\\": "tests/" 50 | } 51 | }, 52 | "minimum-stability": "dev", 53 | "prefer-stable": true, 54 | "scripts": { 55 | "post-autoload-dump": [ 56 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 57 | "@php artisan package:discover --ansi" 58 | ], 59 | "post-root-package-install": [ 60 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 61 | ], 62 | "post-create-project-cmd": [ 63 | "@php artisan key:generate --ansi" 64 | ] 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 6 | 'guard' => 'web', 7 | 'passwords' => 'users', 8 | ], 9 | 10 | 'guards' => [ 11 | 'web' => [ 12 | 'driver' => 'session', 13 | 'provider' => 'users', 14 | ], 15 | 16 | 'admin' => [ 17 | 'driver' => 'session', 18 | 'provider' => 'admins', 19 | ], 20 | 21 | 'api' => [ 22 | 'driver' => 'token', 23 | 'provider' => 'users', 24 | 'hash' => false, 25 | ], 26 | ], 27 | 28 | 'providers' => [ 29 | 'users' => [ 30 | 'driver' => 'eloquent', 31 | 'model' => App\Models\User::class, 32 | ], 33 | 'admins' => [ 34 | 'driver' => 'eloquent', 35 | 'model' => App\Models\Admin::class, 36 | ], 37 | ], 38 | 39 | 'passwords' => [ 40 | 'users' => [ 41 | 'provider' => 'users', 42 | 'table' => 'password_resets', 43 | 'expire' => 60, 44 | ], 45 | 'admins' => [ 46 | 'provider' => 'admins', 47 | 'table' => 'password_resets', 48 | 'expire' => 15, 49 | ], 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'encrypted' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /config/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 | ], 86 | 87 | ], 88 | 89 | /* 90 | |-------------------------------------------------------------------------- 91 | | Cache Key Prefix 92 | |-------------------------------------------------------------------------- 93 | | 94 | | When utilizing a RAM based store such as APC or Memcached, there might 95 | | be other applications utilizing the same cache. So, we'll specify a 96 | | value to get prefixed to all our keys so we can avoid collisions. 97 | | 98 | */ 99 | 100 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 101 | 102 | ]; 103 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | env('DB_CONNECTION', 'mysql'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Database Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here are each of the database connections setup for your application. 26 | | Of course, examples of configuring each database platform that is 27 | | supported by Laravel is shown below to make development simple. 28 | | 29 | | 30 | | All database work in Laravel is done through the PHP PDO facilities 31 | | so make sure you have the driver for your particular database of 32 | | choice installed on your machine before you begin development. 33 | | 34 | */ 35 | 36 | 'connections' => [ 37 | 38 | 'sqlite' => [ 39 | 'driver' => 'sqlite', 40 | 'url' => env('DATABASE_URL'), 41 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 42 | 'prefix' => '', 43 | 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 44 | ], 45 | 46 | 'mysql' => [ 47 | 'driver' => 'mysql', 48 | 'url' => env('DATABASE_URL'), 49 | 'host' => env('DB_HOST', '127.0.0.1'), 50 | 'port' => env('DB_PORT', '3306'), 51 | 'database' => env('DB_DATABASE', 'forge'), 52 | 'username' => env('DB_USERNAME', 'forge'), 53 | 'password' => env('DB_PASSWORD', ''), 54 | 'unix_socket' => env('DB_SOCKET', ''), 55 | 'charset' => 'utf8mb4', 56 | 'collation' => 'utf8mb4_unicode_ci', 57 | 'prefix' => '', 58 | 'prefix_indexes' => true, 59 | 'strict' => true, 60 | 'engine' => null, 61 | 'options' => extension_loaded('pdo_mysql') ? array_filter([ 62 | PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), 63 | ]) : [], 64 | ], 65 | 66 | 'pgsql' => [ 67 | 'driver' => 'pgsql', 68 | 'url' => env('DATABASE_URL'), 69 | 'host' => env('DB_HOST', '127.0.0.1'), 70 | 'port' => env('DB_PORT', '5432'), 71 | 'database' => env('DB_DATABASE', 'forge'), 72 | 'username' => env('DB_USERNAME', 'forge'), 73 | 'password' => env('DB_PASSWORD', ''), 74 | 'charset' => 'utf8', 75 | 'prefix' => '', 76 | 'prefix_indexes' => true, 77 | 'schema' => 'public', 78 | 'sslmode' => 'prefer', 79 | ], 80 | 81 | 'sqlsrv' => [ 82 | 'driver' => 'sqlsrv', 83 | 'url' => env('DATABASE_URL'), 84 | 'host' => env('DB_HOST', 'localhost'), 85 | 'port' => env('DB_PORT', '1433'), 86 | 'database' => env('DB_DATABASE', 'forge'), 87 | 'username' => env('DB_USERNAME', 'forge'), 88 | 'password' => env('DB_PASSWORD', ''), 89 | 'charset' => 'utf8', 90 | 'prefix' => '', 91 | 'prefix_indexes' => true, 92 | ], 93 | 94 | ], 95 | 96 | /* 97 | |-------------------------------------------------------------------------- 98 | | Migration Repository Table 99 | |-------------------------------------------------------------------------- 100 | | 101 | | This table keeps track of all the migrations that have already run for 102 | | your application. Using this information, we can determine which of 103 | | the migrations on disk haven't actually been run in the database. 104 | | 105 | */ 106 | 107 | 'migrations' => 'migrations', 108 | 109 | /* 110 | |-------------------------------------------------------------------------- 111 | | Redis Databases 112 | |-------------------------------------------------------------------------- 113 | | 114 | | Redis is an open source, fast, and advanced key-value store that also 115 | | provides a richer body of commands than a typical key-value system 116 | | such as APC or Memcached. Laravel makes it easy to dig right in. 117 | | 118 | */ 119 | 120 | 'redis' => [ 121 | 122 | 'client' => env('REDIS_CLIENT', 'predis'), 123 | 124 | 'options' => [ 125 | 'cluster' => env('REDIS_CLUSTER', 'predis'), 126 | 'prefix' => Str::slug(env('APP_NAME', 'laravel'), '_').'_database_', 127 | ], 128 | 129 | 'default' => [ 130 | 'host' => env('REDIS_HOST', '127.0.0.1'), 131 | 'password' => env('REDIS_PASSWORD', null), 132 | 'port' => env('REDIS_PORT', 6379), 133 | 'database' => env('REDIS_DB', 0), 134 | ], 135 | 136 | 'cache' => [ 137 | 'host' => env('REDIS_HOST', '127.0.0.1'), 138 | 'password' => env('REDIS_PASSWORD', null), 139 | 'port' => env('REDIS_PORT', 6379), 140 | 'database' => env('REDIS_CACHE_DB', 1), 141 | ], 142 | 143 | ], 144 | 145 | ]; 146 | -------------------------------------------------------------------------------- /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", "rackspace" 41 | | 42 | */ 43 | 44 | 'disks' => [ 45 | 46 | 'local' => [ 47 | 'driver' => 'local', 48 | 'root' => storage_path('app'), 49 | ], 50 | 51 | 'public' => [ 52 | 'driver' => 'local', 53 | 'root' => storage_path('app/public'), 54 | 'url' => env('APP_URL').'/storage', 55 | 'visibility' => 'public', 56 | ], 57 | 58 | 's3' => [ 59 | 'driver' => 's3', 60 | 'key' => env('AWS_ACCESS_KEY_ID'), 61 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 62 | 'region' => env('AWS_DEFAULT_REGION'), 63 | 'bucket' => env('AWS_BUCKET'), 64 | 'url' => env('AWS_URL'), 65 | ], 66 | 67 | ], 68 | 69 | ]; 70 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Log Channels 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may configure the log channels for your application. Out of 27 | | the box, Laravel uses the Monolog PHP logging library. This gives 28 | | you a variety of powerful log handlers / formatters to utilize. 29 | | 30 | | Available Drivers: "single", "daily", "slack", "syslog", 31 | | "errorlog", "monolog", 32 | | "custom", "stack" 33 | | 34 | */ 35 | 36 | 'channels' => [ 37 | 'stack' => [ 38 | 'driver' => 'stack', 39 | 'channels' => ['daily'], 40 | 'ignore_exceptions' => false, 41 | ], 42 | 43 | 'single' => [ 44 | 'driver' => 'single', 45 | 'path' => storage_path('logs/laravel.log'), 46 | 'level' => 'debug', 47 | ], 48 | 49 | 'daily' => [ 50 | 'driver' => 'daily', 51 | 'path' => storage_path('logs/laravel.log'), 52 | 'level' => 'debug', 53 | 'days' => 14, 54 | ], 55 | 56 | 'slack' => [ 57 | 'driver' => 'slack', 58 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 59 | 'username' => 'Laravel Log', 60 | 'emoji' => ':boom:', 61 | 'level' => 'critical', 62 | ], 63 | 64 | 'papertrail' => [ 65 | 'driver' => 'monolog', 66 | 'level' => 'debug', 67 | 'handler' => SyslogUdpHandler::class, 68 | 'handler_with' => [ 69 | 'host' => env('PAPERTRAIL_URL'), 70 | 'port' => env('PAPERTRAIL_PORT'), 71 | ], 72 | ], 73 | 74 | 'stderr' => [ 75 | 'driver' => 'monolog', 76 | 'handler' => StreamHandler::class, 77 | 'formatter' => env('LOG_STDERR_FORMATTER'), 78 | 'with' => [ 79 | 'stream' => 'php://stderr', 80 | ], 81 | ], 82 | 83 | 'syslog' => [ 84 | 'driver' => 'syslog', 85 | 'level' => 'debug', 86 | ], 87 | 88 | 'errorlog' => [ 89 | 'driver' => 'errorlog', 90 | 'level' => 'debug', 91 | ], 92 | ], 93 | 94 | ]; 95 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => [ 59 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 60 | 'name' => env('MAIL_FROM_NAME', 'Example'), 61 | ], 62 | 63 | /* 64 | |-------------------------------------------------------------------------- 65 | | E-Mail Encryption Protocol 66 | |-------------------------------------------------------------------------- 67 | | 68 | | Here you may specify the encryption protocol that should be used when 69 | | the application send e-mail messages. A sensible default using the 70 | | transport layer security protocol should provide great security. 71 | | 72 | */ 73 | 74 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | SMTP Server Username 79 | |-------------------------------------------------------------------------- 80 | | 81 | | If your SMTP server requires a username for authentication, you should 82 | | set it here. This will get used to authenticate with your server on 83 | | connection. You may also set the "password" value below this one. 84 | | 85 | */ 86 | 87 | 'username' => env('MAIL_USERNAME'), 88 | 89 | 'password' => env('MAIL_PASSWORD'), 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Sendmail System Path 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When using the "sendmail" driver to send e-mails, we will need to know 97 | | the path to where Sendmail lives on this server. A default path has 98 | | been provided here, which will work well on most of your systems. 99 | | 100 | */ 101 | 102 | 'sendmail' => '/usr/sbin/sendmail -bs', 103 | 104 | /* 105 | |-------------------------------------------------------------------------- 106 | | Markdown Mail Settings 107 | |-------------------------------------------------------------------------- 108 | | 109 | | If you are using Markdown based email rendering, you may configure your 110 | | theme and component paths here, allowing you to customize the design 111 | | of the emails. Or, you may simply stick with the Laravel defaults! 112 | | 113 | */ 114 | 115 | 'markdown' => [ 116 | 'theme' => 'default', 117 | 118 | 'paths' => [ 119 | resource_path('views/vendor/mail'), 120 | ], 121 | ], 122 | 123 | /* 124 | |-------------------------------------------------------------------------- 125 | | Log Channel 126 | |-------------------------------------------------------------------------- 127 | | 128 | | If you are using the "log" driver, you may specify the logging channel 129 | | if you prefer to keep mail messages separate from other log entries 130 | | for simpler reading. Otherwise, the default channel will be used. 131 | | 132 | */ 133 | 134 | 'log_channel' => env('MAIL_LOG_CHANNEL'), 135 | 136 | ]; 137 | -------------------------------------------------------------------------------- /config/permission.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'permission' => Spatie\Permission\Models\Permission::class, 6 | 'role' => Spatie\Permission\Models\Role::class, 7 | ], 8 | 'table_names' => [ 9 | 'roles' => 'roles', 10 | 'permissions' => 'permissions', 11 | 'model_has_permissions' => 'model_has_permissions', 12 | 'model_has_roles' => 'model_has_roles', 13 | 'role_has_permissions' => 'role_has_permissions', 14 | ], 15 | 'column_names' => [ 16 | 'model_morph_key' => 'model_id', 17 | ], 18 | 'display_permission_in_exception' => false, 19 | 20 | 'cache' => [ 21 | 'expiration_time' => 24 * 60, // \DateInterval::createFromDateString('24 hours'), 22 | 'key' => 'spatie.permission.cache', 23 | 'model_key' => 'name', 24 | 'store' => 'default', 25 | ], 26 | ]; 27 | -------------------------------------------------------------------------------- /config/project.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'dev_name' => env('DEV_NAME', 'test'), 6 | 'dev_email' => env('DEV_EMAIL', 'test@gmail.com'), 7 | 'dev_password' => env('DEV_PASSWORD', 'secret'), 8 | 9 | 'users_count' => 20, 10 | 'faker_image_width' => 1254, 11 | 'faker_image_height' => 836, 12 | 13 | 'products_count' => 30, 14 | 'products_dates_interval_length_days' => 10, 15 | ], 16 | 'user' => [ 17 | 'min_birth_year' => 1950, 18 | 'teen_age' => 16, 19 | 'images_folder' => 'user-images', 20 | // width, height, padding-bottom, padding-right 21 | 'image_sizes' => [ 22 | "small" => [ 23 | "w" => 70, 24 | "h" => 70, 25 | "pb" => 3, 26 | "pr" => 3, 27 | ], 28 | "medium" => [ 29 | "w" => 260, 30 | "h" => 160, 31 | "pb" => 5, 32 | "pr" => 5, 33 | ], 34 | "large" => [ 35 | "w" => 642, 36 | "h" => 440, 37 | "pb" => 10, 38 | "pr" => 10, 39 | ], 40 | ], 41 | 'image_divisions' => [ 42 | 'min' => 1.2, 43 | 'max' => 2, 44 | ], 45 | ], 46 | 'admin' => [ 47 | 'name_length_limit' => 10, 48 | 'prefix' => env('ADMIN_PREFIX', 'admin'), 49 | 'roles' => [ 50 | 'administrator' => 'administrator', 51 | 'moderator' => 'moderator', 52 | 'manager' => 'manager', 53 | ], 54 | 'roles_priorities' => [ 55 | 'administrator' => 30, 56 | 'moderator' => 20, 57 | 'manager' => 10, 58 | ], 59 | ], 60 | 'product' => [ 61 | 'title_length_limit' => 20, 62 | 'images_folder' => 'product-images', 63 | // width, height, padding-bottom, padding-right 64 | 'image_sizes' => [ 65 | "small" => [ 66 | "w" => 70, 67 | "h" => 70, 68 | "pb" => 3, 69 | "pr" => 3, 70 | ], 71 | "medium" => [ 72 | "w" => 320, 73 | "h" => 180, 74 | "pb" => 5, 75 | "pr" => 5, 76 | ], 77 | "large" => [ 78 | "w" => 1000, 79 | "h" => 600, 80 | "pb" => 10, 81 | "pr" => 10, 82 | ], 83 | ], 84 | 'image_divisions' => [ 85 | 'min' => 1.2, 86 | 'max' => 2, 87 | ], 88 | ], 89 | ]; 90 | -------------------------------------------------------------------------------- /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 | 'database' => env('DB_CONNECTION', 'mysql'), 84 | 'table' => 'failed_jobs', 85 | ], 86 | 87 | ]; 88 | -------------------------------------------------------------------------------- /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 | 'sparkpost' => [ 34 | 'secret' => env('SPARKPOST_SECRET'), 35 | ], 36 | 37 | 'stripe' => [ 38 | 'model' => App\Models\User::class, 39 | 'key' => env('STRIPE_KEY'), 40 | 'secret' => env('STRIPE_SECRET'), 41 | 'webhook' => [ 42 | 'secret' => env('STRIPE_WEBHOOK_SECRET'), 43 | 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), 44 | ], 45 | ], 46 | 47 | ]; 48 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Session Lifetime 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may specify the number of minutes that you wish the session 29 | | to be allowed to remain idle before it expires. If you want them 30 | | to immediately expire on the browser closing, set that option. 31 | | 32 | */ 33 | 34 | 'lifetime' => env('SESSION_LIFETIME', 120), 35 | 36 | 'expire_on_close' => false, 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Session Encryption 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This option allows you to easily specify that all of your session data 44 | | should be encrypted before it is stored. All encryption will be run 45 | | automatically by Laravel and you can use the Session like normal. 46 | | 47 | */ 48 | 49 | 'encrypt' => false, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Session File Location 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When using the native session driver, we need a location where session 57 | | files may be stored. A default has been set for you but a different 58 | | location may be specified. This is only needed for file sessions. 59 | | 60 | */ 61 | 62 | 'files' => storage_path('framework/sessions'), 63 | 64 | /* 65 | |-------------------------------------------------------------------------- 66 | | Session Database Connection 67 | |-------------------------------------------------------------------------- 68 | | 69 | | When using the "database" or "redis" session drivers, you may specify a 70 | | connection that should be used to manage these sessions. This should 71 | | correspond to a connection in your database configuration options. 72 | | 73 | */ 74 | 75 | 'connection' => env('SESSION_CONNECTION', null), 76 | 77 | /* 78 | |-------------------------------------------------------------------------- 79 | | Session Database Table 80 | |-------------------------------------------------------------------------- 81 | | 82 | | When using the "database" session driver, you may specify the table we 83 | | should use to manage the sessions. Of course, a sensible default is 84 | | provided for you; however, you are free to change this as needed. 85 | | 86 | */ 87 | 88 | 'table' => 'sessions', 89 | 90 | /* 91 | |-------------------------------------------------------------------------- 92 | | Session Cache Store 93 | |-------------------------------------------------------------------------- 94 | | 95 | | When using the "apc", "memcached", or "dynamodb" session drivers you may 96 | | list a cache store that should be used for these sessions. This value 97 | | must match with one of the application's configured cache "stores". 98 | | 99 | */ 100 | 101 | 'store' => env('SESSION_STORE', null), 102 | 103 | /* 104 | |-------------------------------------------------------------------------- 105 | | Session Sweeping Lottery 106 | |-------------------------------------------------------------------------- 107 | | 108 | | Some session drivers must manually sweep their storage location to get 109 | | rid of old sessions from storage. Here are the chances that it will 110 | | happen on a given request. By default, the odds are 2 out of 100. 111 | | 112 | */ 113 | 114 | 'lottery' => [2, 100], 115 | 116 | /* 117 | |-------------------------------------------------------------------------- 118 | | Session Cookie Name 119 | |-------------------------------------------------------------------------- 120 | | 121 | | Here you may change the name of the cookie used to identify a session 122 | | instance by ID. The name specified here will get used every time a 123 | | new session cookie is created by the framework for every driver. 124 | | 125 | */ 126 | 127 | 'cookie' => env( 128 | 'SESSION_COOKIE', 129 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 130 | ), 131 | 132 | /* 133 | |-------------------------------------------------------------------------- 134 | | Session Cookie Path 135 | |-------------------------------------------------------------------------- 136 | | 137 | | The session cookie path determines the path for which the cookie will 138 | | be regarded as available. Typically, this will be the root path of 139 | | your application but you are free to change this when necessary. 140 | | 141 | */ 142 | 143 | 'path' => '/', 144 | 145 | /* 146 | |-------------------------------------------------------------------------- 147 | | Session Cookie Domain 148 | |-------------------------------------------------------------------------- 149 | | 150 | | Here you may change the domain of the cookie used to identify a session 151 | | in your application. This will determine which domains the cookie is 152 | | available to in your application. A sensible default has been set. 153 | | 154 | */ 155 | 156 | 'domain' => env('SESSION_DOMAIN', null), 157 | 158 | /* 159 | |-------------------------------------------------------------------------- 160 | | HTTPS Only Cookies 161 | |-------------------------------------------------------------------------- 162 | | 163 | | By setting this option to true, session cookies will only be sent back 164 | | to the server if the browser has a HTTPS connection. This will keep 165 | | the cookie from being sent to you if it can not be done securely. 166 | | 167 | */ 168 | 169 | 'secure' => env('SESSION_SECURE_COOKIE', false), 170 | 171 | /* 172 | |-------------------------------------------------------------------------- 173 | | HTTP Access Only 174 | |-------------------------------------------------------------------------- 175 | | 176 | | Setting this value to true will prevent JavaScript from accessing the 177 | | value of the cookie and the cookie will only be accessible through 178 | | the HTTP protocol. You are free to modify this option if needed. 179 | | 180 | */ 181 | 182 | 'http_only' => true, 183 | 184 | /* 185 | |-------------------------------------------------------------------------- 186 | | Same-Site Cookies 187 | |-------------------------------------------------------------------------- 188 | | 189 | | This option determines how your cookies behave when cross-site requests 190 | | take place, and can be used to mitigate CSRF attacks. By default, we 191 | | do not enable this as other CSRF protection services are in place. 192 | | 193 | | Supported: "lax", "strict" 194 | | 195 | */ 196 | 197 | 'same_site' => null, 198 | 199 | ]; 200 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 9 | return [ 10 | 'name' => $faker->name, 11 | 'email' => $faker->unique()->safeEmail, 12 | 'email_verified_at' => now(), 13 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 14 | 'remember_token' => Str::random(10), 15 | ]; 16 | }); 17 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_admins_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 13 | $table->string('name'); 14 | $table->string('email')->unique(); 15 | $table->string('password'); 16 | $table->rememberToken(); 17 | $table->timestamps(); 18 | }); 19 | } 20 | 21 | public function down() 22 | { 23 | Schema::dropIfExists('admins'); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 14 | $table->string('name'); 15 | $table->string('email')->unique(); 16 | $table->enum('status', [ 17 | User::ACTIVE, 18 | User::NOT_ACTIVE, 19 | ])->default(User::NOT_ACTIVE); 20 | $table->string('address')->nullable(); 21 | $table->unsignedSmallInteger('birth_year')->nullable(); 22 | $table->string('image')->nullable(); 23 | $table->string('original_image_path')->nullable(); 24 | $table->timestamp('email_verified_at')->nullable(); 25 | $table->string('password'); 26 | $table->rememberToken(); 27 | $table->timestamps(); 28 | }); 29 | } 30 | 31 | public function down() 32 | { 33 | Schema::dropIfExists('users'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 13 | $table->string('token'); 14 | $table->timestamp('created_at')->nullable(); 15 | }); 16 | } 17 | 18 | public function down() 19 | { 20 | Schema::dropIfExists('password_resets'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /database/migrations/2019_07_01_060651_create_permission_tables.php: -------------------------------------------------------------------------------- 1 | increments('id'); 16 | $table->string('name'); 17 | $table->string('guard_name'); 18 | $table->timestamps(); 19 | }); 20 | 21 | Schema::create($tableNames['roles'], function (Blueprint $table) { 22 | $table->increments('id'); 23 | $table->string('name'); 24 | $table->string('guard_name'); 25 | $table->timestamps(); 26 | }); 27 | 28 | Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames) { 29 | $table->unsignedInteger('permission_id'); 30 | 31 | $table->string('model_type'); 32 | $table->unsignedBigInteger($columnNames['model_morph_key']); 33 | $table->index([$columnNames['model_morph_key'], 'model_type', ]); 34 | 35 | $table->foreign('permission_id') 36 | ->references('id') 37 | ->on($tableNames['permissions']) 38 | ->onDelete('cascade'); 39 | 40 | $table->primary(['permission_id', $columnNames['model_morph_key'], 'model_type'], 41 | 'model_has_permissions_permission_model_type_primary'); 42 | }); 43 | 44 | Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames) { 45 | $table->unsignedInteger('role_id'); 46 | 47 | $table->string('model_type'); 48 | $table->unsignedBigInteger($columnNames['model_morph_key']); 49 | $table->index([$columnNames['model_morph_key'], 'model_type', ]); 50 | 51 | $table->foreign('role_id') 52 | ->references('id') 53 | ->on($tableNames['roles']) 54 | ->onDelete('cascade'); 55 | 56 | $table->primary(['role_id', $columnNames['model_morph_key'], 'model_type'], 57 | 'model_has_roles_role_model_type_primary'); 58 | }); 59 | 60 | Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { 61 | $table->unsignedInteger('permission_id'); 62 | $table->unsignedInteger('role_id'); 63 | 64 | $table->foreign('permission_id') 65 | ->references('id') 66 | ->on($tableNames['permissions']) 67 | ->onDelete('cascade'); 68 | 69 | $table->foreign('role_id') 70 | ->references('id') 71 | ->on($tableNames['roles']) 72 | ->onDelete('cascade'); 73 | 74 | $table->primary(['permission_id', 'role_id']); 75 | }); 76 | 77 | app('cache') 78 | ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null) 79 | ->forget(config('permission.cache.key')); 80 | } 81 | 82 | public function down() 83 | { 84 | $tableNames = config('permission.table_names'); 85 | 86 | Schema::drop($tableNames['role_has_permissions']); 87 | Schema::drop($tableNames['model_has_roles']); 88 | Schema::drop($tableNames['model_has_permissions']); 89 | Schema::drop($tableNames['roles']); 90 | Schema::drop($tableNames['permissions']); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /database/migrations/2019_07_19_174507_create_products_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 14 | 15 | $table->bigInteger('admin_id')->unsigned()->nullable(); 16 | $table->foreign('admin_id') 17 | ->references('id') 18 | ->on('admins') 19 | ->onUpdate('cascade') 20 | ->onDelete('cascade'); 21 | 22 | $table->enum('status', [ 23 | Product::BLOCKED, 24 | Product::PENDING, 25 | Product::APPROVED, 26 | ])->default(Product::PENDING); 27 | 28 | $table->string('title')->nullable(); 29 | $table->text('description')->nullable(); 30 | 31 | $table->string('main_image')->nullable(); 32 | 33 | $table->timestamps(); 34 | $table->dateTime('published_at')->nullable(); 35 | $table->softDeletes(); 36 | }); 37 | } 38 | 39 | public function down() 40 | { 41 | Schema::dropIfExists('products'); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /database/seeds/AdminSeeder.php: -------------------------------------------------------------------------------- 1 | 'admin', 14 | 'name' => $role 15 | ]); 16 | }; 17 | 18 | $admins = [ 19 | [ 20 | 'role' => 'administrator', 21 | 'name' => 'Admin', 22 | 'email' => 'administrator@gmail.com', 23 | 'password' => 'secret', 24 | ], 25 | [ 26 | 'role' => 'moderator', 27 | 'name' => 'Moderator', 28 | 'email' => 'moderator@gmail.com', 29 | 'password' => 'secret', 30 | ], 31 | [ 32 | 'role' => 'manager', 33 | 'name' => 'Manager', 34 | 'email' => 'manager@gmail.com', 35 | 'password' => 'secret', 36 | ], 37 | ]; 38 | 39 | foreach ($admins as $admin) { 40 | $exist = Admin::where('email', $admin['email'])->first(); 41 | if(empty($exist)){ 42 | $super_admin = Admin::firstOrCreate([ 43 | 'name' => $admin['name'], 44 | 'email' => $admin['email'], 45 | 'password' => bcrypt($admin['password']), 46 | ]); 47 | $super_admin->assignRole($admin['role']); 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(AdminSeeder::class); 10 | $this->call(UserSeeder::class); 11 | $this->call(ProductSeeder::class); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /database/seeds/ProductSeeder.php: -------------------------------------------------------------------------------- 1 | dateTimeInInterval('-' . $interval_length . ' days', '+ ' . $interval_length . ' days', null); // start date, interval, timezone 18 | } 19 | 20 | $datetimes_array = []; 21 | for ($k = 0; $k < $count; $k++){ 22 | $datetimes_array[] = $tmp[$k]->format('Y-m-d'); 23 | } 24 | 25 | function date_sort_2($a, $b) { 26 | return strtotime($a) - strtotime($b); 27 | } 28 | usort($datetimes_array, "date_sort_2"); 29 | 30 | $response = []; 31 | for ($k = 0; $k < $count; $k++){ 32 | $response[] = new Carbon($datetimes_array[$k]); 33 | } 34 | 35 | return $response; 36 | } 37 | 38 | public function run() 39 | { 40 | $faker = Factory::create('en_US'); 41 | $count = config('project.seed.products_count'); 42 | $interval_length = config('project.seed.products_dates_interval_length_days'); 43 | $datetimes_array = $this->generateOrderedCarbonDates($faker, $count, $interval_length); 44 | 45 | $initial_path = storage_path('app' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . config('project.product.images_folder')); 46 | if(!File::exists($initial_path)) { 47 | File::makeDirectory($initial_path, $mode = 0777, true, true); 48 | } 49 | foreach ($datetimes_array as $date) 50 | { 51 | $original_image_path = $initial_path . DIRECTORY_SEPARATOR . $date->year; 52 | if(!File::exists($original_image_path)) { 53 | File::makeDirectory($original_image_path, $mode = 0777, true, true); 54 | } 55 | $original_image_path .= DIRECTORY_SEPARATOR . $date->month; 56 | if(!File::exists($original_image_path)) { 57 | File::makeDirectory($original_image_path, $mode = 0777, true, true); 58 | } 59 | $original_image_path .= DIRECTORY_SEPARATOR . $date->day; 60 | if(!File::exists($original_image_path)) { 61 | File::makeDirectory($original_image_path, $mode = 0777, true, true); 62 | } 63 | } 64 | $uploads_path = public_path('uploads' . DIRECTORY_SEPARATOR . config('project.product.images_folder')); 65 | if (!file_exists($uploads_path)) { 66 | mkdir($uploads_path, 0755, true); 67 | } 68 | foreach (config('project.product.image_sizes') as $version => $sizes){ 69 | if (!file_exists($uploads_path . DIRECTORY_SEPARATOR . $version)) { 70 | mkdir($uploads_path . DIRECTORY_SEPARATOR . $version, 0755, true); 71 | } 72 | } 73 | 74 | $admin_ids_array = Admin::all()->pluck('id')->toArray(); 75 | 76 | $i = 0; 77 | while ($i < $count){ 78 | $this->uploadImage($uploads_path, $datetimes_array[$i], $admin_ids_array, $faker); 79 | $i++; 80 | } 81 | } 82 | 83 | public function uploadImage($uploads_path, $date, $admin_ids_array, $faker): void 84 | { 85 | $main_image_name = $faker->image('storage/app/public/' . config('project.product.images_folder') . '/' . $date->year . '/' . $date->month . '/' . $date->day, config('project.seed.faker_image_width'), config('project.seed.faker_image_height'), null, false); 86 | // $main_image_name = $faker->image($original_image_path, null, false); 87 | // this worked on Windows 7 x64 too, but not for Ubuntu 18.04 88 | // that throw an error like this 89 | // InvalidArgumentException : Cannot write to directory "/home/.../test/web/backend/storage/app/public/products/2019/1/10" 90 | 91 | $filepath = storage_path('app' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . config('project.product.images_folder') . DIRECTORY_SEPARATOR . $date->year . DIRECTORY_SEPARATOR . $date->month . DIRECTORY_SEPARATOR . $date->day . DIRECTORY_SEPARATOR . $main_image_name); 92 | $getimagesize = getimagesize($filepath); 93 | $div = $getimagesize[0] / $getimagesize[1]; 94 | 95 | foreach (config('project.product.image_sizes') as $version => $sizes) 96 | { 97 | $image_path = $uploads_path . DIRECTORY_SEPARATOR . $version . DIRECTORY_SEPARATOR . $main_image_name; 98 | 99 | $new_w = $div < config('project.product.image_divisions.min') ? null : $sizes['w']; 100 | $new_h = $div > config('project.product.image_divisions.max') ? null : $sizes['h']; 101 | 102 | $img = Image::make($filepath) 103 | ->resize($new_w, $new_h, function ($constraint) use ($div) { 104 | if($div < config('project.product.image_divisions.min') || $div > config('project.product.image_divisions.max')) { 105 | $constraint->aspectRatio(); 106 | } 107 | }); 108 | $img->insert(public_path('images/watermarks/' . $version . '_watermark.png'), 'bottom-right', $sizes['pb'], $sizes['pr']); 109 | 110 | if($div < config('project.product.image_divisions.min') || $div > config('project.product.image_divisions.max')){ 111 | $img->resizeCanvas($sizes['w'], $sizes['h'], 'center', false, '#000000'); 112 | Image::canvas($sizes['w'], $sizes['h'])->insert($img, 'center')->save($image_path); 113 | } 114 | 115 | $img->save($image_path); 116 | } 117 | 118 | $statuses = [ 119 | Product::BLOCKED, 120 | Product::PENDING, 121 | Product::APPROVED, 122 | ]; 123 | $status = $faker->randomElement($statuses); 124 | $random_title = $faker->sentence(mt_rand(1, 4), true); 125 | $random_description = $faker->realText(200, 1); 126 | $admin_id = $faker->randomElement($admin_ids_array); 127 | 128 | Product::create([ 129 | 'title' => $random_title, 130 | 'description' => $random_description, 131 | 'main_image' => $main_image_name, 132 | 'admin_id' => $admin_id, 133 | 'status' => $status, 134 | 'created_at' => $date, 135 | 'updated_at' => $date, 136 | ]); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /database/seeds/UserSeeder.php: -------------------------------------------------------------------------------- 1 | config('project.seed.dev_name'), 19 | 'email' => config('project.seed.dev_email'), 20 | 'status' => User::ACTIVE, 21 | 'password' => bcrypt(config('project.seed.dev_password')), 22 | ]); 23 | } 24 | 25 | public function run() 26 | { 27 | $this->create_dev_users(); 28 | 29 | // necessary definitions 30 | $faker = Factory::create('en_US'); 31 | $date = Carbon::now(); 32 | $initial_path = storage_path('app' . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR . config('project.user.images_folder')); 33 | 34 | // creates 'storage/app/public/user-images' folder if it's not exists 35 | if(!File::exists($initial_path)) { 36 | File::makeDirectory($initial_path, $mode = 0777, true, true); 37 | } 38 | 39 | // creates something like '2019/7/3/' inside of 'user-images' (in storage) 40 | $original_image_path = $initial_path . DIRECTORY_SEPARATOR . $date->year; 41 | if(!File::exists($original_image_path)) { 42 | File::makeDirectory($original_image_path, $mode = 0777, true, true); 43 | } 44 | $original_image_path .= DIRECTORY_SEPARATOR . $date->month; 45 | if(!File::exists($original_image_path)) { 46 | File::makeDirectory($original_image_path, $mode = 0777, true, true); 47 | } 48 | $original_image_path .= DIRECTORY_SEPARATOR . $date->day; 49 | if(!File::exists($original_image_path)) { 50 | File::makeDirectory($original_image_path, $mode = 0777, true, true); 51 | } 52 | 53 | $uploads_path = public_path('uploads' . DIRECTORY_SEPARATOR . config('project.user.images_folder')); 54 | // if (!file_exists($uploads_path)) { 55 | // mkdir($uploads_path, 0755, true); 56 | // } 57 | 58 | // creates 'small', 'medium', 'large' folders inside of 'public/user-images/' 59 | foreach (config('project.user.image_sizes') as $version => $sizes){ 60 | if (!file_exists($uploads_path . DIRECTORY_SEPARATOR . $version)) { 61 | mkdir($uploads_path . DIRECTORY_SEPARATOR . $version, 0755, true); 62 | } 63 | } 64 | 65 | $user_statuses = [ 66 | User::ACTIVE, 67 | User::NOT_ACTIVE, 68 | ]; 69 | 70 | // add candidate users to the $seed_items 71 | for ($i = 0; $i < config('project.seed.users_count'); $i++) { 72 | $status = $faker->randomElement($user_statuses); 73 | $this->uploadImage($uploads_path, $date, $faker, $status); 74 | } 75 | 76 | // create users via importing $seed_items to 'users' table 77 | DB::table('users')->insert($this->seed_items); 78 | } 79 | 80 | public function uploadImage($uploads_path, $date, $faker, $status): void 81 | { 82 | // storage folder path 83 | $faker_image_folder_path = 'storage' . DIRECTORY_SEPARATOR . 84 | 'app' . DIRECTORY_SEPARATOR . 85 | 'public' . DIRECTORY_SEPARATOR . 86 | config('project.user.images_folder') . DIRECTORY_SEPARATOR . 87 | $date->year . DIRECTORY_SEPARATOR . 88 | $date->month . DIRECTORY_SEPARATOR . 89 | $date->day; 90 | 91 | // download requested image to storage folder 92 | $main_image_name = $faker->image($faker_image_folder_path, 93 | config('project.seed.faker_image_width'), 94 | config('project.seed.faker_image_height'), 95 | null, 96 | false); 97 | 98 | // get generated image path (including the name) from storage 99 | $filepath = storage_path('app' . DIRECTORY_SEPARATOR . 100 | 'public' . DIRECTORY_SEPARATOR . 101 | config('project.user.images_folder') . DIRECTORY_SEPARATOR . 102 | $date->year . DIRECTORY_SEPARATOR . 103 | $date->month . DIRECTORY_SEPARATOR . 104 | $date->day . DIRECTORY_SEPARATOR . 105 | $main_image_name); 106 | 107 | $getImageSize = getimagesize($filepath); 108 | $div = $getImageSize[0] / $getImageSize[1]; // division of image sizes 109 | 110 | foreach (config('project.user.image_sizes') as $version => $sizes) 111 | { 112 | $image_path = $uploads_path . DIRECTORY_SEPARATOR . $version . DIRECTORY_SEPARATOR . $main_image_name; 113 | 114 | $new_w = $div < config('project.user.image_divisions.min') ? null : $sizes['w']; 115 | $new_h = $div > config('project.user.image_divisions.max') ? null : $sizes['h']; 116 | 117 | // outputs processed image in 'public/user-images//' folder 118 | $img = Image::make($filepath) 119 | ->resize($new_w, $new_h, function ($constraint) use ($div) { 120 | if($div < config('project.user.image_divisions.min') || $div > config('project.user.image_divisions.max')) { 121 | $constraint->aspectRatio(); // resize image, if division of dimensions aren't between 1.2 and 2 122 | } 123 | }); 124 | 125 | // make watermark for current image 126 | $img->insert(public_path('images' . DIRECTORY_SEPARATOR . 'watermarks' . DIRECTORY_SEPARATOR . $version . '_watermark.png'), 127 | 'bottom-right', 128 | $sizes['pb'], 129 | $sizes['pr']); 130 | 131 | // if division of dimensions aren't between 1.2 and 2, then add a color 132 | if($div < config('project.user.image_divisions.min') || $div > config('project.user.image_divisions.max')){ 133 | $img->resizeCanvas($sizes['w'], $sizes['h'], 'center', false, '#000000'); 134 | Image::canvas($sizes['w'], $sizes['h'])->insert($img, 'center')->save($image_path); 135 | } 136 | 137 | $img->save($image_path); 138 | } 139 | 140 | // collect all users data in one variable 141 | $this->seed_items[] = [ 142 | 'name' => $faker->name, 143 | 'email' => $faker->email, 144 | 'status' => $status, 145 | 'password' => bcrypt('secret'), 146 | 'created_at' => $date, 147 | 'updated_at' => $date, 148 | 149 | 'address' => $faker->address, 150 | 'birth_year' => $faker->numberBetween(config('project.user.min_birth_year'), $date->year - config('project.user.teen_age')), 151 | 'image' => $main_image_name, 152 | 'original_image_path' => $date->year . DIRECTORY_SEPARATOR . $date->month . DIRECTORY_SEPARATOR . $date->day . DIRECTORY_SEPARATOR . $main_image_name, 153 | ]; 154 | } 155 | 156 | } 157 | -------------------------------------------------------------------------------- /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.21", 14 | "bootstrap": "^4.1.0", 15 | "cross-env": "^5.1", 16 | "jquery": "^3.5", 17 | "laravel-mix": "^4.0.7", 18 | "lodash": "^4.17.21", 19 | "popper.js": "^1.12", 20 | "resolve-url-loader": "^2.3.1", 21 | "sass": "^1.15.2", 22 | "sass-loader": "^7.1.0", 23 | "vue": "^2.5.17", 24 | "vue-template-compiler": "^2.6.10" 25 | }, 26 | "dependencies": { 27 | "admin-lte": "^2.4.15", 28 | "lodash.template": "^4.5.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/Unit 14 | 15 | 16 | 17 | ./tests/Feature 18 | 19 | 20 | 21 | 22 | ./app 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /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 | # Handle Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/css/.gitignore: -------------------------------------------------------------------------------- 1 | app.css 2 | dashboard.css 3 | -------------------------------------------------------------------------------- /public/css/admin/switcher3.css: -------------------------------------------------------------------------------- 1 | .parent{ 2 | position:fixed; 3 | width:100%; 4 | height:100%; 5 | display:inline-flex; 6 | background:#fff; 7 | } 8 | 9 | @import url(https://fonts.googleapis.com/css?family=Sintony); 10 | 11 | .switcher{ 12 | margin:auto; 13 | font-size:1em; 14 | font-family:sintony; 15 | height:2em; 16 | line-height:2em; 17 | border-radius:0.3em; 18 | background:#ccc; 19 | position:relative; 20 | display:block; 21 | float:left; 22 | } 23 | .switch.blocked, 24 | .switch.pending, 25 | .switch.edited, 26 | .switch.approved{ 27 | cursor:pointer; 28 | position:relative; 29 | display:block; 30 | float:left; 31 | padding: 0 1em; 32 | -webkit-transition: 300ms ease-out; 33 | -moz-transition: 300ms ease-out; 34 | transition: 300ms ease-out; 35 | } 36 | .switch.active{ 37 | color:white; 38 | border-radius:0.3em; 39 | -moz-box-shadow: 0px 0px 7px 1px #656565; 40 | -webkit-box-shadow: 0px 0px 7px 1px #656565; 41 | -o-box-shadow: 0px 0px 7px 1px #656565; 42 | box-shadow: 0px 0px 7px 1px #656565; 43 | filter:progid:DXImageTransform.Microsoft.Shadow(color=#656565, Direction=NaN, Strength=7); 44 | } 45 | .switch.blocked.active{ 46 | background-color:#777777; 47 | } 48 | .switch.pending.active{ 49 | background-color:#418d92; 50 | } 51 | .switch.edited.active{ 52 | background-color:#D39745; 53 | } 54 | .switch.approved.active{ 55 | background-color:#4d7ea9; 56 | } 57 | 58 | .switcher{ 59 | margin:auto; 60 | font-size:1em; 61 | font-family:sintony; 62 | height:2em; 63 | line-height:2em; 64 | border-radius:0.3em; 65 | background:#ccc; 66 | position:relative; 67 | display:block; 68 | float:left; 69 | } 70 | 71 | .switch2.blocked, 72 | .switch2.pending, 73 | .switch2.edited, 74 | .switch2.approved{ 75 | cursor:pointer; 76 | position:relative; 77 | display:block; 78 | float:left; 79 | -webkit-transition: 300ms ease-out; 80 | -moz-transition: 300ms ease-out; 81 | transition: 300ms ease-out; 82 | padding: 0 1em; 83 | } 84 | .selector{ 85 | text-align:center; 86 | position:absolute; 87 | width:0; 88 | box-sizing:border-box; 89 | -webkit-transition: 300ms ease-out; 90 | -moz-transition: 300ms ease-out; 91 | transition: 300ms ease-out; 92 | border-radius:0.3em; 93 | color:white; 94 | -moz-box-shadow: 0px 2px 13px 0px #9b9b9b; 95 | -webkit-box-shadow: 0px 2px 13px 0px #9b9b9b; 96 | -o-box-shadow: 0px 2px 13px 0px #9b9b9b; 97 | box-shadow: 0px 2px 13px 0px #9b9b9b; 98 | filter:progid:DXImageTransform.Microsoft.Shadow(color=#9b9b9b, Direction=180, Strength=13); 99 | } -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/favicon.ico -------------------------------------------------------------------------------- /public/fonts/password.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/fonts/password.ttf -------------------------------------------------------------------------------- /public/fonts/vendor/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /public/images/admin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/admin.jpg -------------------------------------------------------------------------------- /public/images/admin/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/admin/blue.png -------------------------------------------------------------------------------- /public/images/admin/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/admin/sort_asc.png -------------------------------------------------------------------------------- /public/images/admin/sort_asc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/admin/sort_asc_disabled.png -------------------------------------------------------------------------------- /public/images/admin/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/admin/sort_both.png -------------------------------------------------------------------------------- /public/images/admin/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/admin/sort_desc.png -------------------------------------------------------------------------------- /public/images/admin/sort_desc_disabled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/admin/sort_desc_disabled.png -------------------------------------------------------------------------------- /public/images/default_watermarks/large_watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/default_watermarks/large_watermark.png -------------------------------------------------------------------------------- /public/images/default_watermarks/medium_watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/default_watermarks/medium_watermark.png -------------------------------------------------------------------------------- /public/images/default_watermarks/small_watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/default_watermarks/small_watermark.png -------------------------------------------------------------------------------- /public/images/dwf-loading-icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/dwf-loading-icon.gif -------------------------------------------------------------------------------- /public/images/no_image/large.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/no_image/large.jpg -------------------------------------------------------------------------------- /public/images/no_image/medium.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/no_image/medium.jpg -------------------------------------------------------------------------------- /public/images/no_image/small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/no_image/small.jpg -------------------------------------------------------------------------------- /public/images/user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/user.jpg -------------------------------------------------------------------------------- /public/images/watermarks/large_watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/watermarks/large_watermark.png -------------------------------------------------------------------------------- /public/images/watermarks/medium_watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/watermarks/medium_watermark.png -------------------------------------------------------------------------------- /public/images/watermarks/small_watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/images/watermarks/small_watermark.png -------------------------------------------------------------------------------- /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/.gitignore: -------------------------------------------------------------------------------- 1 | app.js 2 | dashboard.js 3 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/dashboard.js": "/js/dashboard.js", 3 | "/css/dashboard.css": "/css/dashboard.css" 4 | } 5 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/under-construction/css/loader.css: -------------------------------------------------------------------------------- 1 | /* =Loader 2 | -------------------------------------------------------------- */ 3 | 4 | .preloader { 5 | display: block; 6 | position: fixed; 7 | width: 100%; 8 | height: 100%; 9 | z-index: 9999; 10 | background: white; 11 | text-align: center; 12 | } 13 | .loading { 14 | overflow: hidden; 15 | position: absolute; 16 | top: 50%; 17 | margin-top: -12px; 18 | left: 50%; 19 | margin-left: -50px; 20 | width: 100px; 21 | height: 24px; 22 | } 23 | 24 | .progress { 25 | display: block; 26 | position: absolute; 27 | bottom: 0; 28 | overflow: hidden; 29 | width: 100px; 30 | height: 1px; 31 | left: -102px; 32 | background-color: #00d9ec; 33 | -webkit-animation: loader-anim 1s 0s infinite cubic-bezier(0.785, 0.135, 0.15, 0.86); 34 | -moz-animation: loader-anim 1s 0s infinite cubic-bezier(0.785, 0.135, 0.15, 0.86); 35 | animation: loader-anim 1s 0s infinite cubic-bezier(0.785, 0.135, 0.15, 0.86) 36 | } 37 | 38 | @-webkit-keyframes loader-anim { 39 | 0% { 40 | left: -102px 41 | } 42 | 43 | 100% { 44 | left: 102px 45 | } 46 | } 47 | 48 | @-moz-keyframes loader-anim { 49 | 0% { 50 | left: -102px 51 | } 52 | 53 | 100% { 54 | left: 102px 55 | } 56 | } 57 | 58 | @keyframes loader-anim { 59 | 0% { 60 | left: -102px 61 | } 62 | 63 | 100% { 64 | left: 102px 65 | } 66 | } -------------------------------------------------------------------------------- /public/under-construction/favicon/android-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/android-icon-144x144.png -------------------------------------------------------------------------------- /public/under-construction/favicon/android-icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/android-icon-192x192.png -------------------------------------------------------------------------------- /public/under-construction/favicon/android-icon-36x36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/android-icon-36x36.png -------------------------------------------------------------------------------- /public/under-construction/favicon/android-icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/android-icon-48x48.png -------------------------------------------------------------------------------- /public/under-construction/favicon/android-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/android-icon-72x72.png -------------------------------------------------------------------------------- /public/under-construction/favicon/android-icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/android-icon-96x96.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-114x114.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-120x120.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-144x144.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-152x152.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-180x180.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-57x57.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-60x60.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-72x72.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-76x76.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon-precomposed.png -------------------------------------------------------------------------------- /public/under-construction/favicon/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/apple-icon.png -------------------------------------------------------------------------------- /public/under-construction/favicon/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | #ffffff -------------------------------------------------------------------------------- /public/under-construction/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /public/under-construction/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /public/under-construction/favicon/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/favicon-96x96.png -------------------------------------------------------------------------------- /public/under-construction/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/favicon.ico -------------------------------------------------------------------------------- /public/under-construction/favicon/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "App", 3 | "icons": [ 4 | { 5 | "src": "\/android-icon-36x36.png", 6 | "sizes": "36x36", 7 | "type": "image\/png", 8 | "density": "0.75" 9 | }, 10 | { 11 | "src": "\/android-icon-48x48.png", 12 | "sizes": "48x48", 13 | "type": "image\/png", 14 | "density": "1.0" 15 | }, 16 | { 17 | "src": "\/android-icon-72x72.png", 18 | "sizes": "72x72", 19 | "type": "image\/png", 20 | "density": "1.5" 21 | }, 22 | { 23 | "src": "\/android-icon-96x96.png", 24 | "sizes": "96x96", 25 | "type": "image\/png", 26 | "density": "2.0" 27 | }, 28 | { 29 | "src": "\/android-icon-144x144.png", 30 | "sizes": "144x144", 31 | "type": "image\/png", 32 | "density": "3.0" 33 | }, 34 | { 35 | "src": "\/android-icon-192x192.png", 36 | "sizes": "192x192", 37 | "type": "image\/png", 38 | "density": "4.0" 39 | } 40 | ] 41 | } -------------------------------------------------------------------------------- /public/under-construction/favicon/ms-icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/ms-icon-144x144.png -------------------------------------------------------------------------------- /public/under-construction/favicon/ms-icon-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/ms-icon-150x150.png -------------------------------------------------------------------------------- /public/under-construction/favicon/ms-icon-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/ms-icon-310x310.png -------------------------------------------------------------------------------- /public/under-construction/favicon/ms-icon-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/favicon/ms-icon-70x70.png -------------------------------------------------------------------------------- /public/under-construction/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/background.jpg -------------------------------------------------------------------------------- /public/under-construction/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/favicon.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth1/flakes1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth1/flakes1.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth1/flakes2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth1/flakes2.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth1/flakes3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth1/flakes3.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth1/flakes4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth1/flakes4.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth2/flakes1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth2/flakes1.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth2/flakes2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth2/flakes2.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth3/flakes1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth3/flakes1.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth3/flakes2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth3/flakes2.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth3/flakes3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth3/flakes3.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth3/flakes4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth3/flakes4.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth4/flakes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth4/flakes.png -------------------------------------------------------------------------------- /public/under-construction/images/flakes/depth5/flakes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/flakes/depth5/flakes.png -------------------------------------------------------------------------------- /public/under-construction/images/sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boolfalse/laravel-multiauth/cdb0fa78ab92d5fe194abf8a54a260aa49ddf83f/public/under-construction/images/sphere.png -------------------------------------------------------------------------------- /public/under-construction/js/jquery.countdown.min.js: -------------------------------------------------------------------------------- 1 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.Countdown=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=365.25*86400){dateData.years=Math.floor(diff/(365.25*86400));diff-=dateData.years*365.25*86400}if(diff>=86400){dateData.days=Math.floor(diff/86400);diff-=dateData.days*86400}if(diff>=3600){dateData.hours=Math.floor(diff/3600);diff-=dateData.hours*3600}if(diff>=60){dateData.min=Math.floor(diff/60);diff-=dateData.min*60}dateData.sec=Math.round(diff);dateData.millisec=diff%1*1e3;return dateData}.bind(this);this.leadingZeros=function(num,length){length=length||2;num=String(num);if(num.length>length){return num}return(Array(length+1).join("0")+num).substr(-length)};this.update=function(newDate){if(typeof newDate!=="object"){newDate=new Date(newDate)}this.options.date=newDate;this.render();return this}.bind(this);this.stop=function(){if(this.interval){clearInterval(this.interval);this.interval=false}return this}.bind(this);this.render=function(){this.options.render(this.getDiffDate());return this}.bind(this);this.start=function(){if(this.interval){return}this.render();if(this.options.refresh){this.interval=setInterval(this.render,this.options.refresh)}return this}.bind(this);this.updateOffset=function(offset){this.options.offset=offset;return this}.bind(this);this.start()};module.exports=Countdown},{}],2:[function(require,module,exports){var Countdown=require("./countdown.js");var NAME="countdown";var DATA_ATTR="date";jQuery.fn.countdown=function(options){return $.each(this,function(i,el){var $el=$(el);if(!$el.data(NAME)){if($el.data(DATA_ATTR)){options.date=$el.data(DATA_ATTR)}$el.data(NAME,new Countdown(el,options))}})};module.exports=Countdown},{"./countdown.js":1}]},{},[2])(2)}); -------------------------------------------------------------------------------- /public/under-construction/js/main.js: -------------------------------------------------------------------------------- 1 | $(window).load(function(){ 2 | $('.preloader').fadeOut('slow'); 3 | }); 4 | 5 | 6 | /* =Main INIT Function 7 | -------------------------------------------------------------- */ 8 | function initializeSite() { 9 | 10 | "use strict"; 11 | 12 | //OUTLINE DIMENSION AND CENTER 13 | (function() { 14 | function centerInit(){ 15 | 16 | var sphereContent = $('.sphere'), 17 | sphereHeight = sphereContent.height(), 18 | parentHeight = $(window).height(), 19 | topMargin = (parentHeight - sphereHeight) / 2; 20 | 21 | sphereContent.css({ 22 | "margin-top" : topMargin+"px" 23 | }); 24 | 25 | var heroContent = $('.hero'), 26 | heroHeight = heroContent.height(), 27 | heroTopMargin = (parentHeight - heroHeight) / 2; 28 | 29 | heroContent.css({ 30 | "margin-top" : heroTopMargin+"px" 31 | }); 32 | 33 | } 34 | 35 | $(document).ready(centerInit); 36 | $(window).resize(centerInit); 37 | })(); 38 | 39 | // Init effect 40 | $('#scene').parallax(); 41 | 42 | }; 43 | /* END ------------------------------------------------------- */ 44 | 45 | /* =Document Ready Trigger 46 | -------------------------------------------------------------- */ 47 | $(window).load(function(){ 48 | 49 | initializeSite(); 50 | (function() { 51 | setTimeout(function(){window.scrollTo(0,0);},0); 52 | })(); 53 | 54 | }); 55 | /* END ------------------------------------------------------- */ 56 | 57 | 58 | $('#countdown').countdown({ 59 | date: window.LIMIT_TIME, // "feb 1, 2019 00:00:00" 60 | render: function(data) { 61 | var el = $(this.el); 62 | el.empty() 63 | //.append("
" + this.leadingZeros(data.years, 4) + "years
") 64 | .append("
" + this.leadingZeros(data.days, 2) + " days
") 65 | .append("
" + this.leadingZeros(data.hours, 2) + " hrs
") 66 | .append("
" + this.leadingZeros(data.min, 2) + " min
") 67 | .append("
" + this.leadingZeros(data.sec, 2) + " sec
"); 68 | } 69 | }); -------------------------------------------------------------------------------- /public/uploads/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | ## About: 3 | 4 | This is a demo for Multi Auth boilerplate Laravel app (versions 5.6, 5.7, 5.8). 5 | 6 | ## Features: 7 | 8 | - User & Admin clients with their home/dashboard pages. 9 | - Admins can have different roles (used [Spatie's permission package](https://github.com/spatie/laravel-permission)). 10 | - AdminLTE customized template for Admin Panel. 11 | - Manageable Admin URI-segment path. 12 | 13 | ## Demo Test: 14 | 15 | ```shell 16 | $ git clone https://github.com/boolfalse/laravel-multiauth.git 17 | $ cd laravel-multiauth/ 18 | ``` 19 | Setup a DB and .env 20 | ```shell 21 | DEV_NAME="Test" 22 | DEV_EMAIL="test@gmail.com" 23 | DEV_PASSWORD="secret" 24 | ADMIN_PREFIX="admin" 25 | ``` 26 | In the root of you project run: 27 | ```shell 28 | $ composer install 29 | $ php artisan key:generate 30 | $ php artisan storage:link 31 | $ php artisan clearcaches 32 | $ php artisan cleanuploads 33 | $ php artisan droptables 34 | $ php artisan migrate 35 | $ php artisan db:seed 36 | ``` 37 | Now you can check Multi Auth system: 38 | * for Users: '/login', '/register' 39 | * for Admins: '/login' 40 | -------------------------------------------------------------------------------- /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('example-component', require('./components/ExampleComponent.vue').default); 23 | 24 | /** 25 | * Next, we will create a fresh Vue application instance and attach it to 26 | * the page. Then, you may begin adding components to this application 27 | * or customize the JavaScript scaffolding to fit your unique needs. 28 | */ 29 | 30 | const app = new Vue({ 31 | el: '#app', 32 | }); 33 | -------------------------------------------------------------------------------- /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 | * Next we will register the CSRF Token as a common header with Axios so that 28 | * all outgoing HTTP requests automatically have it attached. This is just 29 | * a simple convenience so we don't have to attach every token manually. 30 | */ 31 | 32 | let token = document.head.querySelector('meta[name="csrf-token"]'); 33 | 34 | if (token) { 35 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 36 | } else { 37 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 38 | } 39 | 40 | /** 41 | * Echo exposes an expressive API for subscribing to channels and listening 42 | * for events that are broadcast by Laravel. Echo and event broadcasting 43 | * allows your team to easily build robust real-time web applications. 44 | */ 45 | 46 | // import Echo from 'laravel-echo' 47 | 48 | // window.Pusher = require('pusher-js'); 49 | 50 | // window.Echo = new Echo({ 51 | // broadcaster: 'pusher', 52 | // key: process.env.MIX_PUSHER_APP_KEY, 53 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER, 54 | // encrypted: true 55 | // }); 56 | -------------------------------------------------------------------------------- /resources/js/components/ExampleComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 24 | -------------------------------------------------------------------------------- /resources/js/dashboard.js: -------------------------------------------------------------------------------- 1 | 2 | // Bootstrap 3 | require('./bootstrap'); 4 | 5 | // Admin LTE 6 | require('admin-lte'); 7 | -------------------------------------------------------------------------------- /resources/lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /resources/lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Passwords must be at least eight characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /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/sass/dashboard.scss: -------------------------------------------------------------------------------- 1 | 2 | // Fonts 3 | @import "~font-awesome/css/font-awesome.css"; 4 | 5 | // Variables 6 | @import 'variables'; 7 | //$fa-font-path: "../webfonts"; 8 | 9 | // Bootstrap 10 | @import '~bootstrap/scss/bootstrap'; 11 | 12 | // Admin LTE 13 | @import '~admin-lte/dist/css/AdminLTE'; 14 | @import "~admin-lte/dist/css/skins/skin-blue.css"; 15 | @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic'); 16 | 17 | // custom scripts //ss TODO: move this into separated file 18 | .main-header .sidebar-toggle { 19 | padding: 0; 20 | } 21 | -------------------------------------------------------------------------------- /resources/views/admin/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('user.layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Admin {{ __('Login') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @error('email') 21 | 22 | {{ $message }} 23 | 24 | @enderror 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @error('password') 35 | 36 | {{ $message }} 37 | 38 | @enderror 39 |
40 |
41 | 42 |
43 |
44 |
45 | 46 | 47 | 50 |
51 |
52 |
53 | 54 |
55 |
56 | 59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | @endsection 68 | -------------------------------------------------------------------------------- /resources/views/admin/components/modal-delete.blade.php: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /resources/views/admin/components/switcher2.blade.php: -------------------------------------------------------------------------------- 1 | 44 | -------------------------------------------------------------------------------- /resources/views/admin/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @include('admin.partials.head') 5 | @stack('custom_styles') 6 | 7 | 8 | 9 |
10 | @include('admin.partials.header') 11 | @include('admin.partials.aside') 12 | 13 | 14 |
15 | 16 | @include('admin.partials.flashes') 17 | 18 | 19 |
20 |

21 | Dashboard {{ $nav }} 22 | @if($nav != 'dashboard' && $action != 'create' && $action != 'no_add') 23 | 24 | Add 25 | 26 | @endif 27 |

28 |
29 | 30 | 31 |
32 | 33 | @yield('content') 34 | 35 |
36 | 37 |
38 | 39 | 40 | @include('admin.partials.footer') 41 |
42 | 43 | @include('admin.partials.scripts') 44 | 45 | @stack('custom_scripts') 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /resources/views/admin/pages/dashboard.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layouts.app') 2 | 3 | {{--@push('custom_styles')--}} 4 | {{--@endpush--}} 5 | 6 | @section('content') 7 |

Welcome to main page of {{ config('app.name') }} Admin Panel!

8 | @endsection 9 | 10 | {{--@push('custom_scripts)--}} 11 | {{--@endpush--}} 12 | -------------------------------------------------------------------------------- /resources/views/admin/pages/products/create.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layouts.app') 2 | 3 | {{--@push('custom_styles')--}} 4 | {{--@endpush--}} 5 | 6 | @section('content') 7 |

Create Product page

8 | @endsection 9 | 10 | {{--@push('custom_scripts')--}} 11 | {{--@endpush--}} 12 | -------------------------------------------------------------------------------- /resources/views/admin/pages/products/edit.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layouts.app') 2 | 3 | {{--@push('custom_styles')--}} 4 | {{--@endpush--}} 5 | 6 | @section('content') 7 |

Edit Product ID: {{ $item->id }}

8 | @endsection 9 | 10 | {{--@push('custom_scripts')--}} 11 | {{--@endpush--}} 12 | -------------------------------------------------------------------------------- /resources/views/admin/pages/products/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layouts.app') 2 | 3 | {{--@push('custom_styles')--}} 4 | {{--@endpush--}} 5 | 6 | @section('content') 7 |

Product ID: {{ $item->id }}

8 | @endsection 9 | 10 | {{--@push('custom_scripts')--}} 11 | {{--@endpush--}} 12 | -------------------------------------------------------------------------------- /resources/views/admin/pages/users/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layouts.app') 2 | 3 | @push('custom_styles') 4 | 5 | @include('admin.components.switcher2') 6 | @endpush 7 | 8 | @section('content') 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
NameEmailImageStatusOptions
22 | 23 | @include('admin.components.modal-delete') 24 | 25 | @endsection 26 | 27 | @push('custom_scripts') 28 | 29 | 174 | @endpush 175 | -------------------------------------------------------------------------------- /resources/views/admin/pages/users/show.blade.php: -------------------------------------------------------------------------------- 1 | @extends('admin.layouts.app') 2 | 3 | {{--@push('custom_styles')--}} 4 | {{--@endpush--}} 5 | 6 | @section('content') 7 |

User id = {{ $item->id }}

8 | @endsection 9 | 10 | {{--@push('custom_scripts')--}} 11 | {{--@endpush--}} 12 | -------------------------------------------------------------------------------- /resources/views/admin/partials/aside.blade.php: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /resources/views/admin/partials/flashes.blade.php: -------------------------------------------------------------------------------- 1 | @if(session('flash_message')) 2 |
3 | × 4 | 5 | {{ session()->get('flash_message') }} 6 | 7 |
8 | @endif 9 | @if($errors->any()) 10 |
11 | × 12 | 13 | {!! implode('', $errors->all('
:message
')) !!} 14 |
15 |
16 | @endif -------------------------------------------------------------------------------- /resources/views/admin/partials/footer.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 5 | Copyright © {{ '2019' . (date('Y') == 2019 ? '' : '-' . date('Y')) }} All rights reserved. 6 |
-------------------------------------------------------------------------------- /resources/views/admin/partials/head.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ config('app.name') }} | {{ $nav }} 4 | 5 | 6 | 7 | 8 | {{----}} 9 | {{----}} 10 | {{----}} 11 | {{----}} 12 | {{----}} 13 | {{----}} 14 | {{----}} 15 | {{----}} 16 | {{----}} 17 | {{----}} 18 | {{----}} 19 | {{----}} 20 | {{----}} 21 | {{----}} 22 | {{----}} 23 | {{----}} 24 | {{----}} 28 | {{----}} 29 | {{----}} 30 | 31 | 32 | -------------------------------------------------------------------------------- /resources/views/admin/partials/header.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 9 | 10 | 40 |
-------------------------------------------------------------------------------- /resources/views/admin/partials/scripts.blade.php: -------------------------------------------------------------------------------- 1 | {{----}} 2 | {{----}} 3 | {{----}} 4 | {{----}} 5 | {{----}} 6 | {{----}} 9 | {{----}} 10 | {{----}} 11 | {{----}} 12 | {{----}} 13 | {{----}} 14 | {{----}} 15 | {{----}} 16 | {{----}} 17 | {{----}} 18 | {{----}} 19 | 20 | 21 | -------------------------------------------------------------------------------- /resources/views/user/auth/login.blade.php: -------------------------------------------------------------------------------- 1 | @extends('user.layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Login') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @error('email') 21 | 22 | {{ $message }} 23 | 24 | @enderror 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @error('password') 35 | 36 | {{ $message }} 37 | 38 | @enderror 39 |
40 |
41 | 42 |
43 |
44 |
45 | 46 | 47 | 50 |
51 |
52 |
53 | 54 |
55 |
56 | 59 | 60 | @if (Route::has('password.request')) 61 | 62 | {{ __('Forgot Your Password?') }} 63 | 64 | @endif 65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | @endsection 74 | -------------------------------------------------------------------------------- /resources/views/user/auth/passwords/email.blade.php: -------------------------------------------------------------------------------- 1 | @extends('user.layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Reset Password') }}
9 | 10 |
11 | @if (session('status')) 12 | 15 | @endif 16 | 17 |
18 | @csrf 19 | 20 |
21 | 22 | 23 |
24 | 25 | 26 | @error('email') 27 | 28 | {{ $message }} 29 | 30 | @enderror 31 |
32 |
33 | 34 |
35 |
36 | 39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | @endsection 48 | -------------------------------------------------------------------------------- /resources/views/user/auth/passwords/reset.blade.php: -------------------------------------------------------------------------------- 1 | @extends('user.layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Reset Password') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 | 15 | 16 |
17 | 18 | 19 |
20 | 21 | 22 | @error('email') 23 | 24 | {{ $message }} 25 | 26 | @enderror 27 |
28 |
29 | 30 |
31 | 32 | 33 |
34 | 35 | 36 | @error('password') 37 | 38 | {{ $message }} 39 | 40 | @enderror 41 |
42 |
43 | 44 |
45 | 46 | 47 |
48 | 49 |
50 |
51 | 52 |
53 |
54 | 57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | @endsection 66 | -------------------------------------------------------------------------------- /resources/views/user/auth/register.blade.php: -------------------------------------------------------------------------------- 1 | @extends('user.layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
{{ __('Register') }}
9 | 10 |
11 |
12 | @csrf 13 | 14 |
15 | 16 | 17 |
18 | 19 | 20 | @error('name') 21 | 22 | {{ $message }} 23 | 24 | @enderror 25 |
26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 | 34 | @error('email') 35 | 36 | {{ $message }} 37 | 38 | @enderror 39 |
40 |
41 | 42 |
43 | 44 | 45 |
46 | 47 | 48 | @error('password') 49 | 50 | {{ $message }} 51 | 52 | @enderror 53 |
54 |
55 | 56 |
57 | 58 | 59 |
60 | 61 |
62 |
63 | 64 |
65 |
66 | 69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 | @endsection 78 | -------------------------------------------------------------------------------- /resources/views/user/auth/verify.blade.php: -------------------------------------------------------------------------------- 1 | @extends('user.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') }}, {{ __('click here to request another') }}. 19 |
20 |
21 |
22 |
23 |
24 | @endsection 25 | -------------------------------------------------------------------------------- /resources/views/user/home.blade.php: -------------------------------------------------------------------------------- 1 | @extends('user.layouts.app') 2 | 3 | @section('content') 4 |
5 |
6 |
7 |
8 |
Dashboard
9 | 10 |
11 | @if (session('status')) 12 | 15 | @endif 16 | 17 | You are logged in! 18 |
19 |
20 |
21 |
22 |
23 | @endsection 24 | -------------------------------------------------------------------------------- /resources/views/user/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ config('app.name', 'Laravel') }} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 74 | 75 |
76 | @yield('content') 77 |
78 |
79 | 80 | 81 | -------------------------------------------------------------------------------- /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 | 96 |
97 |
98 | 99 | 100 | -------------------------------------------------------------------------------- /routes/admin.php: -------------------------------------------------------------------------------- 1 | 'Auth', 5 | ], function () { 6 | // Authentication Routes... 7 | Route::get('login', 'LoginController@showLoginForm')->name('login_page'); 8 | Route::post('login', 'LoginController@login')->name('login'); 9 | Route::post('logout', 'LoginController@logout')->name('logout'); 10 | }); 11 | 12 | Route::group([ 13 | 'middleware' => [ 14 | 'auth:admin', 15 | ], 16 | ], function () { 17 | 18 | // for all admins 19 | Route::get('/', 'AdminController@index')->name('dashboard'); 20 | Route::get('home', 'AdminController@index')->name('dashboard'); 21 | Route::get('dashboard', 'AdminController@index')->name('dashboard'); 22 | 23 | // for administrator 24 | Route::group(['middleware' => ['role:administrator']], function () { 25 | // users 26 | Route::group(['prefix' => 'users', 'as' => 'users.',], function () { 27 | Route::get('all', 'UserController@index')->name('index'); 28 | Route::get('ajax', 'UserController@ajax')->name('ajax'); 29 | Route::get('show/{id}', 'UserController@show'); // ->where('id', '[0-9]+'); 30 | Route::post('change_status', 'UserController@change_status')->name('change_status'); 31 | Route::post('delete', 'UserController@delete')->name('delete'); 32 | }); 33 | }); 34 | 35 | // for moderators 36 | Route::group([ 37 | 'middleware' => ['role:administrator|moderator'], 38 | ], function () { 39 | // users 40 | Route::group(['prefix' => 'users', 'as' => 'users.',], function () { 41 | Route::get('all', 'UserController@index')->name('index'); 42 | }); 43 | }); 44 | 45 | // for managers 46 | Route::group(['middleware' => ['role:administrator|moderator|manager']], function () { 47 | // products 48 | Route::group(['prefix' => 'products', 'as' => 'products.',], function () { 49 | Route::get('all', 'ProductController@index')->name('index'); 50 | Route::get('ajax', 'ProductController@ajax')->name('ajax'); 51 | Route::get('create', 'ProductController@create')->name('create'); 52 | Route::get('show/{id}', 'ProductController@show')->name('show'); // ->where('id', '[0-9]+'); 53 | Route::get('edit/{id}', 'ProductController@edit')->name('edit'); // ->where('id', '[0-9]+'); 54 | Route::post('change_status', 'ProductController@change_status')->name('change_status'); 55 | }); 56 | }); 57 | 58 | }); 59 | 60 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 6 | return $request->user(); 7 | }); 8 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 5 | }); 6 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 7 | })->describe('Display an inspiring quote'); 8 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('front'); 6 | 7 | Route::group([ 8 | 'namespace' => 'Auth', 9 | ], function () { 10 | 11 | // Authentication Routes... 12 | Route::get('login', 'LoginController@showLoginForm')->name('login_page'); 13 | Route::post('login', 'LoginController@login')->name('login'); 14 | Route::post('logout', 'LoginController@logout')->name('logout'); 15 | 16 | // Registration Routes... 17 | Route::get('register', 'RegisterController@showRegistrationForm')->name('register_page'); 18 | Route::post('register', 'RegisterController@register')->name('register'); 19 | Route::get('register/activate/{token}', 'RegisterController@confirm')->name('email_confirm'); 20 | 21 | // Password Reset Routes... 22 | Route::get('password/reset', 'ForgotPasswordController@showLinkRequestForm')->name('password.request'); 23 | Route::post('password/email', 'ForgotPasswordController@sendResetLinkEmail')->name('password.email'); 24 | Route::get('password/reset/{token}', 'ResetPasswordController@showResetForm')->name('password.reset'); 25 | Route::post('password/reset', 'ResetPasswordController@reset'); 26 | 27 | }); 28 | 29 | Route::get('home', 'UserController@index')->name('home'); 30 | -------------------------------------------------------------------------------- /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/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /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/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /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); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /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/dashboard.js', 'public/js') 15 | .sass('resources/sass/dashboard.scss', 'public/css'); 16 | --------------------------------------------------------------------------------