13 | {{ __('A fresh verification link has been sent to your email address.') }}
14 |
15 | @endif
16 |
17 | {{ __('Before proceeding, please check your email for a verification link.') }}
18 | {{ __('If you did not receive the email') }}, {{ __('click here to request another') }}.
19 |
20 |
21 |
22 |
23 |
24 | @endsection
25 |
--------------------------------------------------------------------------------
/app/Http/Requests/User/SaveDeliveryAddressRequest.php:
--------------------------------------------------------------------------------
1 | 'nullable|string|max:255',
28 | 'address_2' => 'nullable|string|max:255',
29 | 'city' => 'nullable|string|max:255',
30 | 'postcode' => 'nullable|max:255',
31 | 'country' => 'nullable|string|max:255',
32 | 'state' => 'nullable|string|max:255',
33 | 'additional_instruction' => 'nullable|string|max:1000'
34 | ];
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/Http/Resources/Order/OrderResource.php:
--------------------------------------------------------------------------------
1 | $this->id,
20 | 'parent_id' => $this->parent_id,
21 | 'customer_id' => $this->customer_id,
22 | 'number' => $this->number,
23 | 'order_key' => $this->order_key,
24 | 'status' => $this->status,
25 | 'currency' => $this->currency,
26 | 'date_created' => $this->date_created,
27 | 'total' => $this->total,
28 | 'billing' => $this->billing,
29 | 'shipping' => $this->shipping,
30 | 'payment_method' => $this->payment_method
31 | ];
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/Http/Requests/User/SaveBillingAddressRequest.php:
--------------------------------------------------------------------------------
1 | 'string|max:255',
28 | 'last_name' => 'string|max:255',
29 | 'company' => 'string|max:255',
30 | 'address_1' => 'string|max:255',
31 | 'address_2' => 'nullable|string|max:255',
32 | 'city' => 'string|max:255',
33 | 'postcode' => 'max:255',
34 | 'country' => 'string|max:255',
35 | 'state' => 'string|max:255',
36 | 'phone' => 'string|max:255'
37 | ];
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/v1/Category/CategoryController.php:
--------------------------------------------------------------------------------
1 | service = $service;
21 | }
22 |
23 |
24 | /**
25 | * @return mixed
26 | */
27 | public function getList()
28 | {
29 | $parameters = [
30 | 'page' => $data['page'] ?? 1,
31 | 'per_page' => $data['per_page'] ?? 10,
32 | 'order' => $data['order'] ?? 'asc',
33 | 'orderby' => $data['orderby'] ?? 'name',
34 | 'exclude' => [16, 38]
35 | ];
36 |
37 | $categories = $this->service->get('products/categories', $parameters);
38 |
39 | return response()->Success(new CategoryCollection($categories['data']));
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "private": true,
3 | "scripts": {
4 | "dev": "npm run development",
5 | "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
6 | "watch": "npm run development -- --watch",
7 | "watch-poll": "npm run watch -- --watch-poll",
8 | "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
9 | "prod": "npm run production",
10 | "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
11 | },
12 | "devDependencies": {
13 | "axios": "^0.18",
14 | "bootstrap": "^4.0.0",
15 | "cross-env": "^5.1",
16 | "jquery": "^3.2",
17 | "laravel-mix": "^4.0.7",
18 | "lodash": "^4.17.5",
19 | "popper.js": "^1.12",
20 | "resolve-url-loader": "^2.3.1",
21 | "sass": "^1.15.2",
22 | "sass-loader": "^7.1.0",
23 | "vue": "^2.5.17"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/resources/js/app.js:
--------------------------------------------------------------------------------
1 |
2 | /**
3 | * First we will load all of this project's JavaScript dependencies which
4 | * includes Vue and other libraries. It is a great starting point when
5 | * building robust, powerful web applications using Vue and Laravel.
6 | */
7 |
8 | require('./bootstrap');
9 |
10 | window.Vue = require('vue');
11 |
12 | /**
13 | * The following block of code may be used to automatically register your
14 | * Vue components. It will recursively scan this directory for the Vue
15 | * components and automatically register them with their "basename".
16 | *
17 | * Eg. ./components/ExampleComponent.vue ->
18 | */
19 |
20 | // const files = require.context('./', true, /\.vue$/i)
21 | // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
22 |
23 | Vue.component('example-component', require('./components/ExampleComponent.vue').default);
24 |
25 | /**
26 | * Next, we will create a fresh Vue application instance and attach it to
27 | * the page. Then, you may begin adding components to this application
28 | * or customize the JavaScript scaffolding to fit your unique needs.
29 | */
30 |
31 | const app = new Vue({
32 | el: '#app'
33 | });
34 |
--------------------------------------------------------------------------------
/app/Providers/AppServiceProvider.php:
--------------------------------------------------------------------------------
1 | true,
19 | 'data' => $data
20 | ];
21 |
22 | return \Response::make($content, $status, $headers);
23 | });
24 |
25 | \Response::macro('Error', function ($data = null, $status = 400, $headers = []) {
26 | $content = [
27 | 'success' => false,
28 | 'error' => [
29 | 'code' => $status,
30 | 'message' => $data
31 | ]
32 | ];
33 |
34 | return \Response::make($content, $status, $headers);
35 | });
36 | }
37 |
38 | /**
39 | * Register any application services.
40 | *
41 | * @return void
42 | */
43 | public function register()
44 | {
45 |
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/Providers/AuthServiceProvider.php:
--------------------------------------------------------------------------------
1 | UserPolicy::class
19 | ];
20 |
21 | /**
22 | * Register any authentication / authorization services.
23 | *
24 | * @return void
25 | */
26 | public function boot()
27 | {
28 |
29 | $this->registerPolicies();
30 |
31 | Passport::tokensExpireIn(Carbon::now()->addDays(30));
32 | Passport::refreshTokensExpireIn(Carbon::now()->addDays(35));
33 | Passport::personalAccessTokensExpireIn(Carbon::now()->addDays(30));
34 |
35 | Passport::routes(function (RouteRegistrar $routeRegistrar) {
36 | $routeRegistrar->forAccessTokens();
37 | $routeRegistrar->forTransientTokens();
38 | }, [
39 | 'prefix' => 'api/mobile/v1'
40 | ]);
41 |
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/services.php:
--------------------------------------------------------------------------------
1 | [
18 | 'domain' => env('MAILGUN_DOMAIN'),
19 | 'secret' => env('MAILGUN_SECRET'),
20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
21 | ],
22 |
23 | 'ses' => [
24 | 'key' => env('SES_KEY'),
25 | 'secret' => env('SES_SECRET'),
26 | 'region' => env('SES_REGION', 'us-east-1'),
27 | ],
28 |
29 | 'sparkpost' => [
30 | 'secret' => env('SPARKPOST_SECRET'),
31 | ],
32 |
33 | 'stripe' => [
34 | 'model' => App\User::class,
35 | 'key' => env('STRIPE_KEY'),
36 | 'secret' => env('STRIPE_SECRET'),
37 | 'webhook' => [
38 | 'secret' => env('STRIPE_WEBHOOK_SECRET'),
39 | 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300),
40 | ],
41 | ],
42 |
43 | ];
44 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Api/v1/Order/OrderController.php:
--------------------------------------------------------------------------------
1 | service = $service;
23 | }
24 |
25 |
26 | /**
27 | * @param Request $request
28 | *
29 | * @return mixed
30 | */
31 | public function getOrders(Request $request)
32 | {
33 | $data = $request->all();
34 |
35 | $orders = $this->service->get('orders',
36 | [
37 | 'customer' => Auth::user()->ID,
38 | 'page' => $data['page'] ?? 1,
39 | 'per_page' => $data['per_page'] ?? 10,
40 | 'order' => $data['order'] ?? 'desc',
41 | 'orderby' => $data['orderby'] ?? 'date',
42 | 'status' => $data['status'] ?? 'any',
43 | 'search' => $data['search_string'] ?? ''
44 | ]);
45 |
46 | return response()->Success(new OrderCollection($orders['data']));
47 | }
48 | }
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | APP_NAME=Laravel
2 | APP_ENV=local
3 | APP_KEY=base64:wzHgierz1ALoUih7EwhHn7+NvfYmScOVkTo/7XMPRSY=
4 | APP_DEBUG=true
5 | APP_URL=https://haze420appdev.loc
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_haze420appdev
13 | DB_USERNAME=homestead
14 | DB_PASSWORD=secret
15 |
16 | #SERVER CONNECTION WORDPRESS DB
17 | WP_DB_HOST=77.104.132.139
18 | WP_DB_PORT=3306
19 | WP_DB_DATABASE=haze4209_wp3e8b
20 | WP_DB_USERNAME=haze4209_test
21 | WP_DB_PASSWORD=T,-f*T-,(155
22 | WP_DB_PREFIX=wpc6_
23 | WP_DB_SOCKET=
24 |
25 | #SERVER CONNECTION Woocommerce REST Api
26 | WP_WC_DOMAIN=www.haze420.co.uk
27 | WP_WC_URL=https://www.haze420.co.uk
28 | WP_WC_CONSUMER_KEY=ck_0f6cc5aeab1499b6815871a80700a5ccce3c55bb
29 | WP_WC_CONSUMER_SECRET=cs_36e0dde1d65bf5c3fa35e01f30a475a65a0e6cfb
30 |
31 | RESPONSE_CACHE_ENABLED=false
32 | RESPONSE_CACHE_LIFETIME=60*24*7
33 | RESPONSE_CACHE_DRIVER=file
34 |
35 | BROADCAST_DRIVER=log
36 | CACHE_DRIVER=file
37 | QUEUE_CONNECTION=sync
38 | SESSION_DRIVER=file
39 | SESSION_LIFETIME=12000
40 |
41 | REDIS_HOST=127.0.0.1
42 | REDIS_PASSWORD=null
43 | REDIS_PORT=6379
44 |
45 | MAIL_DRIVER=smtp
46 | MAIL_HOST=smtp.mailtrap.io
47 | MAIL_PORT=2525
48 | MAIL_USERNAME=6286e2a7185c7e
49 | MAIL_PASSWORD=2b53aa3a45fa9a
50 | MAIL_ENCRYPTION=tls
51 |
52 | PUSHER_APP_ID=
53 | PUSHER_APP_KEY=
54 | PUSHER_APP_SECRET=
55 | PUSHER_APP_CLUSTER=mt1
56 |
57 | MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
58 | MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
59 |
--------------------------------------------------------------------------------
/config/responsecache.php:
--------------------------------------------------------------------------------
1 | env('RESPONSE_CACHE_ENABLED', true),
8 |
9 | /*
10 | * The given class will determinate if a request should be cached. The
11 | * default class will cache all successful GET-requests.
12 | *
13 | * You can provide your own class given that it implements the
14 | * CacheProfile interface.
15 | */
16 | 'cache_profile' => \App\Models\Cache\CacheProfile::class,
17 |
18 | /*
19 | * When using the default CacheRequestFilter this setting controls the
20 | * default number of minutes responses must be cached.
21 | */
22 | 'cache_lifetime_in_minutes' => env('RESPONSE_CACHE_LIFETIME', 60 * 24 * 7),
23 |
24 | /*
25 | * This setting determines if a http header named "Laravel-responsecache"
26 | * with the cache time should be added to a cached response. This
27 | * can be handy when debugging.
28 | */
29 | 'add_cache_time_header' => env('APP_DEBUG', true),
30 |
31 | /*
32 | * Here you may define the cache store that should be used to store
33 | * requests. This can be the name of any store that is
34 | * configured in app/config/cache.php
35 | */
36 | 'cache_store' => env('RESPONSE_CACHE_DRIVER', 'file'),
37 |
38 | /*
39 | * If the cache driver you configured supports tags, you may specify a tag name
40 | * here. All responses will be tagged. When clearing the responsecache only
41 | * items with that tag will be flushed.
42 | *
43 | * You may use a string or an array here.
44 | */
45 | 'cache_tag' => '',
46 | ];
47 |
--------------------------------------------------------------------------------
/app/Http/Resources/Product/ProductResource.php:
--------------------------------------------------------------------------------
1 | images);
20 |
21 | return [
22 | 'id' => $this->id,
23 | 'categories' => $this->categories,
24 | 'name' => $this->name,
25 | 'slug' => $this->slug,
26 | 'permalink' => $this->permalink,
27 | 'description' => $this->description,
28 | 'thumbnail_image' => $images->first()->woocommerce_gallery_thumbnail,
29 | 'images' => new ProductImageCollection($images),
30 | 'weight' => $this->weight,
31 | 'price' => $this->price,
32 | 'regular_price' => $this->regular_price,
33 | 'sale_price' => $this->sale_price,
34 | "average_rating" => $this->average_rating,
35 | "rating_count" => $this->rating_count,
36 | 'attributes' => [
37 | 'weight' => collect($this->attributes)
38 | ->where('name', 'Weight')->first()->options,
39 | 'thc_level' => collect($this->attributes)
40 | ->where('name', 'THC')->first()->options
41 | ]
42 | ];
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/broadcasting.php:
--------------------------------------------------------------------------------
1 | env('BROADCAST_DRIVER', 'null'),
19 |
20 | /*
21 | |--------------------------------------------------------------------------
22 | | Broadcast Connections
23 | |--------------------------------------------------------------------------
24 | |
25 | | Here you may define all of the broadcast connections that will be used
26 | | to broadcast events to other systems or over websockets. Samples of
27 | | each available type of connection are provided inside this array.
28 | |
29 | */
30 |
31 | 'connections' => [
32 |
33 | 'pusher' => [
34 | 'driver' => 'pusher',
35 | 'key' => env('PUSHER_APP_KEY'),
36 | 'secret' => env('PUSHER_APP_SECRET'),
37 | 'app_id' => env('PUSHER_APP_ID'),
38 | 'options' => [
39 | 'cluster' => env('PUSHER_APP_CLUSTER'),
40 | 'encrypted' => true,
41 | ],
42 | ],
43 |
44 | 'redis' => [
45 | 'driver' => 'redis',
46 | 'connection' => 'default',
47 | ],
48 |
49 | 'log' => [
50 | 'driver' => 'log',
51 | ],
52 |
53 | 'null' => [
54 | 'driver' => 'null',
55 | ],
56 |
57 | ],
58 |
59 | ];
60 |
--------------------------------------------------------------------------------
/app/Exceptions/Handler.php:
--------------------------------------------------------------------------------
1 | expectsJson()
50 | ? response()->Error($exception->getMessage())
51 | : redirect()->guest(route('login'));
52 | }
53 |
54 | /**
55 | * Render an exception into an HTTP response.
56 | *
57 | * @param \Illuminate\Http\Request $request
58 | * @param \Exception $exception
59 | * @return \Illuminate\Http\Response
60 | */
61 | public function render($request, Exception $exception)
62 | {
63 | return parent::render($request, $exception);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/storage/api-docs/api-docs.json:
--------------------------------------------------------------------------------
1 | {
2 | "swagger": "2.0",
3 | "info": {
4 | "title": "Core API",
5 | "version": "1.0.0"
6 | },
7 | "basePath": "/api",
8 | "paths": {
9 | "/mobile/v1/user/login": {
10 | "post": {
11 | "tags": [
12 | "Users"
13 | ],
14 | "summary": "User login",
15 | "description": "Returns user token",
16 | "operationId": "getTokenByLoginAndPassword",
17 | "parameters": [
18 | {
19 | "name": "email",
20 | "in": "path",
21 | "description": "User Email",
22 | "required": true,
23 | "type": "string"
24 | },
25 | {
26 | "name": "password",
27 | "in": "path",
28 | "description": "User Password",
29 | "required": true,
30 | "type": "string"
31 | }
32 | ],
33 | "responses": {
34 | "200": {
35 | "description": "successful operation"
36 | },
37 | "400": {
38 | "description": "Bad request"
39 | },
40 | "404": {
41 | "description": "Resource Not Found"
42 | }
43 | },
44 | "security": [
45 | {
46 | "oauth2_security_example": [
47 | "write:projects",
48 | "read:projects"
49 | ]
50 | }
51 | ]
52 | }
53 | }
54 | },
55 | "definitions": {}
56 | }
--------------------------------------------------------------------------------
/resources/js/bootstrap.js:
--------------------------------------------------------------------------------
1 |
2 | window._ = require('lodash');
3 |
4 | /**
5 | * We'll load jQuery and the Bootstrap jQuery plugin which provides support
6 | * for JavaScript based Bootstrap features such as modals and tabs. This
7 | * code may be modified to fit the specific needs of your application.
8 | */
9 |
10 | try {
11 | window.Popper = require('popper.js').default;
12 | window.$ = window.jQuery = require('jquery');
13 |
14 | require('bootstrap');
15 | } catch (e) {}
16 |
17 | /**
18 | * We'll load the axios HTTP library which allows us to easily issue requests
19 | * to our Laravel back-end. This library automatically handles sending the
20 | * CSRF token as a header based on the value of the "XSRF" token cookie.
21 | */
22 |
23 | window.axios = require('axios');
24 |
25 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
26 |
27 | /**
28 | * Next we will register the CSRF Token as a common header with Axios so that
29 | * all outgoing HTTP requests automatically have it attached. This is just
30 | * a simple convenience so we don't have to attach every token manually.
31 | */
32 |
33 | let token = document.head.querySelector('meta[name="csrf-token"]');
34 |
35 | if (token) {
36 | window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
37 | } else {
38 | console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
39 | }
40 |
41 | /**
42 | * Echo exposes an expressive API for subscribing to channels and listening
43 | * for events that are broadcast by Laravel. Echo and event broadcasting
44 | * allows your team to easily build robust real-time web applications.
45 | */
46 |
47 | // import Echo from 'laravel-echo'
48 |
49 | // window.Pusher = require('pusher-js');
50 |
51 | // window.Echo = new Echo({
52 | // broadcaster: 'pusher',
53 | // key: process.env.MIX_PUSHER_APP_KEY,
54 | // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
55 | // encrypted: true
56 | // });
57 |
--------------------------------------------------------------------------------
/app/Http/Controllers/HomeController.php:
--------------------------------------------------------------------------------
1 | service = $service;
17 | // $this->client = new Client([
18 | // 'base_uri' => config('wordpress.WP_WC_URL')
19 | // . '/wp-json/wc/v2/cart/',
20 | // 'Accept' => 'application/json',
21 | // 'cookies' => true
22 | // ]);
23 | }
24 |
25 | /**
26 | * Show the application dashboard.
27 | *
28 | * @return \Illuminate\Contracts\Support\Renderable
29 | */
30 | public function index()
31 | {
32 | return $this->service->post('add', [
33 | 'product_id' => 1461,
34 | 'quantity' => 100
35 | ]);
36 |
37 | // $value = Cache::get('key');
38 | // $expiresAt = now()->addMinutes(10);
39 |
40 | // Cache::put('key', 'value', $expiresAt);
41 |
42 | // return dd($this->service->post('products/reviews',
43 | // [
44 | // 'product_id' => 10,
45 | // 'review' => 10,
46 | // 'reviewer' => 10,
47 | // 'reviewer_email' => 10,
48 | // 'rating' => 10
49 | // ]));
50 | $response = $this->service->get();
51 |
52 | return $response;
53 | }
54 |
55 | public function get() {
56 |
57 | // $cookieJar = CookieJar::fromArray(Cookie::get(), 'haze420.co.uk');
58 | //
59 | // $product = $this->client->request('GET', '', ['cookies' => $cookieJar]);
60 | //
61 | // dd(json_decode($product->getBody()->getContents()));
62 | //
63 | // return response()->json([]);
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app/Http/Resources/User/UserResource.php:
--------------------------------------------------------------------------------
1 | $this->ID,
20 | 'user_email' => $this->user_email,
21 | 'first_name' => $this->first_name,
22 | 'last_name' => $this->last_name,
23 | 'birthday' => $this->meta->description,
24 | "phone" => $this->meta->phone,
25 | 'avatar' => 'https:' . $this->avatar,
26 | 'billing_address' => [
27 | 'first_name' => $this->meta->billing_first_name,
28 | 'last_name' => $this->meta->billing_last_name,
29 | 'address_1' => $this->meta->billing_address_1,
30 | 'address_2' => $this->meta->billing_address_2,
31 | 'city' => $this->meta->billing_city,
32 | 'postcode' => $this->meta->billing_postcode,
33 | 'country' => $this->meta->billing_country,
34 | 'state' => $this->meta->billing_state,
35 | 'phone' => $this->meta->billing_phone,
36 | ],
37 | 'delivery_address' => [
38 | 'address_1' => $this->meta->shipping_address_1,
39 | 'address_2' => $this->meta->shipping_address_2,
40 | 'city' => $this->meta->shipping_city,
41 | 'postcode' => $this->meta->shipping_postcode,
42 | 'country' => $this->meta->shipping_country,
43 | 'state' => $this->meta->shipping_state,
44 | 'additional_instruction' => $this->meta->shipping_additional_instruction
45 | ]
46 | ];
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/resources/views/auth/passwords/email.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 |
3 | @section('content')
4 |
73 | @endsection
74 |
--------------------------------------------------------------------------------
/config/auth.php:
--------------------------------------------------------------------------------
1 | [
17 | 'guard' => 'web',
18 | 'passwords' => 'users',
19 | ],
20 |
21 | /*
22 | |--------------------------------------------------------------------------
23 | | Authentication Guards
24 | |--------------------------------------------------------------------------
25 | |
26 | | Next, you may define every authentication guard for your application.
27 | | Of course, a great default configuration has been defined for you
28 | | here which uses session storage and the Eloquent user provider.
29 | |
30 | | All authentication drivers have a user provider. This defines how the
31 | | users are actually retrieved out of your database or other storage
32 | | mechanisms used by this application to persist your user's data.
33 | |
34 | | Supported: "session", "token"
35 | |
36 | */
37 |
38 | 'guards' => [
39 | 'web' => [
40 | 'driver' => 'session',
41 | 'provider' => 'users',
42 | ],
43 |
44 | 'api' => [
45 | 'driver' => 'passport',
46 | 'provider' => 'users',
47 | ],
48 | ],
49 |
50 | /*
51 | |--------------------------------------------------------------------------
52 | | UserOld Providers
53 | |--------------------------------------------------------------------------
54 | |
55 | | All authentication drivers have a user provider. This defines how the
56 | | users are actually retrieved out of your database or other storage
57 | | mechanisms used by this application to persist your user's data.
58 | |
59 | | If you have multiple user tables or models you may configure multiple
60 | | sources which represent each model / table. These sources may then
61 | | be assigned to any extra authentication guards you have defined.
62 | |
63 | | Supported: "database", "eloquent"
64 | |
65 | */
66 |
67 | 'providers' => [
68 | 'users' => [
69 | 'driver' => 'corcel',
70 | 'model' => \App\Models\User::class,
71 | ],
72 |
73 | // 'users' => [
74 | // 'driver' => 'database',
75 | // 'table' => 'users',
76 | // ],
77 | ],
78 |
79 | /*
80 | |--------------------------------------------------------------------------
81 | | Resetting Passwords
82 | |--------------------------------------------------------------------------
83 | |
84 | | You may specify multiple password reset configurations if you have more
85 | | than one user table or model in the application and you want to have
86 | | separate password reset settings based on the specific user types.
87 | |
88 | | The expire time is the number of minutes that the reset token should be
89 | | considered valid. This security feature keeps tokens short-lived so
90 | | they have less time to be guessed. You may change this as needed.
91 | |
92 | */
93 |
94 | 'passwords' => [
95 | 'users' => [
96 | 'provider' => 'users',
97 | 'table' => 'password_resets',
98 | 'expire' => 60,
99 | ],
100 | ],
101 |
102 | ];
103 |
--------------------------------------------------------------------------------
/resources/views/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{ config('app.name', 'Laravel') }}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |