├── .dockerignore ├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── .gitpod.Dockerfile ├── .gitpod.yml ├── .styleci.yml ├── .vscode └── launch.json ├── Dockerfile ├── Procfile ├── README.md ├── app ├── Cart.php ├── CartItem.php ├── CartItemOptions.php ├── Console │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Controller.php │ │ └── HomeController.php │ ├── Kernel.php │ ├── Livewire │ │ ├── Cart.php │ │ ├── Item.php │ │ ├── Sidebar.php │ │ └── Store.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── CheckForMaintenanceMode.php │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php ├── Item.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── CartServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php └── User.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── database.php ├── filesystems.php ├── hashing.php ├── ignition.php ├── logging.php ├── mail.php ├── queue.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ └── 2019_08_04_222532_create_items_table.php └── seeds │ ├── DatabaseSeeder.php │ └── ItemSeeder.php ├── docker-compose.yml ├── nginx └── conf.d │ └── app.conf ├── now.json ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── banner-ppl-women.png ├── banner-ppl.png ├── bk-sale.png ├── css │ ├── app.css │ └── main.css ├── delete-icn.svg ├── favicon.ico ├── hat1.png ├── index.php ├── jacket1.png ├── jacket2.png ├── jacket3.png ├── jacket4.png ├── js │ └── app.js ├── minus.svg ├── mix-manifest.json ├── plus.svg ├── robots.txt ├── shirt1.png ├── shirt2.png ├── shoe1.png ├── sweater1.png ├── sweater2.png ├── sweater4.png ├── sweater5.png └── twitter-heart.png ├── resources ├── js │ ├── app.js │ ├── bootstrap.js │ └── components │ │ └── ExampleComponent.vue ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php ├── sass │ ├── _tailwind.scss │ ├── _variables.scss │ └── app.scss └── views │ ├── inc │ └── masthead.blade.php │ ├── index.blade.php │ ├── layouts │ ├── app.blade.php │ └── partials │ │ ├── footer.blade.php │ │ └── nav.blade.php │ ├── livewire │ ├── cart.blade.php │ ├── item.blade.php │ ├── sidebar.blade.php │ └── store.blade.php │ ├── store.html │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── debugbar │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tailwind.config.js ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── webpack.mix.js └── yarn.lock /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .idea 3 | .env 4 | node_modules 5 | vendor 6 | storage/framework/cache/** 7 | storage/framework/sessions/** 8 | storage/framework/views/** -------------------------------------------------------------------------------- /.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=laravel 13 | DB_USERNAME=root 14 | DB_PASSWORD= 15 | 16 | BROADCAST_DRIVER=log 17 | CACHE_DRIVER=file 18 | QUEUE_CONNECTION=sync 19 | SESSION_DRIVER=file 20 | SESSION_LIFETIME=120 21 | 22 | REDIS_HOST=127.0.0.1 23 | REDIS_PASSWORD=null 24 | REDIS_PORT=6379 25 | 26 | MAIL_MAILER=smtp 27 | MAIL_HOST=smtp.mailtrap.io 28 | MAIL_PORT=2525 29 | MAIL_USERNAME=null 30 | MAIL_PASSWORD=null 31 | MAIL_ENCRYPTION=null 32 | 33 | AWS_ACCESS_KEY_ID= 34 | AWS_SECRET_ACCESS_KEY= 35 | AWS_DEFAULT_REGION=us-east-1 36 | AWS_BUCKET= 37 | 38 | PUSHER_APP_ID= 39 | PUSHER_APP_KEY= 40 | PUSHER_APP_SECRET= 41 | PUSHER_APP_CLUSTER=mt1 42 | 43 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 44 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 45 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.scss linguist-vendored 4 | *.js linguist-vendored 5 | CHANGELOG.md export-ignore 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/hot 3 | /public/storage 4 | /storage/*.key 5 | /vendor 6 | .idea/ 7 | .env 8 | .env.backup 9 | .phpunit.result.cache 10 | Homestead.json 11 | Homestead.yaml 12 | npm-debug.log 13 | yarn-error.log 14 | -------------------------------------------------------------------------------- /.gitpod.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-mysql 2 | 3 | # Install custom tools, runtimes, etc. 4 | # For example "bastet", a command-line tetris clone: 5 | # RUN brew install bastet 6 | # 7 | # More information: https://www.gitpod.io/docs/config-docker/ 8 | -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | image: 2 | file: .gitpod.Dockerfile 3 | 4 | tasks: 5 | - init: composer install 6 | command: php artisan key:generate 7 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Listen for XDebug", 9 | "type": "php", 10 | "request": "launch", 11 | "port": 9001 12 | }, 13 | { 14 | "name": "Launch currently open script", 15 | "type": "php", 16 | "request": "launch", 17 | "program": "${file}", 18 | "cwd": "${fileDirname}", 19 | "port": 9001 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:7.2-fpm 2 | 3 | # Copy composer.lock and composer.json 4 | COPY composer.lock composer.json /var/www/ 5 | 6 | # Set working directory 7 | WORKDIR /var/www 8 | 9 | # Install dependencies 10 | RUN apt-get update && apt-get install -y \ 11 | build-essential \ 12 | mysql-client \ 13 | libpng-dev \ 14 | libjpeg62-turbo-dev \ 15 | libfreetype6-dev \ 16 | locales \ 17 | zip \ 18 | jpegoptim optipng pngquant gifsicle \ 19 | vim \ 20 | unzip \ 21 | git \ 22 | curl 23 | 24 | # Clear cache 25 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* 26 | 27 | # Install extensions 28 | RUN docker-php-ext-install pdo_mysql mbstring zip exif pcntl 29 | RUN docker-php-ext-configure gd --with-gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/ 30 | RUN docker-php-ext-install gd 31 | 32 | # Install composer 33 | RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 34 | 35 | # Add user for laravel application 36 | RUN groupadd -g 1000 www 37 | RUN useradd -u 1000 -ms /bin/bash -g www www 38 | 39 | # Copy existing application directory contents 40 | COPY . /var/www 41 | 42 | # Copy existing application directory permissions 43 | COPY --chown=www:www . /var/www 44 | 45 | RUN chown -R www-data:www-data \ 46 | /var/www/storage \ 47 | /var/www/bootstrap/cache 48 | # Change current user to www 49 | USER www 50 | 51 | RUN composer install --no-dev && cp -p .env.example .env 52 | RUN php artisan key:generate 53 | RUN php artisan migrate:fresh 54 | RUN php artisan db:seed --class=ItemSeeder 55 | 56 | # Expose port 9000 and start php-fpm server 57 | EXPOSE 9000 58 | CMD ["php-fpm"] 59 | 60 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: vendor/bin/heroku-php-apache2 public/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/webong/livewire-eshop) 2 | 3 | # livewire-eshop 4 | -------------------------------------------------------------------------------- /app/Cart.php: -------------------------------------------------------------------------------- 1 | session = $session; 48 | $this->events = $events; 49 | $this->instance(self::DEFAULT_INSTANCE); 50 | } 51 | /** 52 | * Set the current cart instance. 53 | * 54 | * @param string|null $instance 55 | * @return \App\Cart 56 | */ 57 | public function instance($instance = null) 58 | { 59 | $instance = $instance ?: self::DEFAULT_INSTANCE; 60 | $this->instance = sprintf('%s.%s', 'cart', $instance); 61 | return $this; 62 | } 63 | /** 64 | * Get the current cart instance. 65 | * 66 | * @return string 67 | */ 68 | public function currentInstance() 69 | { 70 | return str_replace('cart.', '', $this->instance); 71 | } 72 | /** 73 | * Add an item to the cart. 74 | * 75 | * @param mixed $id 76 | * @param mixed $name 77 | * @param int|float $qty 78 | * @param float $price 79 | * @param array $options 80 | * @return \App\CartItem 81 | */ 82 | public function add($id, $name = null, $qty = null, $price = null, array $options = []) 83 | { 84 | if ($this->isMulti($id)) { 85 | return array_map(function ($item) { 86 | return $this->add($item); 87 | }, $id); 88 | } 89 | $cartItem = $this->createCartItem($id, $name, $qty, $price, $options); 90 | $content = $this->getContent(); 91 | if ($content->has($cartItem->rowId)) { 92 | $cartItem->qty += $content->get($cartItem->rowId)->qty; 93 | } 94 | $content->put($cartItem->rowId, $cartItem); 95 | 96 | $this->events->dispatch('cart.added', $cartItem); 97 | $this->session->put($this->instance, $content); 98 | return $cartItem; 99 | } 100 | /** 101 | * Update the cart item with the given rowId. 102 | * 103 | * @param string $rowId 104 | * @param mixed $qty 105 | * @return \App\CartItem 106 | */ 107 | public function update($rowId, $qty) 108 | { 109 | $cartItem = $this->get($rowId); 110 | if (is_array($qty)) { 111 | $cartItem->updateFromArray($qty); 112 | } else { 113 | $cartItem->qty = $qty; 114 | } 115 | $content = $this->getContent(); 116 | if ($rowId !== $cartItem->rowId) { 117 | $content->pull($rowId); 118 | if ($content->has($cartItem->rowId)) { 119 | $existingCartItem = $this->get($cartItem->rowId); 120 | $cartItem->setQuantity($existingCartItem->qty + $cartItem->qty); 121 | } 122 | } 123 | if ($cartItem->qty <= 0) { 124 | $this->remove($cartItem->rowId); 125 | return; 126 | } else { 127 | $content->put($cartItem->rowId, $cartItem); 128 | } 129 | $this->events->dispatch('cart.updated', $cartItem); 130 | $this->session->put($this->instance, $content); 131 | return $cartItem; 132 | } 133 | /** 134 | * Remove the cart item with the given rowId from the cart. 135 | * 136 | * @param string $rowId 137 | * @return void 138 | */ 139 | public function remove($rowId) 140 | { 141 | $cartItem = $this->get($rowId); 142 | $content = $this->getContent(); 143 | $content->pull($cartItem->rowId); 144 | $this->events->dispatch('cart.removed', $cartItem); 145 | $this->session->put($this->instance, $content); 146 | } 147 | /** 148 | * Get a cart item from the cart by its rowId. 149 | * 150 | * @param string $rowId 151 | * @return \App\CartItem 152 | */ 153 | public function get($rowId) 154 | { 155 | $content = $this->getContent(); 156 | if (!$content->has($rowId)) 157 | throw new InvalidRowIDException("The cart does not contain rowId {$rowId}."); 158 | return $content->get($rowId); 159 | } 160 | /** 161 | * Destroy the current cart instance. 162 | * 163 | * @return void 164 | */ 165 | public function destroy() 166 | { 167 | $this->session->remove($this->instance); 168 | } 169 | /** 170 | * Get the content of the cart. 171 | * 172 | * @return \Illuminate\Support\Collection 173 | */ 174 | public function content() 175 | { 176 | if (is_null($this->session->get($this->instance))) { 177 | return new Collection([]); 178 | } 179 | return $this->session->get($this->instance); 180 | } 181 | /** 182 | * Get the number of items in the cart. 183 | * 184 | * @return int|float 185 | */ 186 | public function count() 187 | { 188 | $content = $this->getContent(); 189 | return $content->sum('qty'); 190 | } 191 | /** 192 | * Get the total price of the items in the cart. 193 | * 194 | * @param int $decimals 195 | * @param string $decimalPoint 196 | * @param string $thousandSeperator 197 | * @return string 198 | */ 199 | public function total($decimals = null, $decimalPoint = null, $thousandSeperator = null) 200 | { 201 | $content = $this->getContent(); 202 | $total = $content->reduce(function ($total, CartItem $cartItem) { 203 | return $total + ($cartItem->qty * $cartItem->priceTax); 204 | }, 0); 205 | return $this->numberFormat($total, $decimals, $decimalPoint, $thousandSeperator); 206 | } 207 | /** 208 | * Get the total tax of the items in the cart. 209 | * 210 | * @param int $decimals 211 | * @param string $decimalPoint 212 | * @param string $thousandSeperator 213 | * @return float 214 | */ 215 | public function tax($decimals = null, $decimalPoint = null, $thousandSeperator = null) 216 | { 217 | $content = $this->getContent(); 218 | $tax = $content->reduce(function ($tax, CartItem $cartItem) { 219 | return $tax + ($cartItem->qty * $cartItem->tax); 220 | }, 0); 221 | return $this->numberFormat($tax, $decimals, $decimalPoint, $thousandSeperator); 222 | } 223 | /** 224 | * Get the subtotal (total - tax) of the items in the cart. 225 | * 226 | * @param int $decimals 227 | * @param string $decimalPoint 228 | * @param string $thousandSeperator 229 | * @return float 230 | */ 231 | public function subtotal($format = true, $decimals = null, $decimalPoint = null, $thousandSeperator = null) 232 | { 233 | $content = $this->getContent(); 234 | $subTotal = $content->reduce(function ($subTotal, CartItem $cartItem) { 235 | return $subTotal + ($cartItem->qty * $cartItem->price); 236 | }, 0); 237 | if ($format) { 238 | return $this->numberFormat($subTotal, $decimals, $decimalPoint, $thousandSeperator); 239 | } 240 | return $subTotal; 241 | } 242 | 243 | /** 244 | * Search the cart content for a cart item matching the given search closure. 245 | * 246 | * @param \Closure $search 247 | * @return \Illuminate\Support\Collection 248 | */ 249 | public function search(Closure $search) 250 | { 251 | $content = $this->getContent(); 252 | return $content->filter($search); 253 | } 254 | /** 255 | * Associate the cart item with the given rowId with the given model. 256 | * 257 | * @param string $rowId 258 | * @param mixed $model 259 | * @return void 260 | */ 261 | public function associate($rowId, $model) 262 | { 263 | if(is_string($model) && ! class_exists($model)) { 264 | throw new UnknownModelException("The supplied model {$model} does not exist."); 265 | } 266 | $cartItem = $this->get($rowId); 267 | $cartItem->associate($model); 268 | $content = $this->getContent(); 269 | $content->put($cartItem->rowId, $cartItem); 270 | $this->session->put($this->instance, $content); 271 | } 272 | 273 | /** 274 | * Magic method to make accessing the total, tax and subtotal properties possible. 275 | * 276 | * @param string $attribute 277 | * @return float|null 278 | */ 279 | public function __get($attribute) 280 | { 281 | if ($attribute === 'total') { 282 | return $this->total(); 283 | } 284 | if ($attribute === 'tax') { 285 | return $this->tax(); 286 | } 287 | if ($attribute === 'subtotal') { 288 | return $this->subtotal(); 289 | } 290 | return null; 291 | } 292 | /** 293 | * Get the carts content, if there is no cart content set yet, return a new empty Collection 294 | * 295 | * @return \Illuminate\Support\Collection 296 | */ 297 | protected function getContent() 298 | { 299 | $content = $this->session->has($this->instance) 300 | ? $this->session->get($this->instance) 301 | : new Collection; 302 | return $content; 303 | } 304 | /** 305 | * Create a new CartItem from the supplied attributes. 306 | * 307 | * @param mixed $id 308 | * @param mixed $name 309 | * @param int|float $qty 310 | * @param float $price 311 | * @param array $options 312 | * @return \App\CartItem 313 | */ 314 | private function createCartItem($id, $name, $qty, $price, array $options) 315 | { 316 | if (is_array($id)) { 317 | $cartItem = CartItem::fromArray($id); 318 | $cartItem->setQuantity($id['qty']); 319 | } else { 320 | $cartItem = CartItem::fromAttributes($id, $name, $price, $options); 321 | $cartItem->setQuantity($qty); 322 | } 323 | $cartItem->setTaxRate(config('cart.tax')); 324 | return $cartItem; 325 | } 326 | 327 | /** 328 | * Check if the item is a multidimensional array or an array of Buyables. 329 | * 330 | * @param mixed $item 331 | * @return bool 332 | */ 333 | private function isMulti($item) 334 | { 335 | if (!is_array($item)) return false; 336 | return is_array(head($item)) || head($item) instanceof Buyable; 337 | } 338 | 339 | /** 340 | * Get the Formated number 341 | * 342 | * @param $value 343 | * @param $decimals 344 | * @param $decimalPoint 345 | * @param $thousandSeperator 346 | * @return string 347 | */ 348 | private function numberFormat($value, $decimals, $decimalPoint, $thousandSeperator) 349 | { 350 | if(is_null($decimals)){ 351 | $decimals = is_null(config('cart.format.decimals')) ? 2 : config('cart.format.decimals'); 352 | } 353 | if(is_null($decimalPoint)){ 354 | $decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point'); 355 | } 356 | if(is_null($thousandSeperator)){ 357 | $thousandSeperator = is_null(config('cart.format.thousand_seperator')) ? ',' : config('cart.format.thousand_seperator'); 358 | } 359 | return number_format($value, $decimals, $decimalPoint, $thousandSeperator); 360 | } 361 | } 362 | -------------------------------------------------------------------------------- /app/CartItem.php: -------------------------------------------------------------------------------- 1 | id = $id; 83 | $this->name = $name; 84 | $this->price = floatval($price); 85 | $this->options = new CartItemOptions($options); 86 | $this->rowId = $this->generateRowId($id, $options); 87 | } 88 | /** 89 | * Returns the formatted price without TAX. 90 | * 91 | * @param int $decimals 92 | * @param string $decimalPoint 93 | * @param string $thousandSeperator 94 | * @return string 95 | */ 96 | public function price($decimals = null, $decimalPoint = null, $thousandSeperator = null) 97 | { 98 | return $this->numberFormat($this->price, $decimals, $decimalPoint, $thousandSeperator); 99 | } 100 | 101 | /** 102 | * Returns the formatted price with TAX. 103 | * 104 | * @param int $decimals 105 | * @param string $decimalPoint 106 | * @param string $thousandSeperator 107 | * @return string 108 | */ 109 | public function priceTax($decimals = null, $decimalPoint = null, $thousandSeperator = null) 110 | { 111 | return $this->numberFormat($this->priceTax, $decimals, $decimalPoint, $thousandSeperator); 112 | } 113 | /** 114 | * Returns the formatted subtotal. 115 | * Subtotal is price for whole CartItem without TAX 116 | * 117 | * @param int $decimals 118 | * @param string $decimalPoint 119 | * @param string $thousandSeperator 120 | * @return string 121 | */ 122 | public function subtotal($decimals = null, $decimalPoint = null, $thousandSeperator = null) 123 | { 124 | return $this->numberFormat($this->subtotal, $decimals, $decimalPoint, $thousandSeperator); 125 | } 126 | 127 | /** 128 | * Returns the formatted total. 129 | * Total is price for whole CartItem with TAX 130 | * 131 | * @param int $decimals 132 | * @param string $decimalPoint 133 | * @param string $thousandSeperator 134 | * @return string 135 | */ 136 | public function total($decimals = null, $decimalPoint = null, $thousandSeperator = null) 137 | { 138 | return $this->numberFormat($this->total, $decimals, $decimalPoint, $thousandSeperator); 139 | } 140 | /** 141 | * Returns the formatted tax. 142 | * 143 | * @param int $decimals 144 | * @param string $decimalPoint 145 | * @param string $thousandSeperator 146 | * @return string 147 | */ 148 | public function tax($decimals = null, $decimalPoint = null, $thousandSeperator = null) 149 | { 150 | return $this->numberFormat($this->tax, $decimals, $decimalPoint, $thousandSeperator); 151 | } 152 | 153 | /** 154 | * Returns the formatted tax. 155 | * 156 | * @param int $decimals 157 | * @param string $decimalPoint 158 | * @param string $thousandSeperator 159 | * @return string 160 | */ 161 | public function taxTotal($decimals = null, $decimalPoint = null, $thousandSeperator = null) 162 | { 163 | return $this->numberFormat($this->taxTotal, $decimals, $decimalPoint, $thousandSeperator); 164 | } 165 | /** 166 | * Set the quantity for this cart item. 167 | * 168 | * @param int|float $qty 169 | */ 170 | public function setQuantity($qty) 171 | { 172 | if(empty($qty) || ! is_numeric($qty)) 173 | throw new \InvalidArgumentException('Please supply a valid quantity.'); 174 | $this->qty = $qty; 175 | } 176 | 177 | /** 178 | * Update the cart item from an array. 179 | * 180 | * @param array $attributes 181 | * @return void 182 | */ 183 | public function updateFromArray(array $attributes) 184 | { 185 | $this->id = array_get($attributes, 'id', $this->id); 186 | $this->qty = array_get($attributes, 'qty', $this->qty); 187 | $this->name = array_get($attributes, 'name', $this->name); 188 | $this->price = array_get($attributes, 'price', $this->price); 189 | $this->priceTax = $this->price + $this->tax; 190 | $this->options = new CartItemOptions(array_get($attributes, 'options', $this->options)); 191 | $this->rowId = $this->generateRowId($this->id, $this->options->all()); 192 | } 193 | /** 194 | * Associate the cart item with the given model. 195 | * 196 | * @param mixed $model 197 | * @return \App\CartItem 198 | */ 199 | public function associate($model) 200 | { 201 | $this->associatedModel = is_string($model) ? $model : get_class($model); 202 | 203 | return $this; 204 | } 205 | /** 206 | * Set the tax rate. 207 | * 208 | * @param int|float $taxRate 209 | * @return \App\CartItem 210 | */ 211 | public function setTaxRate($taxRate) 212 | { 213 | $this->taxRate = $taxRate; 214 | 215 | return $this; 216 | } 217 | /** 218 | * Get an attribute from the cart item or get the associated model. 219 | * 220 | * @param string $attribute 221 | * @return mixed 222 | */ 223 | public function __get($attribute) 224 | { 225 | if(property_exists($this, $attribute)) { 226 | return $this->{$attribute}; 227 | } 228 | if($attribute === 'priceTax') { 229 | return $this->price + $this->tax; 230 | } 231 | 232 | if($attribute === 'subtotal') { 233 | return $this->qty * $this->price; 234 | } 235 | 236 | if($attribute === 'total') { 237 | return $this->qty * ($this->priceTax); 238 | } 239 | if($attribute === 'tax') { 240 | return $this->price * ($this->taxRate / 100); 241 | } 242 | 243 | if($attribute === 'taxTotal') { 244 | return $this->tax * $this->qty; 245 | } 246 | if($attribute === 'model' && isset($this->associatedModel)) { 247 | return with(new $this->associatedModel)->find($this->id); 248 | } 249 | return null; 250 | } 251 | 252 | /** 253 | * Create a new instance from the given array. 254 | * 255 | * @param array $attributes 256 | * @return \App\CartItem 257 | */ 258 | public static function fromArray(array $attributes) 259 | { 260 | $options = array_get($attributes, 'options', []); 261 | return new self($attributes['id'], $attributes['name'], $attributes['price'], $options); 262 | } 263 | /** 264 | * Create a new instance from the given attributes. 265 | * 266 | * @param int|string $id 267 | * @param string $name 268 | * @param float $price 269 | * @param array $options 270 | * @return \App\CartItem 271 | */ 272 | public static function fromAttributes($id, $name, $price, array $options = []) 273 | { 274 | return new self($id, $name, $price, $options); 275 | } 276 | /** 277 | * Generate a unique id for the cart item. 278 | * 279 | * @param string $id 280 | * @param array $options 281 | * @return string 282 | */ 283 | protected function generateRowId($id, array $options) 284 | { 285 | ksort($options); 286 | return md5($id . serialize($options)); 287 | } 288 | /** 289 | * Get the instance as an array. 290 | * 291 | * @return array 292 | */ 293 | public function toArray() 294 | { 295 | return [ 296 | 'rowId' => $this->rowId, 297 | 'id' => $this->id, 298 | 'name' => $this->name, 299 | 'qty' => $this->qty, 300 | 'price' => $this->price, 301 | 'options' => $this->options->toArray(), 302 | 'tax' => $this->tax, 303 | 'subtotal' => $this->subtotal 304 | ]; 305 | } 306 | /** 307 | * Convert the object to its JSON representation. 308 | * 309 | * @param int $options 310 | * @return string 311 | */ 312 | public function toJson($options = 0) 313 | { 314 | return json_encode($this->toArray(), $options); 315 | } 316 | /** 317 | * Get the formatted number. 318 | * 319 | * @param float $value 320 | * @param int $decimals 321 | * @param string $decimalPoint 322 | * @param string $thousandSeperator 323 | * @return string 324 | */ 325 | private function numberFormat($value, $decimals, $decimalPoint, $thousandSeperator) 326 | { 327 | if (is_null($decimals)){ 328 | $decimals = is_null(config('cart.format.decimals')) ? 2 : config('cart.format.decimals'); 329 | } 330 | if (is_null($decimalPoint)){ 331 | $decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point'); 332 | } 333 | if (is_null($thousandSeperator)){ 334 | $thousandSeperator = is_null(config('cart.format.thousand_seperator')) ? ',' : config('cart.format.thousand_seperator'); 335 | } 336 | return number_format($value, $decimals, $decimalPoint, $thousandSeperator); 337 | } 338 | } 339 | -------------------------------------------------------------------------------- /app/CartItemOptions.php: -------------------------------------------------------------------------------- 1 | get($key); 23 | } 24 | } -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 28 | // ->hourly(); 29 | } 30 | 31 | /** 32 | * Register the commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | $this->load(__DIR__.'/Commands'); 39 | 40 | require base_path('routes/console.php'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | [ 32 | \App\Http\Middleware\EncryptCookies::class, 33 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 34 | \Illuminate\Session\Middleware\StartSession::class, 35 | // \Illuminate\Session\Middleware\AuthenticateSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | ], 40 | 41 | 'api' => [ 42 | 'throttle:60,1', 43 | 'bindings', 44 | ], 45 | ]; 46 | 47 | /** 48 | * The application's route middleware. 49 | * 50 | * These middleware may be assigned to groups or used individually. 51 | * 52 | * @var array 53 | */ 54 | protected $routeMiddleware = [ 55 | 'auth' => \App\Http\Middleware\Authenticate::class, 56 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 57 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 58 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 59 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 60 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 61 | 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 62 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 63 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 64 | ]; 65 | 66 | /** 67 | * The priority-sorted list of middleware. 68 | * 69 | * This forces non-global middleware to always be in the given order. 70 | * 71 | * @var array 72 | */ 73 | protected $middlewarePriority = [ 74 | \Illuminate\Session\Middleware\StartSession::class, 75 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 76 | \App\Http\Middleware\Authenticate::class, 77 | \Illuminate\Session\Middleware\AuthenticateSession::class, 78 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 79 | \Illuminate\Auth\Middleware\Authorize::class, 80 | ]; 81 | } 82 | -------------------------------------------------------------------------------- /app/Http/Livewire/Cart.php: -------------------------------------------------------------------------------- 1 | 'updated', 14 | 'destroyCart' => 'destroy' 15 | ]; 16 | 17 | protected $casts = [ 18 | 'cartItems' => 'collection' 19 | ]; 20 | 21 | protected function setCart() 22 | { 23 | $this->cartItems = app('cart')->content(); 24 | $this->cartCount = $this->cartItems->count(); 25 | $this->cartTotal = app('cart')->subtotal(); 26 | $this->emit('setTotalAmount', app('cart')->subtotal(false).'00'); 27 | } 28 | 29 | public function incrementItem($rowId, $qty, ShoppingCart $cart) 30 | { 31 | $qty++; 32 | $cart->update($rowId, $qty); 33 | } 34 | 35 | public function decrementItem($rowId, $qty, ShoppingCart $cart) 36 | { 37 | $qty--; 38 | $cart->update($rowId, $qty); 39 | if($qty <= 0) 40 | { 41 | $this->emit('itemRemoved', $rowId); 42 | } 43 | } 44 | 45 | public function removeItem($rowId, ShoppingCart $cart) 46 | { 47 | $cart->remove($rowId); 48 | $this->emit('itemRemoved', $rowId); 49 | } 50 | 51 | public function destroy(ShoppingCart $cart) 52 | { 53 | $cart->destroy(); 54 | $this->emit('cartDestroyed'); 55 | } 56 | 57 | public function updated() 58 | { 59 | $this->setCart(); 60 | } 61 | 62 | public function render() 63 | { 64 | $this->setCart(); 65 | 66 | return view('livewire.cart'); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/Http/Livewire/Item.php: -------------------------------------------------------------------------------- 1 | 'removeRowId', 16 | 'cartDestroyed' => 'updated', 17 | ]; 18 | 19 | public function mount(ShopItem $item) 20 | { 21 | $this->item = $item; 22 | } 23 | 24 | public function addToCart(ShoppingCart $cart) 25 | { 26 | $item = $this->item; 27 | $cartItem = $cart->add($item['id'], $item['name'], 1, $item['price'], [ 28 | 'img' => $item['img'], 29 | 'article' => $item['article'], 30 | 'category' => $item['category'] 31 | ]); 32 | $this->rowId = $cartItem->rowId; 33 | $this->emit("cartUpdated"); 34 | } 35 | 36 | public function removeFromCart($rowId, ShoppingCart $cart) 37 | { 38 | $cart->remove($rowId); 39 | $this->rowId = null; 40 | $this->emit("cartUpdated"); 41 | } 42 | 43 | public function removeRowId($rowId) 44 | { 45 | if(isset($this->rowId) && $this->rowId == $rowId) 46 | { 47 | $this->rowId = null; 48 | } 49 | } 50 | 51 | public function updated() 52 | { 53 | if(!$this->item instanceof ShopItem) 54 | { 55 | $this->item = new ShopItem($this->item); 56 | } 57 | } 58 | 59 | public function render() 60 | { 61 | $item = $this->item; 62 | $cartItem = app('cart')->search(function ($cartItem) use ($item) { 63 | return $cartItem->id === $item->id; 64 | })->first(); 65 | if (isset($cartItem)) { 66 | $this->rowId = $cartItem->rowId; 67 | } else{ 68 | $this->rowId = null; 69 | } 70 | 71 | return view('livewire.item'); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/Http/Livewire/Sidebar.php: -------------------------------------------------------------------------------- 1 | emit('filterItems', (float) $this->min, (float) $this->pricerange, $this->sale); 19 | } 20 | 21 | public function toggleSale() 22 | { 23 | $this->sale = !$this->sale; 24 | $this->updated(); 25 | } 26 | 27 | public function render() 28 | { 29 | return view('livewire.sidebar'); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/Http/Livewire/Store.php: -------------------------------------------------------------------------------- 1 | 'filterItems', 16 | ]; 17 | 18 | public function mount($category = null) 19 | { 20 | switch ($category) { 21 | case null: 22 | $this->category = $category; 23 | $this->items = Item::all(); 24 | break; 25 | case 'men': 26 | case 'women': 27 | $this->category = $category; 28 | $this->items = Item::where('category', $category)->get(); 29 | break; 30 | case 'sale': 31 | $this->items = Item::where('sale', true)->get(); 32 | break; 33 | default: 34 | return abort(404); 35 | break; 36 | } 37 | } 38 | 39 | public function filterItems(float $min, float $pricerange, bool $sale) 40 | { 41 | $this->sale = $sale; 42 | $category = $this->category; 43 | 44 | if($sale) { 45 | $this->items = Item::where('sale', $sale) 46 | ->when(isset($category), function($query) use ($category) { 47 | $query->where('category', $category); 48 | }) 49 | ->when(isset($pricerange), function($query) use ($min,$pricerange) { 50 | $query->whereBetween('price', [$min, $pricerange]); 51 | }) 52 | ->get(); 53 | } else { 54 | $this->items = Item::whereBetween('price', [$min, $pricerange]) 55 | ->when(isset($category), function($query) use ($category) { 56 | $query->where('category', $category); 57 | }) 58 | ->get(); 59 | } 60 | } 61 | 62 | public function render() 63 | { 64 | return view('livewire.store'); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/CheckForMaintenanceMode.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 'boolean' 10 | ]; 11 | 12 | public $guarded = []; 13 | } 14 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | map(function ($value) { 39 | if (is_array($value)) { 40 | return (object) $value; 41 | } 42 | 43 | return $value; 44 | }); 45 | }); 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/Providers/AuthServiceProvider.php: -------------------------------------------------------------------------------- 1 | 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | app->bind('cart', function() { 20 | $session = $this->app->make(SessionManager::class); 21 | $dispatcher = $this->app->make(Dispatcher::class); 22 | return new Cart($session, $dispatcher); 23 | }); 24 | } 25 | 26 | /** 27 | * Bootstrap services. 28 | * 29 | * @return void 30 | */ 31 | public function boot() 32 | { 33 | // 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | parent::boot(); 31 | 32 | // 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 30 | 31 | $this->mapWebRoutes(); 32 | 33 | // 34 | } 35 | 36 | /** 37 | * Define the "web" routes for the application. 38 | * 39 | * These routes all receive session state, CSRF protection, etc. 40 | * 41 | * @return void 42 | */ 43 | protected function mapWebRoutes() 44 | { 45 | Route::middleware('web') 46 | ->group(base_path('routes/web.php')); 47 | } 48 | 49 | /** 50 | * Define the "api" routes for the application. 51 | * 52 | * These routes are typically stateless. 53 | * 54 | * @return void 55 | */ 56 | protected function mapApiRoutes() 57 | { 58 | Route::prefix('api') 59 | ->middleware('api') 60 | ->namespace($this->namespace) 61 | ->group(base_path('routes/api.php')); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | 'datetime', 38 | ]; 39 | } 40 | -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": [ 6 | "framework", 7 | "laravel" 8 | ], 9 | "license": "MIT", 10 | "require": { 11 | "php": "^7.2.5", 12 | "fideloper/proxy": "^4.0", 13 | "fruitcake/laravel-cors": "^2.0", 14 | "guzzlehttp/guzzle": "^6.3", 15 | "laravel/framework": "^7.0", 16 | "laravel/tinker": "^2.0", 17 | "livewire/livewire": "^1.1" 18 | }, 19 | "require-dev": { 20 | "beyondcode/laravel-dump-server": "^1.0", 21 | "facade/ignition": "^2.0", 22 | "fzaninotto/faker": "^1.4", 23 | "mockery/mockery": "^1.3.1", 24 | "nunomaduro/collision": "^4.1", 25 | "phpunit/phpunit": "^8.5" 26 | }, 27 | "config": { 28 | "optimize-autoloader": true, 29 | "preferred-install": "dist", 30 | "sort-packages": true 31 | }, 32 | "extra": { 33 | "laravel": { 34 | "dont-discover": [] 35 | } 36 | }, 37 | "autoload": { 38 | "psr-4": { 39 | "App\\": "app/" 40 | }, 41 | "classmap": [ 42 | "database/seeds", 43 | "database/factories" 44 | ] 45 | }, 46 | "autoload-dev": { 47 | "psr-4": { 48 | "Tests\\": "tests/" 49 | } 50 | }, 51 | "minimum-stability": "dev", 52 | "prefer-stable": true, 53 | "scripts": { 54 | "post-autoload-dump": [ 55 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 56 | "@php artisan package:discover --ansi" 57 | ], 58 | "post-root-package-install": [ 59 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 60 | ], 61 | "post-create-project-cmd": [ 62 | "@php artisan key:generate --ansi" 63 | ], 64 | "post-install-cmd": [ 65 | "@php artisan clear-compiled", 66 | "chmod -R 777 public/" 67 | ] 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | env('APP_NAME', 'Laravel'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Application Environment 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This value determines the "environment" your application is currently 24 | | running in. This may determine how you prefer to configure various 25 | | services the application utilizes. Set this in your ".env" file. 26 | | 27 | */ 28 | 29 | 'env' => env('APP_ENV', 'production'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Application Debug Mode 34 | |-------------------------------------------------------------------------- 35 | | 36 | | When your application is in debug mode, detailed error messages with 37 | | stack traces will be shown on every error that occurs within your 38 | | application. If disabled, a simple generic error page is shown. 39 | | 40 | */ 41 | 42 | 'debug' => env('APP_DEBUG', false), 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Application URL 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This URL is used by the console to properly generate URLs when using 50 | | the Artisan command line tool. You should set this to the root of 51 | | your application so that it is used when running Artisan tasks. 52 | | 53 | */ 54 | 55 | 'url' => env('APP_URL', 'http://localhost'), 56 | 57 | 'asset_url' => env('ASSET_URL', null), 58 | 59 | /* 60 | |-------------------------------------------------------------------------- 61 | | Application Timezone 62 | |-------------------------------------------------------------------------- 63 | | 64 | | Here you may specify the default timezone for your application, which 65 | | will be used by the PHP date and date-time functions. We have gone 66 | | ahead and set this to a sensible default for you out of the box. 67 | | 68 | */ 69 | 70 | 'timezone' => 'UTC', 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Application Locale Configuration 75 | |-------------------------------------------------------------------------- 76 | | 77 | | The application locale determines the default locale that will be used 78 | | by the translation service provider. You are free to set this value 79 | | to any of the locales which will be supported by the application. 80 | | 81 | */ 82 | 83 | 'locale' => 'en', 84 | 85 | /* 86 | |-------------------------------------------------------------------------- 87 | | Application Fallback Locale 88 | |-------------------------------------------------------------------------- 89 | | 90 | | The fallback locale determines the locale to use when the current one 91 | | is not available. You may change the value to correspond to any of 92 | | the language folders that are provided through your application. 93 | | 94 | */ 95 | 96 | 'fallback_locale' => 'en', 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Faker Locale 101 | |-------------------------------------------------------------------------- 102 | | 103 | | This locale will be used by the Faker PHP library when generating fake 104 | | data for your database seeds. For example, this will be used to get 105 | | localized telephone numbers, street address information and more. 106 | | 107 | */ 108 | 109 | 'faker_locale' => 'en_US', 110 | 111 | /* 112 | |-------------------------------------------------------------------------- 113 | | Encryption Key 114 | |-------------------------------------------------------------------------- 115 | | 116 | | This key is used by the Illuminate encrypter service and should be set 117 | | to a random, 32 character string, otherwise these encrypted strings 118 | | will not be safe. Please do this before deploying an application! 119 | | 120 | */ 121 | 122 | 'key' => env('APP_KEY'), 123 | 124 | 'cipher' => 'AES-256-CBC', 125 | 126 | /* 127 | |-------------------------------------------------------------------------- 128 | | Autoloaded Service Providers 129 | |-------------------------------------------------------------------------- 130 | | 131 | | The service providers listed here will be automatically loaded on the 132 | | request to your application. Feel free to add your own services to 133 | | this array to grant expanded functionality to your applications. 134 | | 135 | */ 136 | 137 | 'providers' => [ 138 | 139 | /* 140 | * Laravel Framework Service Providers... 141 | */ 142 | Illuminate\Auth\AuthServiceProvider::class, 143 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 144 | Illuminate\Bus\BusServiceProvider::class, 145 | Illuminate\Cache\CacheServiceProvider::class, 146 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 147 | Illuminate\Cookie\CookieServiceProvider::class, 148 | Illuminate\Database\DatabaseServiceProvider::class, 149 | Illuminate\Encryption\EncryptionServiceProvider::class, 150 | Illuminate\Filesystem\FilesystemServiceProvider::class, 151 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 152 | Illuminate\Hashing\HashServiceProvider::class, 153 | Illuminate\Mail\MailServiceProvider::class, 154 | Illuminate\Notifications\NotificationServiceProvider::class, 155 | Illuminate\Pagination\PaginationServiceProvider::class, 156 | Illuminate\Pipeline\PipelineServiceProvider::class, 157 | Illuminate\Queue\QueueServiceProvider::class, 158 | Illuminate\Redis\RedisServiceProvider::class, 159 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 160 | Illuminate\Session\SessionServiceProvider::class, 161 | Illuminate\Translation\TranslationServiceProvider::class, 162 | Illuminate\Validation\ValidationServiceProvider::class, 163 | Illuminate\View\ViewServiceProvider::class, 164 | 165 | /* 166 | * Package Service Providers... 167 | */ 168 | 169 | /* 170 | * Application Service Providers... 171 | */ 172 | App\Providers\AppServiceProvider::class, 173 | App\Providers\AuthServiceProvider::class, 174 | // App\Providers\BroadcastServiceProvider::class, 175 | App\Providers\EventServiceProvider::class, 176 | App\Providers\RouteServiceProvider::class, 177 | App\Providers\CartServiceProvider::class, 178 | ], 179 | 180 | /* 181 | |-------------------------------------------------------------------------- 182 | | Class Aliases 183 | |-------------------------------------------------------------------------- 184 | | 185 | | This array of class aliases will be registered when this application 186 | | is started. However, feel free to register as many as you wish as 187 | | the aliases are "lazy" loaded so they don't hinder performance. 188 | | 189 | */ 190 | 191 | 'aliases' => [ 192 | 193 | 'App' => Illuminate\Support\Facades\App::class, 194 | 'Arr' => Illuminate\Support\Arr::class, 195 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 196 | 'Auth' => Illuminate\Support\Facades\Auth::class, 197 | 'Blade' => Illuminate\Support\Facades\Blade::class, 198 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 199 | 'Bus' => Illuminate\Support\Facades\Bus::class, 200 | 'Cache' => Illuminate\Support\Facades\Cache::class, 201 | 'Config' => Illuminate\Support\Facades\Config::class, 202 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 203 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 204 | 'DB' => Illuminate\Support\Facades\DB::class, 205 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 206 | 'Event' => Illuminate\Support\Facades\Event::class, 207 | 'File' => Illuminate\Support\Facades\File::class, 208 | 'Gate' => Illuminate\Support\Facades\Gate::class, 209 | 'Hash' => Illuminate\Support\Facades\Hash::class, 210 | 'Http' => Illuminate\Support\Facades\Http::class, 211 | 'Lang' => Illuminate\Support\Facades\Lang::class, 212 | 'Log' => Illuminate\Support\Facades\Log::class, 213 | 'Mail' => Illuminate\Support\Facades\Mail::class, 214 | 'Notification' => Illuminate\Support\Facades\Notification::class, 215 | 'Password' => Illuminate\Support\Facades\Password::class, 216 | 'Queue' => Illuminate\Support\Facades\Queue::class, 217 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 218 | 'Redis' => Illuminate\Support\Facades\Redis::class, 219 | 'Request' => Illuminate\Support\Facades\Request::class, 220 | 'Response' => Illuminate\Support\Facades\Response::class, 221 | 'Route' => Illuminate\Support\Facades\Route::class, 222 | 'Schema' => Illuminate\Support\Facades\Schema::class, 223 | 'Session' => Illuminate\Support\Facades\Session::class, 224 | 'Storage' => Illuminate\Support\Facades\Storage::class, 225 | 'Str' => Illuminate\Support\Str::class, 226 | 'URL' => Illuminate\Support\Facades\URL::class, 227 | 'Validator' => Illuminate\Support\Facades\Validator::class, 228 | 'View' => Illuminate\Support\Facades\View::class, 229 | 230 | ], 231 | 232 | ]; 233 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session", "token" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | 44 | 'api' => [ 45 | 'driver' => 'token', 46 | 'provider' => 'users', 47 | 'hash' => false, 48 | ], 49 | ], 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | User Providers 54 | |-------------------------------------------------------------------------- 55 | | 56 | | All authentication drivers have a user provider. This defines how the 57 | | users are actually retrieved out of your database or other storage 58 | | mechanisms used by this application to persist your user's data. 59 | | 60 | | If you have multiple user tables or models you may configure multiple 61 | | sources which represent each model / table. These sources may then 62 | | be assigned to any extra authentication guards you have defined. 63 | | 64 | | Supported: "database", "eloquent" 65 | | 66 | */ 67 | 68 | 'providers' => [ 69 | 'users' => [ 70 | 'driver' => 'eloquent', 71 | 'model' => App\User::class, 72 | ], 73 | 74 | // 'users' => [ 75 | // 'driver' => 'database', 76 | // 'table' => 'users', 77 | // ], 78 | ], 79 | 80 | /* 81 | |-------------------------------------------------------------------------- 82 | | Resetting Passwords 83 | |-------------------------------------------------------------------------- 84 | | 85 | | You may specify multiple password reset configurations if you have more 86 | | than one user table or model in the application and you want to have 87 | | separate password reset settings based on the specific user types. 88 | | 89 | | The expire time is the number of minutes that the reset token should be 90 | | considered valid. This security feature keeps tokens short-lived so 91 | | they have less time to be guessed. You may change this as needed. 92 | | 93 | */ 94 | 95 | 'passwords' => [ 96 | 'users' => [ 97 | 'provider' => 'users', 98 | 'table' => 'password_resets', 99 | 'expire' => 60, 100 | ], 101 | ], 102 | 103 | ]; 104 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'cluster' => env('PUSHER_APP_CLUSTER'), 40 | 'useTLS' => true, 41 | ], 42 | ], 43 | 44 | 'redis' => [ 45 | 'driver' => 'redis', 46 | 'connection' => 'default', 47 | ], 48 | 49 | 'log' => [ 50 | 'driver' => 'log', 51 | ], 52 | 53 | 'null' => [ 54 | 'driver' => 'null', 55 | ], 56 | 57 | ], 58 | 59 | ]; 60 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | Cache Stores 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Here you may define all of the cache "stores" for your application as 29 | | well as their drivers. You may even define multiple stores for the 30 | | same cache driver to group types of items stored in your caches. 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | ], 50 | 51 | 'file' => [ 52 | 'driver' => 'file', 53 | 'path' => storage_path('framework/cache/data'), 54 | ], 55 | 56 | 'memcached' => [ 57 | 'driver' => 'memcached', 58 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 59 | 'sasl' => [ 60 | env('MEMCACHED_USERNAME'), 61 | env('MEMCACHED_PASSWORD'), 62 | ], 63 | 'options' => [ 64 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 65 | ], 66 | 'servers' => [ 67 | [ 68 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 69 | 'port' => env('MEMCACHED_PORT', 11211), 70 | 'weight' => 100, 71 | ], 72 | ], 73 | ], 74 | 75 | 'redis' => [ 76 | 'driver' => 'redis', 77 | 'connection' => 'cache', 78 | ], 79 | 80 | 'dynamodb' => [ 81 | 'driver' => 'dynamodb', 82 | 'key' => env('AWS_ACCESS_KEY_ID'), 83 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 84 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 85 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 86 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 87 | ], 88 | 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Cache Key Prefix 94 | |-------------------------------------------------------------------------- 95 | | 96 | | When utilizing a RAM based store such as APC or Memcached, there might 97 | | be other applications utilizing the same cache. So, we'll specify a 98 | | value to get prefixed to all our keys so we can avoid collisions. 99 | | 100 | */ 101 | 102 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), 103 | 104 | ]; 105 | -------------------------------------------------------------------------------- /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' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), 127 | ], 128 | 129 | 'default' => [ 130 | 'url' => env('REDIS_URL'), 131 | 'host' => env('REDIS_HOST', '127.0.0.1'), 132 | 'password' => env('REDIS_PASSWORD', null), 133 | 'port' => env('REDIS_PORT', 6379), 134 | 'database' => env('REDIS_DB', 0), 135 | ], 136 | 137 | 'cache' => [ 138 | 'url' => env('REDIS_URL'), 139 | 'host' => env('REDIS_HOST', '127.0.0.1'), 140 | 'password' => env('REDIS_PASSWORD', null), 141 | 'port' => env('REDIS_PORT', 6379), 142 | 'database' => env('REDIS_CACHE_DB', 1), 143 | ], 144 | 145 | ], 146 | 147 | ]; 148 | -------------------------------------------------------------------------------- /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 | |-------------------------------------------------------------------------- 71 | | Symbolic Links 72 | |-------------------------------------------------------------------------- 73 | | 74 | | Here you may configure the symbolic links that will be created when the 75 | | `storage:link` Artisan command is executed. The array keys should be 76 | | the locations of the links and the values should be their targets. 77 | | 78 | */ 79 | 80 | 'links' => [ 81 | public_path('storage') => storage_path('app/public'), 82 | ], 83 | 84 | ]; 85 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 1024, 48 | 'threads' => 2, 49 | 'time' => 2, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/ignition.php: -------------------------------------------------------------------------------- 1 | env('IGNITION_EDITOR', 'vscode'), 18 | 19 | /* 20 | |-------------------------------------------------------------------------- 21 | | Theme 22 | |-------------------------------------------------------------------------- 23 | | 24 | | Here you may specify which theme Ignition should use. 25 | | 26 | | Supported: "light", "dark", "auto" 27 | | 28 | */ 29 | 30 | 'theme' => env('IGNITION_THEME', 'light'), 31 | 32 | /* 33 | |-------------------------------------------------------------------------- 34 | | Sharing 35 | |-------------------------------------------------------------------------- 36 | | 37 | | You can share local errors with colleagues or others around the world. 38 | | Sharing is completely free and doesn't require an account on Flare. 39 | | 40 | | If necessary, you can completely disable sharing below. 41 | | 42 | */ 43 | 44 | 'enable_share_button' => env('IGNITION_SHARING_ENABLED', true), 45 | 46 | /* 47 | |-------------------------------------------------------------------------- 48 | | Register Ignition commands 49 | |-------------------------------------------------------------------------- 50 | | 51 | | Ignition comes with an additional make command that lets you create 52 | | new solution classes more easily. To keep your default Laravel 53 | | installation clean, this command is not registered by default. 54 | | 55 | | You can enable the command registration below. 56 | | 57 | */ 58 | 'register_commands' => env('REGISTER_IGNITION_COMMANDS', false), 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | Ignored Solution Providers 63 | |-------------------------------------------------------------------------- 64 | | 65 | | You may specify a list of solution providers (as fully qualified class 66 | | names) that shouldn't be loaded. Ignition will ignore these classes 67 | | and possible solutions provided by them will never be displayed. 68 | | 69 | */ 70 | 71 | 'ignored_solution_providers' => [ 72 | \Facade\Ignition\SolutionProviders\MissingPackageSolutionProvider::class, 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Runnable Solutions 78 | |-------------------------------------------------------------------------- 79 | | 80 | | Some solutions that Ignition displays are runnable and can perform 81 | | various tasks. Runnable solutions are enabled when your app has 82 | | debug mode enabled. You may also fully disable this feature. 83 | | 84 | */ 85 | 86 | 'enable_runnable_solutions' => env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS', null), 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Remote Path Mapping 91 | |-------------------------------------------------------------------------- 92 | | 93 | | If you are using a remote dev server, like Laravel Homestead, Docker, or 94 | | even a remote VPS, it will be necessary to specify your path mapping. 95 | | 96 | | Leaving one, or both of these, empty or null will not trigger the remote 97 | | URL changes and Ignition will treat your editor links as local files. 98 | | 99 | | "remote_sites_path" is an absolute base path for your sites or projects 100 | | in Homestead, Vagrant, Docker, or another remote development server. 101 | | 102 | | Example value: "/home/vagrant/Code" 103 | | 104 | | "local_sites_path" is an absolute base path for your sites or projects 105 | | on your local computer where your IDE or code editor is running on. 106 | | 107 | | Example values: "/Users//Code", "C:\Users\\Documents\Code" 108 | | 109 | */ 110 | 111 | 'remote_sites_path' => env('IGNITION_REMOTE_SITES_PATH', ''), 112 | 'local_sites_path' => env('IGNITION_LOCAL_SITES_PATH', ''), 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Housekeeping Endpoint Prefix 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Ignition registers a couple of routes when it is enabled. Below you may 120 | | specify a route prefix that will be used to host all internal links. 121 | | 122 | */ 123 | 'housekeeping_endpoint_prefix' => '_ignition', 124 | 125 | ]; 126 | -------------------------------------------------------------------------------- /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_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'auth_mode' => null, 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | ], 59 | 60 | 'sendmail' => [ 61 | 'transport' => 'sendmail', 62 | 'path' => '/usr/sbin/sendmail -bs', 63 | ], 64 | 65 | 'log' => [ 66 | 'transport' => 'log', 67 | 'channel' => env('MAIL_LOG_CHANNEL'), 68 | ], 69 | 70 | 'array' => [ 71 | 'transport' => 'array', 72 | ], 73 | ], 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Global "From" Address 78 | |-------------------------------------------------------------------------- 79 | | 80 | | You may wish for all e-mails sent by your application to be sent from 81 | | the same address. Here, you may specify a name and address that is 82 | | used globally for all e-mails that are sent by your application. 83 | | 84 | */ 85 | 86 | 'from' => [ 87 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 88 | 'name' => env('MAIL_FROM_NAME', 'Example'), 89 | ], 90 | 91 | /* 92 | |-------------------------------------------------------------------------- 93 | | Markdown Mail Settings 94 | |-------------------------------------------------------------------------- 95 | | 96 | | If you are using Markdown based email rendering, you may configure your 97 | | theme and component paths here, allowing you to customize the design 98 | | of the emails. Or, you may simply stick with the Laravel defaults! 99 | | 100 | */ 101 | 102 | 'markdown' => [ 103 | 'theme' => 'default', 104 | 105 | 'paths' => [ 106 | resource_path('views/vendor/mail'), 107 | ], 108 | ], 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /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 | 'suffix' => env('SQS_SUFFIX'), 59 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 60 | ], 61 | 62 | 'redis' => [ 63 | 'driver' => 'redis', 64 | 'connection' => 'default', 65 | 'queue' => env('REDIS_QUEUE', 'default'), 66 | 'retry_after' => 90, 67 | 'block_for' => null, 68 | ], 69 | 70 | ], 71 | 72 | /* 73 | |-------------------------------------------------------------------------- 74 | | Failed Queue Jobs 75 | |-------------------------------------------------------------------------- 76 | | 77 | | These options configure the behavior of failed queue job logging so you 78 | | can control which database and table are used to store the jobs that 79 | | have failed. You may change them to any database / table you wish. 80 | | 81 | */ 82 | 83 | 'failed' => [ 84 | 'database' => env('DB_CONNECTION', 'mysql'), 85 | 'table' => 'failed_jobs', 86 | ], 87 | 88 | ]; 89 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | ], 22 | 23 | 'postmark' => [ 24 | 'token' => env('POSTMARK_TOKEN'), 25 | ], 26 | 27 | 'ses' => [ 28 | 'key' => env('AWS_ACCESS_KEY_ID'), 29 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 30 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 31 | ], 32 | 33 | 'sparkpost' => [ 34 | 'secret' => env('SPARKPOST_SECRET'), 35 | ], 36 | 37 | 'stripe' => [ 38 | 'model' => App\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 | | While using one of the framework's cache driven session backends 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 | | Affects: "apc", "dynamodb", "memcached", "redis" 100 | | 101 | */ 102 | 103 | 'store' => env('SESSION_STORE', null), 104 | 105 | 'secure' => env('SESSION_SECURE_COOKIE'), 106 | 107 | /* 108 | |-------------------------------------------------------------------------- 109 | | Session Sweeping Lottery 110 | |-------------------------------------------------------------------------- 111 | | 112 | | Some session drivers must manually sweep their storage location to get 113 | | rid of old sessions from storage. Here are the chances that it will 114 | | happen on a given request. By default, the odds are 2 out of 100. 115 | | 116 | */ 117 | 118 | 'lottery' => [2, 100], 119 | 120 | /* 121 | |-------------------------------------------------------------------------- 122 | | Session Cookie Name 123 | |-------------------------------------------------------------------------- 124 | | 125 | | Here you may change the name of the cookie used to identify a session 126 | | instance by ID. The name specified here will get used every time a 127 | | new session cookie is created by the framework for every driver. 128 | | 129 | */ 130 | 131 | 'cookie' => env( 132 | 'SESSION_COOKIE', 133 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session' 134 | ), 135 | 136 | /* 137 | |-------------------------------------------------------------------------- 138 | | Session Cookie Path 139 | |-------------------------------------------------------------------------- 140 | | 141 | | The session cookie path determines the path for which the cookie will 142 | | be regarded as available. Typically, this will be the root path of 143 | | your application but you are free to change this when necessary. 144 | | 145 | */ 146 | 147 | 'path' => '/', 148 | 149 | /* 150 | |-------------------------------------------------------------------------- 151 | | Session Cookie Domain 152 | |-------------------------------------------------------------------------- 153 | | 154 | | Here you may change the domain of the cookie used to identify a session 155 | | in your application. This will determine which domains the cookie is 156 | | available to in your application. A sensible default has been set. 157 | | 158 | */ 159 | 160 | 'domain' => env('SESSION_DOMAIN', null), 161 | 162 | /* 163 | |-------------------------------------------------------------------------- 164 | | HTTPS Only Cookies 165 | |-------------------------------------------------------------------------- 166 | | 167 | | By setting this option to true, session cookies will only be sent back 168 | | to the server if the browser has a HTTPS connection. This will keep 169 | | the cookie from being sent to you if it can not be done securely. 170 | | 171 | */ 172 | 173 | 'secure' => env('SESSION_SECURE_COOKIE', false), 174 | 175 | /* 176 | |-------------------------------------------------------------------------- 177 | | HTTP Access Only 178 | |-------------------------------------------------------------------------- 179 | | 180 | | Setting this value to true will prevent JavaScript from accessing the 181 | | value of the cookie and the cookie will only be accessible through 182 | | the HTTP protocol. You are free to modify this option if needed. 183 | | 184 | */ 185 | 186 | 'http_only' => true, 187 | 188 | /* 189 | |-------------------------------------------------------------------------- 190 | | Same-Site Cookies 191 | |-------------------------------------------------------------------------- 192 | | 193 | | This option determines how your cookies behave when cross-site requests 194 | | take place, and can be used to mitigate CSRF attacks. By default, we 195 | | do not enable this as other CSRF protection services are in place. 196 | | 197 | | Supported: "lax", "strict" 198 | | 199 | */ 200 | 201 | 'same_site' => null, 202 | 203 | ]; 204 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | *.sqlite-journal 3 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | define(User::class, function (Faker $faker) { 20 | return [ 21 | 'name' => $faker->name, 22 | 'email' => $faker->unique()->safeEmail, 23 | 'email_verified_at' => now(), 24 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 25 | 'remember_token' => Str::random(10), 26 | ]; 27 | }); 28 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->timestamp('email_verified_at')->nullable(); 21 | $table->string('password'); 22 | $table->rememberToken(); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('users'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2019_08_04_222532_create_items_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('name'); 19 | $table->string('category'); 20 | $table->string('article'); 21 | $table->float('price'); 22 | $table->boolean('sale')->default(false); 23 | $table->string('img'); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('items'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /database/seeds/ItemSeeder.php: -------------------------------------------------------------------------------- 1 | 'Khaki Suede Polish Work Boots', 11 | 'price' => 3400, 12 | 'category' => 'women', 13 | 'sale' => true, 14 | 'article' => 'shoe', 15 | 'img' => 'shoe1.png', 16 | ], 17 | [ 18 | 'name' => 'Camo Fang Backpack Jungle', 19 | 'price' => 6300, 20 | 'category' => 'women', 21 | 'sale' => false, 22 | 'article' => 'jacket', 23 | 'img' => 'jacket1.png', 24 | ], 25 | [ 26 | 'name' => 'Parka and Quilted Liner Jacket', 27 | 'price' => 9500, 28 | 'category' => 'men', 29 | 'sale' => true, 30 | 'article' => 'jacket', 31 | 'img' => 'jacket2.png', 32 | ], 33 | [ 34 | 'name' => 'Cotton Black Cap', 35 | 'price' => 2500, 36 | 'category' => 'men', 37 | 'sale' => true, 38 | 'article' => 'hats', 39 | 'img' => 'hat1.png', 40 | ], 41 | [ 42 | 'name' => 'Knit Sweater with Zips', 43 | 'price' => 5600, 44 | 'category' => 'women', 45 | 'sale' => false, 46 | 'article' => 'sweater', 47 | 'img' => 'sweater1.png', 48 | ], 49 | [ 50 | 'name' => 'Long Linen-blend Shirt', 51 | 'price' => 7200, 52 | 'category' => 'men', 53 | 'sale' => false, 54 | 'article' => 'shirt', 55 | 'img' => 'shirt1.png', 56 | ], 57 | [ 58 | 'name' => 'Knit Orange Sweater', 59 | 'price' => 6200, 60 | 'category' => 'men', 61 | 'sale' => false, 62 | 'article' => 'sweater', 63 | 'img' => 'sweater2.png', 64 | ], 65 | [ 66 | 'name' => 'Cotton Band-collar Blouse', 67 | 'price' => 3400, 68 | 'category' => 'men', 69 | 'sale' => false, 70 | 'article' => 'shirt', 71 | 'img' => 'shirt2.png', 72 | ], 73 | [ 74 | 'name' => 'Camo Fang Backpack Jungle', 75 | 'price' => 4400, 76 | 'category' => 'women', 77 | 'sale' => true, 78 | 'article' => 'jacket', 79 | 'img' => 'jacket3.png', 80 | ], 81 | [ 82 | 'name' => 'Golden Pilot Jacket', 83 | 'price' => 9700, 84 | 'category' => 'women', 85 | 'sale' => false, 86 | 'article' => 'jacket', 87 | 'img' => 'jacket4.png', 88 | ], 89 | [ 90 | 'name' => 'Spotted Patterned Sweater', 91 | 'price' => 8900, 92 | 'category' => 'women', 93 | 'sale' => false, 94 | 'article' => 'jacket', 95 | 'img' => 'sweater4.png', 96 | ], 97 | [ 98 | 'name' => 'Double Knit Sweater', 99 | 'price' => 5900, 100 | 'category' => 'men', 101 | 'sale' => true, 102 | 'article' => 'jacket', 103 | 'img' => 'sweater5.png', 104 | ] 105 | ]; 106 | /** 107 | * Run the database seeds. 108 | * 109 | * @return void 110 | */ 111 | public function run() 112 | { 113 | $items = $this->items; 114 | 115 | foreach ($items as $item) { 116 | Item::create($item); 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | 4 | #PHP Service 5 | app: 6 | build: 7 | context: . 8 | dockerfile: Dockerfile 9 | image: livewireshop/laravel 10 | container_name: app 11 | restart: unless-stopped 12 | tty: true 13 | environment: 14 | APP_ENV: testing 15 | APP_DEBUG: false 16 | working_dir: /var/www 17 | volumes: 18 | - ./:/var/www 19 | - ./php/local.ini:/usr/local/etc/php/conf.d/local.ini 20 | networks: 21 | - app-network 22 | 23 | #Nginx Service 24 | webserver: 25 | image: nginx:alpine 26 | container_name: webserver 27 | restart: unless-stopped 28 | tty: true 29 | ports: 30 | - "80:80" 31 | - "443:443" 32 | volumes: 33 | - ./:/var/www 34 | - ./nginx/conf.d/:/etc/nginx/conf.d/ 35 | networks: 36 | - app-network 37 | 38 | #MySQL Service 39 | db: 40 | image: mysql:5.7 41 | container_name: db 42 | restart: unless-stopped 43 | tty: true 44 | ports: 45 | - "3306:3306" 46 | environment: 47 | MYSQL_DATABASE: liveshop 48 | MYSQL_USER: root 49 | MYSQL_ROOT_PASSWORD: root 50 | MYSQL_ROOT_PASSWORD: root 51 | SERVICE_NAME: mysql 52 | volumes: 53 | - dbdata:/var/lib/mysql/ 54 | - ./mysql/my.cnf:/etc/mysql/my.cnf 55 | networks: 56 | - app-network 57 | 58 | #Docker Networks 59 | networks: 60 | app-network: 61 | driver: bridge 62 | #Volumes 63 | volumes: 64 | dbdata: 65 | driver: local 66 | -------------------------------------------------------------------------------- /nginx/conf.d/app.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | index index.php index.html; 4 | error_log /var/log/nginx/error.log; 5 | access_log /var/log/nginx/access.log; 6 | root /var/www/public; 7 | location ~ \.php$ { 8 | try_files $uri =404; 9 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 10 | fastcgi_pass app:9000; 11 | fastcgi_index index.php; 12 | include fastcgi_params; 13 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 14 | fastcgi_param PATH_INFO $fastcgi_path_info; 15 | } 16 | location / { 17 | try_files $uri $uri/ /index.php?$query_string; 18 | gzip_static on; 19 | } 20 | } -------------------------------------------------------------------------------- /now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1 3 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "npm run development", 5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", 6 | "watch": "npm run development -- --watch", 7 | "watch-poll": "npm run watch -- --watch-poll", 8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", 9 | "prod": "npm run production", 10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" 11 | }, 12 | "devDependencies": { 13 | "axios": "^0.19", 14 | "bootstrap": "^4.1.0", 15 | "cross-env": "^5.1", 16 | "jquery": "^3.5", 17 | "laravel-mix": "^4.0.7", 18 | "lodash": "^4.17.19", 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 | "postcss-import": "^12.0.1", 28 | "tailwindcss": "^1.0.5" 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 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/banner-ppl-women.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/banner-ppl-women.png -------------------------------------------------------------------------------- /public/banner-ppl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/banner-ppl.png -------------------------------------------------------------------------------- /public/bk-sale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/bk-sale.png -------------------------------------------------------------------------------- /public/css/main.css: -------------------------------------------------------------------------------- 1 | * { 2 | box-sizing: border-box; 3 | } 4 | 5 | body, 6 | html { 7 | padding: 0; 8 | margin: 0; 9 | height: 100%; 10 | background: #e6eefb; 11 | font-size: 16px; 12 | word-spacing: 1px; 13 | -ms-text-size-adjust: 100%; 14 | -webkit-text-size-adjust: 100%; 15 | -webkit-box-sizing: border-box; 16 | box-sizing: border-box 17 | } 18 | 19 | #app, 20 | body, 21 | html { 22 | -moz-osx-font-smoothing: grayscale; 23 | -webkit-font-smoothing: antialiased; 24 | font-family: Barlow, Helvetica, Arial, sans-serif 25 | } 26 | 27 | #app { 28 | text-align: center; 29 | color: #fff 30 | } 31 | 32 | h1, 33 | h2, 34 | h3, 35 | h4 { 36 | font-family: Playfair Display, serif; 37 | font-weight: 700 38 | } 39 | 40 | li, 41 | p { 42 | font-family: Barlow, sans-serif 43 | } 44 | 45 | button[class*=add], 46 | button[class*=remove], 47 | input[type=button], 48 | input[type=reset], 49 | input[type=submit] { 50 | background: none; 51 | border: 0; 52 | color: inherit; 53 | font: inherit; 54 | line-height: normal; 55 | overflow: visible; 56 | padding: 0; 57 | -webkit-appearance: button; 58 | -webkit-user-select: none; 59 | -moz-user-select: none; 60 | -ms-user-select: none 61 | } 62 | 63 | button[class*=add]::-moz-focus-inner, 64 | button[class*=remove]::-moz-focus-inner, 65 | input::-moz-focus-inner { 66 | border: 0; 67 | padding: 0 68 | } 69 | 70 | button[class*=add] { 71 | padding: 10px 30px; 72 | font-size: 13px; 73 | font-weight: 600; 74 | border-radius: 1000px; 75 | cursor: pointer; 76 | background: #fff; 77 | color: #3e64ea; 78 | border: 1px solid #3e64ea; 79 | font-family: Barlow, sans-serif; 80 | text-transform: uppercase; 81 | margin: 10px; 82 | -webkit-transition: all .15s ease-out; 83 | transition: all .15s ease-out 84 | } 85 | 86 | button[class*=add]:hover { 87 | background: #3e64ea; 88 | color: #fff; 89 | -webkit-transition: all .2s ease-in; 90 | transition: all .2s ease-in 91 | } 92 | 93 | button[class*=remove] { 94 | padding: 10px 30px; 95 | font-size: 13px; 96 | font-weight: 600; 97 | border-radius: 1000px; 98 | cursor: pointer; 99 | background: #fff; 100 | color: rgb(226, 19, 19); 101 | border: 1px solid rgb(223, 66, 66); 102 | font-family: Barlow, sans-serif; 103 | text-transform: uppercase; 104 | margin: 10px; 105 | -webkit-transition: all .15s ease-out; 106 | transition: all .15s ease-out 107 | } 108 | 109 | button[class*=remove]:hover { 110 | background: rgb(223, 66, 66); 111 | color: #fff; 112 | -webkit-transition: all .2s ease-in; 113 | transition: all .2s ease-in 114 | } 115 | 116 | *, 117 | :after, 118 | :before { 119 | -webkit-box-sizing: border-box; 120 | box-sizing: border-box; 121 | margin: 0 122 | } 123 | 124 | .capsule { 125 | width: 100%; 126 | max-width: 1100px; 127 | margin: 0 auto 128 | } 129 | 130 | input[type=email] { 131 | line-height: 24px; 132 | font-family: Helvetica Neue; 133 | font-size: 16px; 134 | height: 24px; 135 | width: 100%; 136 | -webkit-font-smoothing: antialiased 137 | } 138 | 139 | input:-moz-placeholder, 140 | input:-ms-input-placeholder, 141 | input::-moz-placeholder, 142 | input::-webkit-input-placeholder { 143 | color: #aab8c3 144 | } 145 | 146 | input:-moz-placeholder, 147 | input:-ms-input-placeholder, 148 | input::-moz-placeholder, 149 | input::-webkit-input-placeholder, 150 | input::placeholder { 151 | color: #aab8c3 152 | } 153 | 154 | aside { 155 | float: left; 156 | width: 19.1489% 157 | } 158 | 159 | .content { 160 | float: right; 161 | width: 79.7872%; 162 | display: grid; 163 | grid-template-columns: repeat(3, 1fr); 164 | grid-gap: 10px; 165 | padding: 0 !important 166 | } 167 | 168 | @supports (display:grid) { 169 | .capsule>* { 170 | width: auto; 171 | margin: 0 172 | } 173 | } 174 | 175 | .items-leave-active { 176 | -webkit-transition: all .2s ease-in; 177 | transition: all .2s ease-in 178 | } 179 | 180 | .items-move { 181 | -webkit-transition: all .2s ease-in-out; 182 | transition: all .2s ease-in-out 183 | } 184 | 185 | .items-enter-active { 186 | -webkit-transition: all .2s ease-out; 187 | transition: all .2s ease-out 188 | } 189 | 190 | .items-enter, 191 | .items-leave-to { 192 | opacity: 0; 193 | -webkit-transform: scale(.9); 194 | transform: scale(.9); 195 | -webkit-transform-origin: 50% 50%; 196 | transform-origin: 50% 50% 197 | } 198 | 199 | .fade-leave-active { 200 | -webkit-transition: all .2s ease-in; 201 | transition: all .2s ease-in 202 | } 203 | 204 | .fade-enter-active { 205 | -webkit-transition: all .2s ease-out; 206 | transition: all .2s ease-out 207 | } 208 | 209 | .fade-enter, 210 | .fade-leave-to { 211 | opacity: 0 212 | } 213 | 214 | input[type=range].slider { 215 | -webkit-appearance: none; 216 | width: 100%; 217 | margin: 25px 0 5px 218 | } 219 | 220 | input[type=range].slider:focus { 221 | outline: none 222 | } 223 | 224 | input[type=range].slider::-webkit-slider-runnable-track { 225 | width: 100%; 226 | height: 4.3px; 227 | cursor: pointer; 228 | -webkit-box-shadow: 0 0 0 transparent, 0 0 0 hsla(0, 0%, 5%, 0); 229 | box-shadow: 0 0 0 transparent, 0 0 0 hsla(0, 0%, 5%, 0); 230 | background: #3e64ea; 231 | border-radius: 13.7px; 232 | border: 0 solid rgba(1, 1, 1, 0) 233 | } 234 | 235 | input[type=range].slider::-webkit-slider-thumb { 236 | -webkit-box-shadow: 0 0 0 rgba(0, 0, 62, 0), 0 0 0 rgba(0, 0, 88, 0); 237 | box-shadow: 0 0 0 rgba(0, 0, 62, 0), 0 0 0 rgba(0, 0, 88, 0); 238 | border: 1.9px solid #3e63ea; 239 | height: 17px; 240 | width: 17px; 241 | border-radius: 31px; 242 | background: #fff; 243 | cursor: pointer; 244 | -webkit-appearance: none; 245 | margin-top: -6.35px 246 | } 247 | 248 | input[type=range].slider:focus::-webkit-slider-runnable-track { 249 | background: #5576ed 250 | } 251 | 252 | input[type=range].slider::-moz-range-track { 253 | width: 100%; 254 | height: 4.3px; 255 | cursor: pointer; 256 | box-shadow: 0 0 0 transparent, 0 0 0 hsla(0, 0%, 5%, 0); 257 | background: #3e64ea; 258 | border-radius: 13.7px; 259 | border: 0 solid rgba(1, 1, 1, 0) 260 | } 261 | 262 | input[type=range].slider::-moz-range-thumb { 263 | box-shadow: 0 0 0 rgba(0, 0, 62, 0), 0 0 0 rgba(0, 0, 88, 0); 264 | border: 1.9px solid #3e63ea; 265 | height: 17px; 266 | width: 17px; 267 | border-radius: 31px; 268 | background: #fff; 269 | cursor: pointer 270 | } 271 | 272 | input[type=range].slider::-ms-track { 273 | width: 100%; 274 | height: 4.3px; 275 | cursor: pointer; 276 | background: transparent; 277 | border-color: transparent; 278 | color: transparent 279 | } 280 | 281 | input[type=range].slider::-ms-fill-lower { 282 | background: #2752e7 283 | } 284 | 285 | input[type=range].slider::-ms-fill-lower, 286 | input[type=range].slider::-ms-fill-upper { 287 | border: 0 solid rgba(1, 1, 1, 0); 288 | border-radius: 27.4px; 289 | box-shadow: 0 0 0 transparent, 0 0 0 hsla(0, 0%, 5%, 0) 290 | } 291 | 292 | input[type=range].slider::-ms-fill-upper { 293 | background: #3e64ea 294 | } 295 | 296 | input[type=range].slider::-ms-thumb { 297 | box-shadow: 0 0 0 rgba(0, 0, 62, 0), 0 0 0 rgba(0, 0, 88, 0); 298 | border: 1.9px solid #3e63ea; 299 | height: 17px; 300 | width: 17px; 301 | border-radius: 31px; 302 | background: #fff; 303 | cursor: pointer; 304 | height: 4.3px 305 | } 306 | 307 | input[type=range].slider:focus::-ms-fill-lower { 308 | background: #3e64ea 309 | } 310 | 311 | input[type=range].slider:focus::-ms-fill-upper { 312 | background: #5576ed 313 | } 314 | 315 | @media (max-width:600px) { 316 | aside { 317 | margin-bottom: 10px !important 318 | } 319 | 320 | .content, 321 | aside { 322 | width: 100% !important 323 | } 324 | 325 | .content { 326 | grid-template-columns: 1fr !important 327 | } 328 | 329 | nav li { 330 | padding: 0 10px !important 331 | } 332 | 333 | nav .capsule { 334 | -ms-flex-pack: distribute !important; 335 | justify-content: space-around !important 336 | } 337 | 338 | .cartitems { 339 | padding: 30px 0 !important 340 | } 341 | 342 | .cartitems, 343 | .payment { 344 | width: 350px !important 345 | } 346 | } 347 | 348 | @media (min-width:601px) and (max-width:900px) { 349 | .content { 350 | grid-template-columns: repeat(2, 1fr) !important 351 | } 352 | } 353 | 354 | .clear { 355 | clear: both 356 | } 357 | 358 | .wrapper { 359 | min-height: 100vh; 360 | margin-bottom: -60px 361 | } 362 | 363 | .footer, 364 | .push { 365 | height: 50px; 366 | margin-top: 10px 367 | } 368 | 369 | /* .navarea { 370 | overflow: hidden 371 | } */ 372 | 373 | nav .capsule { 374 | overflow: hidden; 375 | display: -webkit-box; 376 | display: -ms-flexbox; 377 | display: flex; 378 | -webkit-box-pack: justify; 379 | -ms-flex-pack: justify; 380 | justify-content: space-between; 381 | -webkit-box-align: center; 382 | -ms-flex-align: center; 383 | align-items: center 384 | } 385 | 386 | nav { 387 | width: 100vw; 388 | height: 60px; 389 | background: #fff 390 | } 391 | 392 | ul { 393 | padding-left: 0; 394 | display: -webkit-box; 395 | display: -ms-flexbox; 396 | display: flex; 397 | list-style: none outside none; 398 | -webkit-box-pack: center; 399 | -ms-flex-pack: center; 400 | justify-content: center; 401 | -webkit-box-align: center; 402 | -ms-flex-align: center; 403 | align-items: center 404 | } 405 | 406 | li { 407 | padding: 0 50px 408 | } 409 | 410 | ul a, 411 | ul a:active, 412 | ul a:visited { 413 | text-decoration: none; 414 | color: #000 415 | } 416 | 417 | aside { 418 | float: left; 419 | width: 19.1489% 420 | } 421 | 422 | .content { 423 | float: right; 424 | width: 79.7872%; 425 | display: grid; 426 | grid-template-columns: repeat(3, 1fr); 427 | grid-gap: 10px; 428 | padding: 0 !important 429 | } 430 | 431 | @supports (display:grid) { 432 | .capsule>* { 433 | width: auto; 434 | margin: 0 435 | } 436 | } 437 | 438 | h1 { 439 | color: #fff; 440 | position: relative; 441 | z-index: 12; 442 | font-size: 60px; 443 | padding: 8px 80px 444 | } 445 | 446 | .bk { 447 | position: absolute; 448 | top: 0; 449 | left: 0 450 | } 451 | 452 | .ppl-banner { 453 | position: absolute; 454 | z-index: 10; 455 | right: 100px 456 | } 457 | 458 | .masthead { 459 | width: 100%; 460 | height: 100px; 461 | color: #fff; 462 | position: relative; 463 | overflow: hidden; 464 | margin: 10px 0 465 | } 466 | 467 | .contain aside { 468 | background: #fff; 469 | float: left; 470 | padding: 20px 471 | } 472 | 473 | .sidearea { 474 | border-bottom: 1px solid #ccc 475 | } 476 | 477 | .sidearea:last-of-type { 478 | border: none 479 | } 480 | 481 | .callout { 482 | padding: 20px 0 483 | } 484 | 485 | .callout h4 { 486 | padding-bottom: 10px 487 | } 488 | 489 | .sidearea:first-of-type { 490 | padding-bottom: 40px 491 | } 492 | 493 | label { 494 | font-family: Playfair Display, serif; 495 | padding: 15px 0; 496 | text-align: center 497 | } 498 | 499 | span { 500 | font-family: Barlow, sans-serif 501 | } 502 | 503 | .max { 504 | font-size: 12px; 505 | float: right; 506 | color: #565656 507 | } 508 | 509 | .min { 510 | float: left; 511 | font-size: 12px; 512 | color: #565656 513 | } 514 | 515 | h4 { 516 | margin: 20px 0 517 | } 518 | 519 | .can-toggle { 520 | position: relative 521 | } 522 | 523 | .can-toggle, 524 | .can-toggle :after, 525 | .can-toggle :before { 526 | -webkit-box-sizing: border-box; 527 | box-sizing: border-box 528 | } 529 | 530 | .can-toggle input[type=checkbox] { 531 | opacity: 0; 532 | position: absolute; 533 | top: 0; 534 | left: 0 535 | } 536 | 537 | .can-toggle input[type=checkbox][disabled]~label { 538 | pointer-events: none 539 | } 540 | 541 | .can-toggle input[type=checkbox][disabled]~label .can-toggle__switch { 542 | opacity: .4 543 | } 544 | 545 | .can-toggle input[type=checkbox]:checked~label .can-toggle__switch:before { 546 | content: attr(data-unchecked); 547 | left: 0 548 | } 549 | 550 | .can-toggle input[type=checkbox]:checked~label .can-toggle__switch:after { 551 | content: attr(data-checked) 552 | } 553 | 554 | .can-toggle label { 555 | -webkit-user-select: none; 556 | -moz-user-select: none; 557 | -ms-user-select: none; 558 | user-select: none; 559 | position: relative; 560 | display: -webkit-box; 561 | display: -ms-flexbox; 562 | display: flex; 563 | -webkit-box-align: center; 564 | -ms-flex-align: center; 565 | align-items: center 566 | } 567 | 568 | .can-toggle label .can-toggle__label-text { 569 | -webkit-box-flex: 1; 570 | -ms-flex: 1; 571 | flex: 1; 572 | padding-left: 32px 573 | } 574 | 575 | .can-toggle label .can-toggle__switch { 576 | position: relative 577 | } 578 | 579 | .can-toggle label .can-toggle__switch:before { 580 | content: attr(data-checked); 581 | position: absolute; 582 | top: 0; 583 | text-transform: uppercase; 584 | text-align: center 585 | } 586 | 587 | .can-toggle label .can-toggle__switch:after { 588 | content: attr(data-unchecked); 589 | position: absolute; 590 | z-index: 5; 591 | text-transform: uppercase; 592 | text-align: center; 593 | background: #fff; 594 | -webkit-transform: translateZ(0); 595 | transform: translateZ(0) 596 | } 597 | 598 | .can-toggle.demo-rebrand-2 { 599 | cursor: pointer 600 | } 601 | 602 | .can-toggle.demo-rebrand-2 input[type=checkbox][disabled]~label { 603 | color: hsla(0, 0%, 53%, .5) 604 | } 605 | 606 | .can-toggle.demo-rebrand-2 input[type=checkbox]:focus~label .can-toggle__switch, 607 | .can-toggle.demo-rebrand-2 input[type=checkbox]:hover~label .can-toggle__switch { 608 | background-color: #888 609 | } 610 | 611 | .can-toggle.demo-rebrand-2 input[type=checkbox]:focus~label .can-toggle__switch:after, 612 | .can-toggle.demo-rebrand-2 input[type=checkbox]:hover~label .can-toggle__switch:after { 613 | color: #6f6f6f 614 | } 615 | 616 | .can-toggle.demo-rebrand-2 input[type=checkbox]:hover~label { 617 | color: #7b7b7b 618 | } 619 | 620 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked~label:hover { 621 | color: #3059e8 622 | } 623 | 624 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked~label .can-toggle__switch { 625 | background-color: #5576ed 626 | } 627 | 628 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked~label .can-toggle__switch:after { 629 | color: #2752e7 630 | } 631 | 632 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked:focus~label .can-toggle__switch, 633 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked:hover~label .can-toggle__switch { 634 | background-color: #3e64ea 635 | } 636 | 637 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked:focus~label .can-toggle__switch:after, 638 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked:hover~label .can-toggle__switch:after { 639 | color: #1844dd 640 | } 641 | 642 | .can-toggle.demo-rebrand-2 label { 643 | font-family: Barlow, sans-serif; 644 | cursor: pointer 645 | } 646 | 647 | .can-toggle.demo-rebrand-2 label .can-toggle__switch { 648 | -webkit-transition: background-color .3s ease; 649 | transition: background-color .3s ease; 650 | background: #959595 651 | } 652 | 653 | .can-toggle.demo-rebrand-2 label .can-toggle__switch:before { 654 | color: hsla(0, 0%, 100%, .7) 655 | } 656 | 657 | .can-toggle.demo-rebrand-2 label .can-toggle__switch:after { 658 | -webkit-transition: -webkit-transform .3s ease; 659 | transition: -webkit-transform .3s ease; 660 | transition: transform .3s ease; 661 | transition: transform .3s ease, -webkit-transform .3s ease; 662 | color: #888 663 | } 664 | 665 | .can-toggle.demo-rebrand-2 input[type=checkbox]:focus~label .can-toggle__switch:after, 666 | .can-toggle.demo-rebrand-2 input[type=checkbox]:hover~label .can-toggle__switch:after { 667 | -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, .2); 668 | box-shadow: 0 2px 4px rgba(0, 0, 0, .2) 669 | } 670 | 671 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked~label .can-toggle__switch:after { 672 | -webkit-transform: translate3d(27px, 0, 0); 673 | transform: translate3d(27px, 0, 0) 674 | } 675 | 676 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked:focus~label .can-toggle__switch:after, 677 | .can-toggle.demo-rebrand-2 input[type=checkbox]:checked:hover~label .can-toggle__switch:after { 678 | -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, .2); 679 | box-shadow: 0 2px 4px rgba(0, 0, 0, .2) 680 | } 681 | 682 | .can-toggle.demo-rebrand-2 label { 683 | font-size: 0 684 | } 685 | 686 | .can-toggle.demo-rebrand-2 label .can-toggle__switch { 687 | height: 30px; 688 | -webkit-box-flex: 0; 689 | -ms-flex: 0 0 60px; 690 | flex: 0 0 60px; 691 | border-radius: 22px 692 | } 693 | 694 | .can-toggle.demo-rebrand-2 label .can-toggle__switch:before { 695 | left: 22px; 696 | font-size: 9px; 697 | line-height: 30px; 698 | width: 30px; 699 | padding: 0 12px 700 | } 701 | 702 | .can-toggle.demo-rebrand-2 label .can-toggle__switch:after { 703 | top: 3px; 704 | left: 3px; 705 | border-radius: 11px; 706 | width: 27px; 707 | line-height: 24px; 708 | font-size: 9px 709 | } 710 | 711 | .can-toggle.demo-rebrand-2 label .can-toggle__switch:hover:after { 712 | -webkit-box-shadow: 0 2px 4px rgba(0, 0, 0, .2); 713 | box-shadow: 0 2px 4px rgba(0, 0, 0, .2) 714 | } 715 | 716 | .sidearea { 717 | padding-bottom: 30px 718 | } 719 | 720 | .item { 721 | border-radius: 5px; 722 | padding: 20px; 723 | background: #fff; 724 | display: -webkit-box; 725 | display: -ms-flexbox; 726 | display: flex; 727 | -webkit-box-orient: vertical; 728 | -webkit-box-direction: normal; 729 | -ms-flex-direction: column; 730 | flex-direction: column; 731 | -webkit-box-pack: center; 732 | -ms-flex-pack: center; 733 | justify-content: center; 734 | -webkit-box-align: center; 735 | -ms-flex-align: center; 736 | align-items: center; 737 | position: relative 738 | } 739 | 740 | .salepill { 741 | background: #e82319; 742 | color: #fff; 743 | font-family: Barlow, sans-serif; 744 | position: absolute; 745 | right: 30px; 746 | top: 60px; 747 | padding: 2px 10px 4px; 748 | text-transform: uppercase; 749 | font-size: 13px; 750 | font-weight: 700; 751 | border-radius: 1000px 752 | } 753 | 754 | p { 755 | font-size: 18px 756 | } 757 | 758 | footer { 759 | display: -webkit-box; 760 | display: -ms-flexbox; 761 | display: flex; 762 | -webkit-box-pack: center; 763 | -ms-flex-pack: center; 764 | justify-content: center; 765 | -webkit-box-align: center; 766 | -ms-flex-align: center; 767 | align-items: center; 768 | padding: 10px; 769 | background: #000; 770 | color: #fff; 771 | text-align: center; 772 | letter-spacing: .03em; 773 | margin-top: 10px; 774 | width: 100%; 775 | height: 50px; 776 | } 777 | 778 | footer a, 779 | footer a:active, 780 | footer a:visited { 781 | color: #fff; 782 | font-weight: 700; 783 | text-decoration: none; 784 | padding-left: 5px; 785 | padding-right: 5px; 786 | } 787 | 788 | /* The dropdown container */ 789 | .cart-dropdown { 790 | float: right; 791 | overflow: hidden; 792 | } 793 | 794 | .cartcount { 795 | font-family: Barlow, sans-serif; 796 | position: absolute; 797 | background: #f21; 798 | color: #fff; 799 | text-align: center; 800 | padding-top: 4px; 801 | width: 20px; 802 | height: 20px; 803 | font-size: 10px; 804 | margin: -5px 0 0 20px; 805 | border-radius: 1000px; 806 | font-weight: 700 807 | } 808 | 809 | .shopping-cart { 810 | width: 750px; 811 | height: auto; 812 | /* margin: 80px auto; */ 813 | background: #FFFFFF; 814 | box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.10); 815 | border-radius: 6px; 816 | display: flex; 817 | flex-direction: column; 818 | } 819 | 820 | .cart-content { 821 | display: none; 822 | position: absolute; 823 | background-color: #f9f9f9; 824 | /* width: 100%; */ 825 | right: 0; 826 | box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); 827 | z-index: 20; 828 | } 829 | 830 | /* Add a red background color to navbar links on hover */ 831 | .cart-dropdown .cart-icon:hover { 832 | fill: red; 833 | box-shadow: 1px 2px 3px 0px rgba(0, 0, 0, 0.10); 834 | } 835 | 836 | /* Show the cart dropdown menu on hover */ 837 | .cart-dropdown:hover .cart-content { 838 | display: block; 839 | } 840 | 841 | .shopping-cart:hover { 842 | display: block; 843 | } 844 | 845 | .shopping-cart .header { 846 | height: 60px; 847 | border-bottom: 1px solid #E1E8EE; 848 | margin: 5px; 849 | padding: 20px 30px; 850 | color: #5E6977; 851 | font-size: 18px; 852 | font-weight: 400; 853 | align-items: center 854 | } 855 | 856 | .checkout { 857 | padding: 0.3em 1.2em; 858 | margin: 0 0.3em 0.3em 0; 859 | font-size: 13px; 860 | font-weight: 600; 861 | background: transparent; 862 | float: right; 863 | border: 2px solid #e82319; 864 | color: #000000; 865 | border-radius: 1000px; 866 | cursor: pointer; 867 | text-align: center; 868 | text-decoration: none; 869 | text-transform: uppercase; 870 | transition: all .15s ease-out; 871 | } 872 | 873 | .checkout:hover { 874 | background-color: #e82319; 875 | color: white; 876 | transition: all .15s ease-in; 877 | } 878 | 879 | .cart-item { 880 | padding: 20px 30px; 881 | height: 120px; 882 | display: flex; 883 | } 884 | 885 | .cart-item:nth-child(3) { 886 | border-top: 1px solid #E1E8EE; 887 | border-bottom: 1px solid #E1E8EE; 888 | } 889 | 890 | .buttons { 891 | position: relative; 892 | padding-top: 30px; 893 | margin-right: 60px; 894 | } 895 | 896 | .delete-btn, 897 | .like-btn { 898 | display: inline-block; 899 | cursor: pointer; 900 | } 901 | 902 | .delete-btn { 903 | width: 18px; 904 | height: 17px; 905 | background: url('/delete-icn.svg') no-repeat center; 906 | } 907 | 908 | .like-btn { 909 | position: absolute; 910 | top: 9px; 911 | left: 15px; 912 | background: url('/twitter-heart.png'); 913 | width: 60px; 914 | height: 60px; 915 | background-size: 2900%; 916 | background-repeat: no-repeat; 917 | } 918 | 919 | .is-active { 920 | animation-name: animate; 921 | animation-duration: .8s; 922 | animation-iteration-count: 1; 923 | animation-timing-function: steps(28); 924 | animation-fill-mode: forwards; 925 | } 926 | 927 | @keyframes animate { 928 | 0% { 929 | background-position: left; 930 | } 931 | 932 | 50% { 933 | background-position: right; 934 | } 935 | 936 | 100% { 937 | background-position: right; 938 | } 939 | } 940 | 941 | .image { 942 | margin-right: 50px; 943 | } 944 | 945 | .image img { 946 | width: 85px; 947 | height: 85px; 948 | } 949 | 950 | .description { 951 | padding-top: 10px; 952 | margin-right: 60px; 953 | width: 115px; 954 | } 955 | 956 | .description span { 957 | display: block; 958 | font-size: 14px; 959 | color: #43484D; 960 | font-weight: 400; 961 | } 962 | 963 | .description span:first-child { 964 | margin-bottom: 5px; 965 | } 966 | 967 | .description span:last-child { 968 | font-weight: 300; 969 | margin-top: 8px; 970 | color: #86939E; 971 | } 972 | 973 | .quantity { 974 | padding-top: 20px; 975 | margin-right: 60px; 976 | } 977 | 978 | .quantity input { 979 | -webkit-appearance: none; 980 | border: none; 981 | text-align: center; 982 | width: 32px; 983 | font-size: 16px; 984 | color: #43484D; 985 | font-weight: 300; 986 | } 987 | 988 | button[class*=btn] { 989 | width: 30px; 990 | height: 30px; 991 | background-color: #E1E8EE; 992 | border-radius: 6px; 993 | border: none; 994 | cursor: pointer; 995 | } 996 | 997 | .minus-btn img { 998 | margin-bottom: 3px; 999 | } 1000 | 1001 | .plus-btn img { 1002 | margin-top: 2px; 1003 | } 1004 | 1005 | button:focus, 1006 | input:focus { 1007 | outline: 0; 1008 | } 1009 | 1010 | .total-price { 1011 | width: 83px; 1012 | padding-top: 27px; 1013 | text-align: center; 1014 | font-size: 16px; 1015 | color: #43484D; 1016 | font-weight: 300; 1017 | } 1018 | 1019 | @media (max-width: 800px) { 1020 | .shopping-cart { 1021 | width: 100%; 1022 | height: auto; 1023 | overflow: hidden; 1024 | } 1025 | 1026 | .item { 1027 | height: auto; 1028 | flex-wrap: wrap; 1029 | justify-content: center; 1030 | } 1031 | 1032 | .image img { 1033 | width: 50%; 1034 | } 1035 | 1036 | .image, 1037 | .quantity, 1038 | .description { 1039 | width: 100%; 1040 | text-align: center; 1041 | margin: 6px 0; 1042 | } 1043 | 1044 | .buttons { 1045 | margin-right: 20px; 1046 | } 1047 | } 1048 | -------------------------------------------------------------------------------- /public/delete-icn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Icon 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/favicon.ico -------------------------------------------------------------------------------- /public/hat1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/hat1.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/jacket1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/jacket1.png -------------------------------------------------------------------------------- /public/jacket2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/jacket2.png -------------------------------------------------------------------------------- /public/jacket3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/jacket3.png -------------------------------------------------------------------------------- /public/jacket4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/jacket4.png -------------------------------------------------------------------------------- /public/minus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Icon 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/mix-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "/js/app.js": "/js/app.js", 3 | "/css/app.css": "/css/app.css" 4 | } 5 | -------------------------------------------------------------------------------- /public/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Icon 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/shirt1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/shirt1.png -------------------------------------------------------------------------------- /public/shirt2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/shirt2.png -------------------------------------------------------------------------------- /public/shoe1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/shoe1.png -------------------------------------------------------------------------------- /public/sweater1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/sweater1.png -------------------------------------------------------------------------------- /public/sweater2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/sweater2.png -------------------------------------------------------------------------------- /public/sweater4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/sweater4.png -------------------------------------------------------------------------------- /public/sweater5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/sweater5.png -------------------------------------------------------------------------------- /public/twitter-heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/webong/livewire-eshop/fa925f5d91bccfb9ac7dc594e1576f35b9e29ce0/public/twitter-heart.png -------------------------------------------------------------------------------- /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/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 emailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/lang/en/validation.php: -------------------------------------------------------------------------------- 1 | 'The :attribute must be accepted.', 17 | 'active_url' => 'The :attribute is not a valid URL.', 18 | 'after' => 'The :attribute must be a date after :date.', 19 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 20 | 'alpha' => 'The :attribute may only contain letters.', 21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.', 22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.', 23 | 'array' => 'The :attribute must be an array.', 24 | 'before' => 'The :attribute must be a date before :date.', 25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.', 26 | 'between' => [ 27 | 'numeric' => 'The :attribute must be between :min and :max.', 28 | 'file' => 'The :attribute must be between :min and :max kilobytes.', 29 | 'string' => 'The :attribute must be between :min and :max characters.', 30 | 'array' => 'The :attribute must have between :min and :max items.', 31 | ], 32 | 'boolean' => 'The :attribute field must be true or false.', 33 | 'confirmed' => 'The :attribute confirmation does not match.', 34 | 'date' => 'The :attribute is not a valid date.', 35 | 'date_equals' => 'The :attribute must be a date equal to :date.', 36 | 'date_format' => 'The :attribute does not match the format :format.', 37 | 'different' => 'The :attribute and :other must be different.', 38 | 'digits' => 'The :attribute must be :digits digits.', 39 | 'digits_between' => 'The :attribute must be between :min and :max digits.', 40 | 'dimensions' => 'The :attribute has invalid image dimensions.', 41 | 'distinct' => 'The :attribute field has a duplicate value.', 42 | 'email' => 'The :attribute must be a valid email address.', 43 | 'ends_with' => 'The :attribute must end with one of the following: :values', 44 | 'exists' => 'The selected :attribute is invalid.', 45 | 'file' => 'The :attribute must be a file.', 46 | 'filled' => 'The :attribute field must have a value.', 47 | 'gt' => [ 48 | 'numeric' => 'The :attribute must be greater than :value.', 49 | 'file' => 'The :attribute must be greater than :value kilobytes.', 50 | 'string' => 'The :attribute must be greater than :value characters.', 51 | 'array' => 'The :attribute must have more than :value items.', 52 | ], 53 | 'gte' => [ 54 | 'numeric' => 'The :attribute must be greater than or equal :value.', 55 | 'file' => 'The :attribute must be greater than or equal :value kilobytes.', 56 | 'string' => 'The :attribute must be greater than or equal :value characters.', 57 | 'array' => 'The :attribute must have :value items or more.', 58 | ], 59 | 'image' => 'The :attribute must be an image.', 60 | 'in' => 'The selected :attribute is invalid.', 61 | 'in_array' => 'The :attribute field does not exist in :other.', 62 | 'integer' => 'The :attribute must be an integer.', 63 | 'ip' => 'The :attribute must be a valid IP address.', 64 | 'ipv4' => 'The :attribute must be a valid IPv4 address.', 65 | 'ipv6' => 'The :attribute must be a valid IPv6 address.', 66 | 'json' => 'The :attribute must be a valid JSON string.', 67 | 'lt' => [ 68 | 'numeric' => 'The :attribute must be less than :value.', 69 | 'file' => 'The :attribute must be less than :value kilobytes.', 70 | 'string' => 'The :attribute must be less than :value characters.', 71 | 'array' => 'The :attribute must have less than :value items.', 72 | ], 73 | 'lte' => [ 74 | 'numeric' => 'The :attribute must be less than or equal :value.', 75 | 'file' => 'The :attribute must be less than or equal :value kilobytes.', 76 | 'string' => 'The :attribute must be less than or equal :value characters.', 77 | 'array' => 'The :attribute must not have more than :value items.', 78 | ], 79 | 'max' => [ 80 | 'numeric' => 'The :attribute may not be greater than :max.', 81 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 82 | 'string' => 'The :attribute may not be greater than :max characters.', 83 | 'array' => 'The :attribute may not have more than :max items.', 84 | ], 85 | 'mimes' => 'The :attribute must be a file of type: :values.', 86 | 'mimetypes' => 'The :attribute must be a file of type: :values.', 87 | 'min' => [ 88 | 'numeric' => 'The :attribute must be at least :min.', 89 | 'file' => 'The :attribute must be at least :min kilobytes.', 90 | 'string' => 'The :attribute must be at least :min characters.', 91 | 'array' => 'The :attribute must have at least :min items.', 92 | ], 93 | 'not_in' => 'The selected :attribute is invalid.', 94 | 'not_regex' => 'The :attribute format is invalid.', 95 | 'numeric' => 'The :attribute must be a number.', 96 | 'present' => 'The :attribute field must be present.', 97 | 'regex' => 'The :attribute format is invalid.', 98 | 'required' => 'The :attribute field is required.', 99 | 'required_if' => 'The :attribute field is required when :other is :value.', 100 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 101 | 'required_with' => 'The :attribute field is required when :values is present.', 102 | 'required_with_all' => 'The :attribute field is required when :values are present.', 103 | 'required_without' => 'The :attribute field is required when :values is not present.', 104 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 105 | 'same' => 'The :attribute and :other must match.', 106 | 'size' => [ 107 | 'numeric' => 'The :attribute must be :size.', 108 | 'file' => 'The :attribute must be :size kilobytes.', 109 | 'string' => 'The :attribute must be :size characters.', 110 | 'array' => 'The :attribute must contain :size items.', 111 | ], 112 | 'starts_with' => 'The :attribute must start with one of the following: :values', 113 | 'string' => 'The :attribute must be a string.', 114 | 'timezone' => 'The :attribute must be a valid zone.', 115 | 'unique' => 'The :attribute has already been taken.', 116 | 'uploaded' => 'The :attribute failed to upload.', 117 | 'url' => 'The :attribute format is invalid.', 118 | 'uuid' => 'The :attribute must be a valid UUID.', 119 | 120 | /* 121 | |-------------------------------------------------------------------------- 122 | | Custom Validation Language Lines 123 | |-------------------------------------------------------------------------- 124 | | 125 | | Here you may specify custom validation messages for attributes using the 126 | | convention "attribute.rule" to name the lines. This makes it quick to 127 | | specify a specific custom language line for a given attribute rule. 128 | | 129 | */ 130 | 131 | 'custom' => [ 132 | 'attribute-name' => [ 133 | 'rule-name' => 'custom-message', 134 | ], 135 | ], 136 | 137 | /* 138 | |-------------------------------------------------------------------------- 139 | | Custom Validation Attributes 140 | |-------------------------------------------------------------------------- 141 | | 142 | | The following language lines are used to swap our attribute placeholder 143 | | with something more reader friendly such as "E-Mail Address" instead 144 | | of "email". This simply helps us make our message more expressive. 145 | | 146 | */ 147 | 148 | 'attributes' => [], 149 | 150 | ]; 151 | -------------------------------------------------------------------------------- /resources/sass/_tailwind.scss: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | 3 | @tailwind components; 4 | 5 | @tailwind utilities; -------------------------------------------------------------------------------- /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 | 10 | // Tailwind 11 | @import 'tailwind'; 12 | -------------------------------------------------------------------------------- /resources/views/inc/masthead.blade.php: -------------------------------------------------------------------------------- 1 |
2 | Banner Image 3 | 5 | 8 | 11 | 14 | 15 | 18 | 21 | 24 | 27 | 30 | 33 | 36 | 39 | 40 |

Shoppity

41 |
-------------------------------------------------------------------------------- /resources/views/index.blade.php: -------------------------------------------------------------------------------- 1 | @extends('layouts.app') 2 | 3 | @section('content') 4 | @livewire('store') 5 | @endsection -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ config('app.name', 'LiveWire Shop') }} 11 | 12 | 13 | 14 | 15 | 16 | @livewireStyles 17 | 18 | 19 | 20 |
21 |
22 | 25 |
26 | @include('inc.masthead') 27 |
28 | @yield('content') 29 |
30 |
31 | 32 |
33 |
34 |
35 | @include('layouts.partials.footer') 36 |
37 | 38 | @livewireScripts 39 | 40 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /resources/views/layouts/partials/footer.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/layouts/partials/nav.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/livewire/cart.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
{{ $cartCount }}
3 | 5 | 6 | Shopping Cart 7 | 8 | 10 | 11 | 12 | @if($cartCount > 0) 13 |
14 |
15 | 16 |
17 | Total: ₦{{ $cartTotal }} 18 | 19 |
20 | 21 | 22 | @foreach($cartItems as $item) 23 |
24 |
25 | 26 | {{-- --}} 27 |
28 | 29 |
30 | 31 |
32 | 33 |
34 | {{ $item->name }} 35 | {{ $item->options->article }} 36 | {{ $item->options->category}} 37 |
38 | 39 |
40 | 43 | 44 | 47 |
48 | 49 |
₦{{ $item->total }}
50 |
51 | @endforeach 52 |
53 |
54 | @endif 55 |
-------------------------------------------------------------------------------- /resources/views/livewire/item.blade.php: -------------------------------------------------------------------------------- 1 |
2 |

{{ $item->name }}

3 | @if($item->sale) 4 | Sale 5 | @endif 6 | Image of {{$item->name}} 7 |

₦{{$item->price}}

8 | @isset($rowId) 9 | 10 | @else 11 | 12 | @endisset 13 |
-------------------------------------------------------------------------------- /resources/views/livewire/sidebar.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/livewire/store.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @livewire('sidebar') 3 |
4 | @foreach ($items as $item) 5 | @livewire('item', ['item' => $item], key($item->id)) 6 | @endforeach 7 |
8 |
9 | -------------------------------------------------------------------------------- /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/api.php: -------------------------------------------------------------------------------- 1 | get('/user', function (Request $request) { 19 | return $request->user(); 20 | }); 21 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /routes/web.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/debugbar/.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 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | theme: { 3 | extend: { 4 | } 5 | }, 6 | variants: {}, 7 | plugins: [], 8 | prefix: 'tw-', 9 | } -------------------------------------------------------------------------------- /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 | const tailwindcss = require('tailwindcss'); 3 | 4 | /* 5 | |-------------------------------------------------------------------------- 6 | | Mix Asset Management 7 | |-------------------------------------------------------------------------- 8 | | 9 | | Mix provides a clean, fluent API for defining some Webpack build steps 10 | | for your Laravel application. By default, we are compiling the Sass 11 | | file for the application as well as bundling up all the JS files. 12 | | 13 | */ 14 | 15 | mix.js('resources/js/app.js', 'public/js') 16 | .sass('resources/sass/app.scss', 'public/css') 17 | .options({ 18 | processCssUrls: false, 19 | postCss: [tailwindcss('./tailwind.config.js')], 20 | }); 21 | --------------------------------------------------------------------------------