summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiel Schuurmans <michielschuurmans@gmail.com>2020-10-01 20:10:49 +0200
committerMichiel Schuurmans <michielschuurmans@gmail.com>2020-10-01 20:10:49 +0200
commit70374ba862eb87c66f1e0d3afd4aedb416b33e9d (patch)
treeb1776ff243278adab3e724fb6c3606ce32b22de6
Base commit
Signed-off-by: Michiel Schuurmans <michielschuurmans@gmail.com>
-rw-r--r--.gitignore81
-rw-r--r--src/products/.editorconfig15
-rw-r--r--src/products/.env.example19
-rw-r--r--src/products/.gitignore6
-rw-r--r--src/products/.styleci.yml6
-rw-r--r--src/products/README.md24
-rw-r--r--src/products/app/Console/Commands/.gitkeep0
-rw-r--r--src/products/app/Console/Kernel.php29
-rw-r--r--src/products/app/Events/Event.php10
-rw-r--r--src/products/app/Events/ExampleEvent.php16
-rw-r--r--src/products/app/Exceptions/Handler.php54
-rw-r--r--src/products/app/Http/Controllers/Controller.php10
-rw-r--r--src/products/app/Http/Controllers/ExampleController.php18
-rw-r--r--src/products/app/Http/Middleware/Authenticate.php44
-rw-r--r--src/products/app/Http/Middleware/ExampleMiddleware.php20
-rw-r--r--src/products/app/Jobs/ExampleJob.php26
-rw-r--r--src/products/app/Jobs/Job.php24
-rw-r--r--src/products/app/Listeners/ExampleListener.php31
-rw-r--r--src/products/app/Models/User.php33
-rw-r--r--src/products/app/Providers/AppServiceProvider.php18
-rw-r--r--src/products/app/Providers/AuthServiceProvider.php39
-rw-r--r--src/products/app/Providers/EventServiceProvider.php19
-rwxr-xr-xsrc/products/artisan35
-rw-r--r--src/products/bootstrap/app.php115
-rw-r--r--src/products/composer.json40
-rw-r--r--src/products/database/factories/UserFactory.php29
-rw-r--r--src/products/database/migrations/.gitkeep0
-rw-r--r--src/products/database/seeders/DatabaseSeeder.php18
-rw-r--r--src/products/phpunit.xml17
-rw-r--r--src/products/public/.htaccess21
-rw-r--r--src/products/public/index.php28
-rw-r--r--src/products/resources/views/.gitkeep0
-rw-r--r--src/products/routes/web.php18
-rw-r--r--src/products/storage/app/.gitignore2
-rw-r--r--src/products/storage/framework/cache/.gitignore3
-rw-r--r--src/products/storage/framework/cache/data/.gitignore2
-rw-r--r--src/products/storage/framework/views/.gitignore2
-rw-r--r--src/products/storage/logs/.gitignore2
-rw-r--r--src/products/tests/ExampleTest.php21
-rw-r--r--src/products/tests/TestCase.php16
40 files changed, 911 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..d0acf33
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,81 @@
+# ignore log files and databases
+*.log
+*.sql
+*.sqlite# ignore compiled files
+*.com
+*.class
+*.dll
+*.exe
+*.o
+*.so# ignore packaged files
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip# ignore OS generated files
+ehthumbs.db
+Thumbs.db
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes# ignore Editor files
+*.sublime-project
+*.sublime-workspace
+*.komodoproject
+_ide_helper.php
+/.idea
+/.vscode
+# Eclipse project files
+.buildpath
+.project
+.settings/# Ignore cache
+.cache/# Ignore user created files :)
+*.bak
+*.orig# Ignore system files
+.bash_history
+LICENSE_AFL.txt
+LICENSE.html
+LICENSE.txt
+LICENSE_EE*
+RELEASE_NOTES.txt
+.ssh/
+error_log
+.htpasswds
+/.htaccess
+php.ini.sample
+.modgit/
+_vti_bin/
+_vti_cnf/
+_vti_inf.html
+_vti_log/
+_vti_pvt/
+_vti_txt/
+tmp/
+php.ini
+_old/
+.htpasswds/
+.htpasswd
+.viminfo
+.profile
+.bashrc
+.bash_logout
+.bash_history
+.modgit/
+.modman/
+pkginfo
+nohup.out
+Homestead.yaml
+Homestead.json
+/.vagrant
+.phpunit.result.cache#Laravel Specific files
+/vendor
+.env
+/public/.htaccess
+/storage
+storage/*.key
+
+*.sw*
diff --git a/src/products/.editorconfig b/src/products/.editorconfig
new file mode 100644
index 0000000..6537ca4
--- /dev/null
+++ b/src/products/.editorconfig
@@ -0,0 +1,15 @@
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
+
+[*.md]
+trim_trailing_whitespace = false
+
+[*.{yml,yaml}]
+indent_size = 2
diff --git a/src/products/.env.example b/src/products/.env.example
new file mode 100644
index 0000000..7719445
--- /dev/null
+++ b/src/products/.env.example
@@ -0,0 +1,19 @@
+APP_NAME=Lumen
+APP_ENV=local
+APP_KEY=
+APP_DEBUG=true
+APP_URL=http://localhost
+APP_TIMEZONE=UTC
+
+LOG_CHANNEL=stack
+LOG_SLACK_WEBHOOK_URL=
+
+DB_CONNECTION=mysql
+DB_HOST=127.0.0.1
+DB_PORT=3306
+DB_DATABASE=homestead
+DB_USERNAME=homestead
+DB_PASSWORD=secret
+
+CACHE_DRIVER=file
+QUEUE_CONNECTION=sync
diff --git a/src/products/.gitignore b/src/products/.gitignore
new file mode 100644
index 0000000..2896e86
--- /dev/null
+++ b/src/products/.gitignore
@@ -0,0 +1,6 @@
+/vendor
+/.idea
+Homestead.json
+Homestead.yaml
+.env
+.phpunit.result.cache
diff --git a/src/products/.styleci.yml b/src/products/.styleci.yml
new file mode 100644
index 0000000..8980121
--- /dev/null
+++ b/src/products/.styleci.yml
@@ -0,0 +1,6 @@
+php:
+ preset: laravel
+ disabled:
+ - unused_use
+js: true
+css: true
diff --git a/src/products/README.md b/src/products/README.md
new file mode 100644
index 0000000..ac75ed6
--- /dev/null
+++ b/src/products/README.md
@@ -0,0 +1,24 @@
+# Lumen PHP Framework
+
+[![Build Status](https://travis-ci.org/laravel/lumen-framework.svg)](https://travis-ci.org/laravel/lumen-framework)
+[![Total Downloads](https://poser.pugx.org/laravel/lumen-framework/d/total.svg)](https://packagist.org/packages/laravel/lumen-framework)
+[![Latest Stable Version](https://poser.pugx.org/laravel/lumen-framework/v/stable.svg)](https://packagist.org/packages/laravel/lumen-framework)
+[![License](https://poser.pugx.org/laravel/lumen-framework/license.svg)](https://packagist.org/packages/laravel/lumen-framework)
+
+Laravel Lumen is a stunningly fast PHP micro-framework for building web applications with expressive, elegant syntax. We believe development must be an enjoyable, creative experience to be truly fulfilling. Lumen attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as routing, database abstraction, queueing, and caching.
+
+## Official Documentation
+
+Documentation for the framework can be found on the [Lumen website](https://lumen.laravel.com/docs).
+
+## Contributing
+
+Thank you for considering contributing to Lumen! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
+
+## Security Vulnerabilities
+
+If you discover a security vulnerability within Lumen, please send an e-mail to Taylor Otwell at taylor@laravel.com. All security vulnerabilities will be promptly addressed.
+
+## License
+
+The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
diff --git a/src/products/app/Console/Commands/.gitkeep b/src/products/app/Console/Commands/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/products/app/Console/Commands/.gitkeep
diff --git a/src/products/app/Console/Kernel.php b/src/products/app/Console/Kernel.php
new file mode 100644
index 0000000..ad6e311
--- /dev/null
+++ b/src/products/app/Console/Kernel.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace App\Console;
+
+use Illuminate\Console\Scheduling\Schedule;
+use Laravel\Lumen\Console\Kernel as ConsoleKernel;
+
+class Kernel extends ConsoleKernel
+{
+ /**
+ * The Artisan commands provided by your application.
+ *
+ * @var array
+ */
+ protected $commands = [
+ //
+ ];
+
+ /**
+ * Define the application's command schedule.
+ *
+ * @param \Illuminate\Console\Scheduling\Schedule $schedule
+ * @return void
+ */
+ protected function schedule(Schedule $schedule)
+ {
+ //
+ }
+}
diff --git a/src/products/app/Events/Event.php b/src/products/app/Events/Event.php
new file mode 100644
index 0000000..b8230f0
--- /dev/null
+++ b/src/products/app/Events/Event.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace App\Events;
+
+use Illuminate\Queue\SerializesModels;
+
+abstract class Event
+{
+ use SerializesModels;
+}
diff --git a/src/products/app/Events/ExampleEvent.php b/src/products/app/Events/ExampleEvent.php
new file mode 100644
index 0000000..4bd1268
--- /dev/null
+++ b/src/products/app/Events/ExampleEvent.php
@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Events;
+
+class ExampleEvent extends Event
+{
+ /**
+ * Create a new event instance.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ //
+ }
+}
diff --git a/src/products/app/Exceptions/Handler.php b/src/products/app/Exceptions/Handler.php
new file mode 100644
index 0000000..b375c61
--- /dev/null
+++ b/src/products/app/Exceptions/Handler.php
@@ -0,0 +1,54 @@
+<?php
+
+namespace App\Exceptions;
+
+use Illuminate\Auth\Access\AuthorizationException;
+use Illuminate\Database\Eloquent\ModelNotFoundException;
+use Illuminate\Validation\ValidationException;
+use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
+use Symfony\Component\HttpKernel\Exception\HttpException;
+use Throwable;
+
+class Handler extends ExceptionHandler
+{
+ /**
+ * A list of the exception types that should not be reported.
+ *
+ * @var array
+ */
+ protected $dontReport = [
+ AuthorizationException::class,
+ HttpException::class,
+ ModelNotFoundException::class,
+ ValidationException::class,
+ ];
+
+ /**
+ * Report or log an exception.
+ *
+ * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
+ *
+ * @param \Throwable $exception
+ * @return void
+ *
+ * @throws \Exception
+ */
+ public function report(Throwable $exception)
+ {
+ parent::report($exception);
+ }
+
+ /**
+ * Render an exception into an HTTP response.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Throwable $exception
+ * @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
+ *
+ * @throws \Throwable
+ */
+ public function render($request, Throwable $exception)
+ {
+ return parent::render($request, $exception);
+ }
+}
diff --git a/src/products/app/Http/Controllers/Controller.php b/src/products/app/Http/Controllers/Controller.php
new file mode 100644
index 0000000..0ccb918
--- /dev/null
+++ b/src/products/app/Http/Controllers/Controller.php
@@ -0,0 +1,10 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Laravel\Lumen\Routing\Controller as BaseController;
+
+class Controller extends BaseController
+{
+ //
+}
diff --git a/src/products/app/Http/Controllers/ExampleController.php b/src/products/app/Http/Controllers/ExampleController.php
new file mode 100644
index 0000000..aab066e
--- /dev/null
+++ b/src/products/app/Http/Controllers/ExampleController.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Http\Controllers;
+
+class ExampleController extends Controller
+{
+ /**
+ * Create a new controller instance.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ //
+ }
+
+ //
+}
diff --git a/src/products/app/Http/Middleware/Authenticate.php b/src/products/app/Http/Middleware/Authenticate.php
new file mode 100644
index 0000000..361a11e
--- /dev/null
+++ b/src/products/app/Http/Middleware/Authenticate.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure;
+use Illuminate\Contracts\Auth\Factory as Auth;
+
+class Authenticate
+{
+ /**
+ * The authentication guard factory instance.
+ *
+ * @var \Illuminate\Contracts\Auth\Factory
+ */
+ protected $auth;
+
+ /**
+ * Create a new middleware instance.
+ *
+ * @param \Illuminate\Contracts\Auth\Factory $auth
+ * @return void
+ */
+ public function __construct(Auth $auth)
+ {
+ $this->auth = $auth;
+ }
+
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ * @param string|null $guard
+ * @return mixed
+ */
+ public function handle($request, Closure $next, $guard = null)
+ {
+ if ($this->auth->guard($guard)->guest()) {
+ return response('Unauthorized.', 401);
+ }
+
+ return $next($request);
+ }
+}
diff --git a/src/products/app/Http/Middleware/ExampleMiddleware.php b/src/products/app/Http/Middleware/ExampleMiddleware.php
new file mode 100644
index 0000000..166581c
--- /dev/null
+++ b/src/products/app/Http/Middleware/ExampleMiddleware.php
@@ -0,0 +1,20 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure;
+
+class ExampleMiddleware
+{
+ /**
+ * Handle an incoming request.
+ *
+ * @param \Illuminate\Http\Request $request
+ * @param \Closure $next
+ * @return mixed
+ */
+ public function handle($request, Closure $next)
+ {
+ return $next($request);
+ }
+}
diff --git a/src/products/app/Jobs/ExampleJob.php b/src/products/app/Jobs/ExampleJob.php
new file mode 100644
index 0000000..7b65bb4
--- /dev/null
+++ b/src/products/app/Jobs/ExampleJob.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace App\Jobs;
+
+class ExampleJob extends Job
+{
+ /**
+ * Create a new job instance.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ //
+ }
+
+ /**
+ * Execute the job.
+ *
+ * @return void
+ */
+ public function handle()
+ {
+ //
+ }
+}
diff --git a/src/products/app/Jobs/Job.php b/src/products/app/Jobs/Job.php
new file mode 100644
index 0000000..38988db
--- /dev/null
+++ b/src/products/app/Jobs/Job.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Jobs;
+
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\SerializesModels;
+
+abstract class Job implements ShouldQueue
+{
+ /*
+ |--------------------------------------------------------------------------
+ | Queueable Jobs
+ |--------------------------------------------------------------------------
+ |
+ | This job base class provides a central location to place any logic that
+ | is shared across all of your jobs. The trait included with the class
+ | provides access to the "queueOn" and "delay" queue helper methods.
+ |
+ */
+
+ use InteractsWithQueue, Queueable, SerializesModels;
+}
diff --git a/src/products/app/Listeners/ExampleListener.php b/src/products/app/Listeners/ExampleListener.php
new file mode 100644
index 0000000..a4fe5f3
--- /dev/null
+++ b/src/products/app/Listeners/ExampleListener.php
@@ -0,0 +1,31 @@
+<?php
+
+namespace App\Listeners;
+
+use App\Events\ExampleEvent;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Queue\InteractsWithQueue;
+
+class ExampleListener
+{
+ /**
+ * Create the event listener.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ //
+ }
+
+ /**
+ * Handle the event.
+ *
+ * @param \App\Events\ExampleEvent $event
+ * @return void
+ */
+ public function handle(ExampleEvent $event)
+ {
+ //
+ }
+}
diff --git a/src/products/app/Models/User.php b/src/products/app/Models/User.php
new file mode 100644
index 0000000..e8c48fc
--- /dev/null
+++ b/src/products/app/Models/User.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Auth\Authenticatable;
+use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
+use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Laravel\Lumen\Auth\Authorizable;
+
+class User extends Model implements AuthenticatableContract, AuthorizableContract
+{
+ use Authenticatable, Authorizable, HasFactory;
+
+ /**
+ * The attributes that are mass assignable.
+ *
+ * @var array
+ */
+ protected $fillable = [
+ 'name', 'email',
+ ];
+
+ /**
+ * The attributes excluded from the model's JSON form.
+ *
+ * @var array
+ */
+ protected $hidden = [
+ 'password',
+ ];
+}
diff --git a/src/products/app/Providers/AppServiceProvider.php b/src/products/app/Providers/AppServiceProvider.php
new file mode 100644
index 0000000..ddec046
--- /dev/null
+++ b/src/products/app/Providers/AppServiceProvider.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace App\Providers;
+
+use Illuminate\Support\ServiceProvider;
+
+class AppServiceProvider extends ServiceProvider
+{
+ /**
+ * Register any application services.
+ *
+ * @return void
+ */
+ public function register()
+ {
+ //
+ }
+}
diff --git a/src/products/app/Providers/AuthServiceProvider.php b/src/products/app/Providers/AuthServiceProvider.php
new file mode 100644
index 0000000..8540053
--- /dev/null
+++ b/src/products/app/Providers/AuthServiceProvider.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Providers;
+
+use App\Models\User;
+use Illuminate\Support\Facades\Gate;
+use Illuminate\Support\ServiceProvider;
+
+class AuthServiceProvider extends ServiceProvider
+{
+ /**
+ * Register any application services.
+ *
+ * @return void
+ */
+ public function register()
+ {
+ //
+ }
+
+ /**
+ * Boot the authentication services for the application.
+ *
+ * @return void
+ */
+ public function boot()
+ {
+ // Here you may define how you wish users to be authenticated for your Lumen
+ // application. The callback which receives the incoming request instance
+ // should return either a User instance or null. You're free to obtain
+ // the User instance via an API token or any other method necessary.
+
+ $this->app['auth']->viaRequest('api', function ($request) {
+ if ($request->input('api_token')) {
+ return User::where('api_token', $request->input('api_token'))->first();
+ }
+ });
+ }
+}
diff --git a/src/products/app/Providers/EventServiceProvider.php b/src/products/app/Providers/EventServiceProvider.php
new file mode 100644
index 0000000..6830e60
--- /dev/null
+++ b/src/products/app/Providers/EventServiceProvider.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace App\Providers;
+
+use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
+
+class EventServiceProvider extends ServiceProvider
+{
+ /**
+ * The event listener mappings for the application.
+ *
+ * @var array
+ */
+ protected $listen = [
+ \App\Events\ExampleEvent::class => [
+ \App\Listeners\ExampleListener::class,
+ ],
+ ];
+}
diff --git a/src/products/artisan b/src/products/artisan
new file mode 100755
index 0000000..6a9d095
--- /dev/null
+++ b/src/products/artisan
@@ -0,0 +1,35 @@
+#!/usr/bin/env php
+<?php
+
+use Symfony\Component\Console\Input\ArgvInput;
+use Symfony\Component\Console\Output\ConsoleOutput;
+
+/*
+|--------------------------------------------------------------------------
+| Create The Application
+|--------------------------------------------------------------------------
+|
+| First we need to get an application instance. This creates an instance
+| of the application / container and bootstraps the application so it
+| is ready to receive HTTP / Console requests from the environment.
+|
+*/
+
+$app = require __DIR__.'/bootstrap/app.php';
+
+/*
+|--------------------------------------------------------------------------
+| Run The Artisan Application
+|--------------------------------------------------------------------------
+|
+| When we run the console application, the current CLI command will be
+| executed in this console and the response sent back to a terminal
+| or another output device for the developers. Here goes nothing!
+|
+*/
+
+$kernel = $app->make(
+ 'Illuminate\Contracts\Console\Kernel'
+);
+
+exit($kernel->handle(new ArgvInput, new ConsoleOutput));
diff --git a/src/products/bootstrap/app.php b/src/products/bootstrap/app.php
new file mode 100644
index 0000000..b3df6ee
--- /dev/null
+++ b/src/products/bootstrap/app.php
@@ -0,0 +1,115 @@
+<?php
+
+require_once __DIR__.'/../vendor/autoload.php';
+
+(new Laravel\Lumen\Bootstrap\LoadEnvironmentVariables(
+ dirname(__DIR__)
+))->bootstrap();
+
+date_default_timezone_set(env('APP_TIMEZONE', 'UTC'));
+
+/*
+|--------------------------------------------------------------------------
+| Create The Application
+|--------------------------------------------------------------------------
+|
+| Here we will load the environment and create the application instance
+| that serves as the central piece of this framework. We'll use this
+| application as an "IoC" container and router for this framework.
+|
+*/
+
+$app = new Laravel\Lumen\Application(
+ dirname(__DIR__)
+);
+
+// $app->withFacades();
+
+// $app->withEloquent();
+
+/*
+|--------------------------------------------------------------------------
+| Register Container Bindings
+|--------------------------------------------------------------------------
+|
+| Now we will register a few bindings in the service container. We will
+| register the exception handler and the console kernel. You may add
+| your own bindings here if you like or you can make another file.
+|
+*/
+
+$app->singleton(
+ Illuminate\Contracts\Debug\ExceptionHandler::class,
+ App\Exceptions\Handler::class
+);
+
+$app->singleton(
+ Illuminate\Contracts\Console\Kernel::class,
+ App\Console\Kernel::class
+);
+
+/*
+|--------------------------------------------------------------------------
+| Register Config Files
+|--------------------------------------------------------------------------
+|
+| Now we will register the "app" configuration file. If the file exists in
+| your configuration directory it will be loaded; otherwise, we'll load
+| the default version. You may register other files below as needed.
+|
+*/
+
+$app->configure('app');
+
+/*
+|--------------------------------------------------------------------------
+| Register Middleware
+|--------------------------------------------------------------------------
+|
+| Next, we will register the middleware with the application. These can
+| be global middleware that run before and after each request into a
+| route or middleware that'll be assigned to some specific routes.
+|
+*/
+
+// $app->middleware([
+// App\Http\Middleware\ExampleMiddleware::class
+// ]);
+
+// $app->routeMiddleware([
+// 'auth' => App\Http\Middleware\Authenticate::class,
+// ]);
+
+/*
+|--------------------------------------------------------------------------
+| Register Service Providers
+|--------------------------------------------------------------------------
+|
+| Here we will register all of the application's service providers which
+| are used to bind services into the container. Service providers are
+| totally optional, so you are not required to uncomment this line.
+|
+*/
+
+// $app->register(App\Providers\AppServiceProvider::class);
+// $app->register(App\Providers\AuthServiceProvider::class);
+// $app->register(App\Providers\EventServiceProvider::class);
+
+/*
+|--------------------------------------------------------------------------
+| Load The Application Routes
+|--------------------------------------------------------------------------
+|
+| Next we will include the routes file so that they can all be added to
+| the application. This will provide all of the URLs the application
+| can respond to, as well as the controllers that may handle them.
+|
+*/
+
+$app->router->group([
+ 'namespace' => 'App\Http\Controllers',
+], function ($router) {
+ require __DIR__.'/../routes/web.php';
+});
+
+return $app;
diff --git a/src/products/composer.json b/src/products/composer.json
new file mode 100644
index 0000000..1de3472
--- /dev/null
+++ b/src/products/composer.json
@@ -0,0 +1,40 @@
+{
+ "name": "laravel/lumen",
+ "description": "The Laravel Lumen Framework.",
+ "keywords": ["framework", "laravel", "lumen"],
+ "license": "MIT",
+ "type": "project",
+ "require": {
+ "php": "^7.3",
+ "laravel/lumen-framework": "^8.0"
+ },
+ "require-dev": {
+ "fzaninotto/faker": "^1.9.1",
+ "mockery/mockery": "^1.3.1",
+ "phpunit/phpunit": "^9.3"
+ },
+ "autoload": {
+ "psr-4": {
+ "App\\": "app/",
+ "Database\\Factories\\": "database/factories/",
+ "Database\\Seeders\\": "database/seeders/"
+ }
+ },
+ "autoload-dev": {
+ "classmap": [
+ "tests/"
+ ]
+ },
+ "config": {
+ "preferred-install": "dist",
+ "sort-packages": true,
+ "optimize-autoloader": true
+ },
+ "minimum-stability": "dev",
+ "prefer-stable": true,
+ "scripts": {
+ "post-root-package-install": [
+ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
+ ]
+ }
+}
diff --git a/src/products/database/factories/UserFactory.php b/src/products/database/factories/UserFactory.php
new file mode 100644
index 0000000..31f0a5d
--- /dev/null
+++ b/src/products/database/factories/UserFactory.php
@@ -0,0 +1,29 @@
+<?php
+
+namespace Database\Factories;
+
+use App\Models\User;
+use Illuminate\Database\Eloquent\Factories\Factory;
+
+class UserFactory extends Factory
+{
+ /**
+ * The name of the factory's corresponding model.
+ *
+ * @var string
+ */
+ protected $model = User::class;
+
+ /**
+ * Define the model's default state.
+ *
+ * @return array
+ */
+ public function definition()
+ {
+ return [
+ 'name' => $this->faker->name,
+ 'email' => $this->faker->unique()->safeEmail,
+ ];
+ }
+}
diff --git a/src/products/database/migrations/.gitkeep b/src/products/database/migrations/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/products/database/migrations/.gitkeep
diff --git a/src/products/database/seeders/DatabaseSeeder.php b/src/products/database/seeders/DatabaseSeeder.php
new file mode 100644
index 0000000..7d3ff6c
--- /dev/null
+++ b/src/products/database/seeders/DatabaseSeeder.php
@@ -0,0 +1,18 @@
+<?php
+
+namespace Database\Seeders;
+
+use Illuminate\Database\Seeder;
+
+class DatabaseSeeder extends Seeder
+{
+ /**
+ * Run the database seeds.
+ *
+ * @return void
+ */
+ public function run()
+ {
+ // $this->call('UsersTableSeeder');
+ }
+}
diff --git a/src/products/phpunit.xml b/src/products/phpunit.xml
new file mode 100644
index 0000000..853e786
--- /dev/null
+++ b/src/products/phpunit.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
+ bootstrap="vendor/autoload.php"
+ colors="true"
+>
+ <testsuites>
+ <testsuite name="Application Test Suite">
+ <directory suffix="Test.php">./tests</directory>
+ </testsuite>
+ </testsuites>
+ <php>
+ <env name="APP_ENV" value="testing"/>
+ <env name="CACHE_DRIVER" value="array"/>
+ <env name="QUEUE_CONNECTION" value="sync"/>
+ </php>
+</phpunit>
diff --git a/src/products/public/.htaccess b/src/products/public/.htaccess
new file mode 100644
index 0000000..b75525b
--- /dev/null
+++ b/src/products/public/.htaccess
@@ -0,0 +1,21 @@
+<IfModule mod_rewrite.c>
+ <IfModule mod_negotiation.c>
+ Options -MultiViews -Indexes
+ </IfModule>
+
+ RewriteEngine On
+
+ # Handle Authorization Header
+ RewriteCond %{HTTP:Authorization} .
+ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+
+ # Redirect Trailing Slashes If Not A Folder...
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteCond %{REQUEST_URI} (.+)/$
+ RewriteRule ^ %1 [L,R=301]
+
+ # Handle Front Controller...
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^ index.php [L]
+</IfModule>
diff --git a/src/products/public/index.php b/src/products/public/index.php
new file mode 100644
index 0000000..04aa086
--- /dev/null
+++ b/src/products/public/index.php
@@ -0,0 +1,28 @@
+<?php
+
+/*
+|--------------------------------------------------------------------------
+| Create The Application
+|--------------------------------------------------------------------------
+|
+| First we need to get an application instance. This creates an instance
+| of the application / container and bootstraps the application so it
+| is ready to receive HTTP / Console requests from the environment.
+|
+*/
+
+$app = require __DIR__.'/../bootstrap/app.php';
+
+/*
+|--------------------------------------------------------------------------
+| Run The Application
+|--------------------------------------------------------------------------
+|
+| Once we have the application, we can handle the incoming request
+| through the kernel, and send the associated response back to
+| the client's browser allowing them to enjoy the creative
+| and wonderful application we have prepared for them.
+|
+*/
+
+$app->run();
diff --git a/src/products/resources/views/.gitkeep b/src/products/resources/views/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/products/resources/views/.gitkeep
diff --git a/src/products/routes/web.php b/src/products/routes/web.php
new file mode 100644
index 0000000..5c84bf2
--- /dev/null
+++ b/src/products/routes/web.php
@@ -0,0 +1,18 @@
+<?php
+
+/** @var \Laravel\Lumen\Routing\Router $router */
+
+/*
+|--------------------------------------------------------------------------
+| Application Routes
+|--------------------------------------------------------------------------
+|
+| Here is where you can register all of the routes for an application.
+| It is a breeze. Simply tell Lumen the URIs it should respond to
+| and give it the Closure to call when that URI is requested.
+|
+*/
+
+$router->get('/', function () use ($router) {
+ return $router->app->version();
+});
diff --git a/src/products/storage/app/.gitignore b/src/products/storage/app/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/src/products/storage/app/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/src/products/storage/framework/cache/.gitignore b/src/products/storage/framework/cache/.gitignore
new file mode 100644
index 0000000..01e4a6c
--- /dev/null
+++ b/src/products/storage/framework/cache/.gitignore
@@ -0,0 +1,3 @@
+*
+!data/
+!.gitignore
diff --git a/src/products/storage/framework/cache/data/.gitignore b/src/products/storage/framework/cache/data/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/src/products/storage/framework/cache/data/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/src/products/storage/framework/views/.gitignore b/src/products/storage/framework/views/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/src/products/storage/framework/views/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/src/products/storage/logs/.gitignore b/src/products/storage/logs/.gitignore
new file mode 100644
index 0000000..d6b7ef3
--- /dev/null
+++ b/src/products/storage/logs/.gitignore
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/src/products/tests/ExampleTest.php b/src/products/tests/ExampleTest.php
new file mode 100644
index 0000000..1bad6ef
--- /dev/null
+++ b/src/products/tests/ExampleTest.php
@@ -0,0 +1,21 @@
+<?php
+
+use Laravel\Lumen\Testing\DatabaseMigrations;
+use Laravel\Lumen\Testing\DatabaseTransactions;
+
+class ExampleTest extends TestCase
+{
+ /**
+ * A basic test example.
+ *
+ * @return void
+ */
+ public function testExample()
+ {
+ $this->get('/');
+
+ $this->assertEquals(
+ $this->app->version(), $this->response->getContent()
+ );
+ }
+}
diff --git a/src/products/tests/TestCase.php b/src/products/tests/TestCase.php
new file mode 100644
index 0000000..136846b
--- /dev/null
+++ b/src/products/tests/TestCase.php
@@ -0,0 +1,16 @@
+<?php
+
+use Laravel\Lumen\Testing\TestCase as BaseTestCase;
+
+abstract class TestCase extends BaseTestCase
+{
+ /**
+ * Creates the application.
+ *
+ * @return \Laravel\Lumen\Application
+ */
+ public function createApplication()
+ {
+ return require __DIR__.'/../bootstrap/app.php';
+ }
+}