Browse Source

init

master
Robin Thoni 8 years ago
commit
6d9f62e03c

+ 4
- 0
.gitignore View File

@@ -0,0 +1,4 @@
1
+/vendor
2
+/node_modules
3
+.env
4
+.idea

+ 7
- 0
README View File

@@ -0,0 +1,7 @@
1
+Install
2
+=======
3
+
4
+Install composer packages
5
+Make storage writable
6
+Write .env
7
+Setup database

+ 0
- 0
app/Console/Commands/.gitkeep View File


+ 29
- 0
app/Console/Kernel.php View File

@@ -0,0 +1,29 @@
1
+<?php
2
+
3
+namespace App\Console;
4
+
5
+use Illuminate\Console\Scheduling\Schedule;
6
+use Laravel\Lumen\Console\Kernel as ConsoleKernel;
7
+
8
+class Kernel extends ConsoleKernel
9
+{
10
+    /**
11
+     * The Artisan commands provided by your application.
12
+     *
13
+     * @var array
14
+     */
15
+    protected $commands = [
16
+        //
17
+    ];
18
+
19
+    /**
20
+     * Define the application's command schedule.
21
+     *
22
+     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
23
+     * @return void
24
+     */
25
+    protected function schedule(Schedule $schedule)
26
+    {
27
+        //
28
+    }
29
+}

+ 10
- 0
app/Events/Event.php View File

@@ -0,0 +1,10 @@
1
+<?php
2
+
3
+namespace App\Events;
4
+
5
+use Illuminate\Queue\SerializesModels;
6
+
7
+abstract class Event
8
+{
9
+    use SerializesModels;
10
+}

+ 46
- 0
app/Exceptions/Handler.php View File

@@ -0,0 +1,46 @@
1
+<?php
2
+
3
+namespace App\Exceptions;
4
+
5
+use Exception;
6
+use Luticate\Utils\LuHandler;
7
+use Symfony\Component\HttpKernel\Exception\HttpException;
8
+use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
9
+
10
+class Handler extends ExceptionHandler
11
+{
12
+    /**
13
+     * A list of the exception types that should not be reported.
14
+     *
15
+     * @var array
16
+     */
17
+    protected $dontReport = [
18
+        HttpException::class,
19
+    ];
20
+
21
+    /**
22
+     * Report or log an exception.
23
+     *
24
+     * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
25
+     *
26
+     * @param  \Exception  $e
27
+     * @return void
28
+     */
29
+    public function report(Exception $e)
30
+    {
31
+        return parent::report($e);
32
+    }
33
+
34
+    /**
35
+     * Render an exception into an HTTP response.
36
+     *
37
+     * @param  \Illuminate\Http\Request  $request
38
+     * @param  \Exception  $e
39
+     * @return \Illuminate\Http\Response
40
+     */
41
+    public function render($request, Exception $e)
42
+    {
43
+        $handler = new LuHandler();
44
+        return $handler->render($request, $e);
45
+    }
46
+}

+ 0
- 0
app/Http/Business/.gitignore View File


+ 0
- 0
app/Http/Controller/.gitignore View File


+ 0
- 0
app/Http/DBO/.gitignore View File


+ 0
- 0
app/Http/DataAccess/Models/.gitignore View File


+ 54
- 0
app/Http/routes.php View File

@@ -0,0 +1,54 @@
1
+<?php
2
+
3
+use App\Http\DBO\CamotionPermissions;
4
+use Luticate\Auth\Business\LuticateBusiness;
5
+use Luticate\Doc\Business\LuDocBusiness;
6
+use Luticate\Utils\LuRoute;
7
+
8
+$route = LuRoute::getInstance();
9
+
10
+$int = LuRoute::REG_INT;
11
+$host_id = "{host_id:$int}";
12
+$camera_id = "{camera_id:$int}";
13
+$sensor_id = "{sensor_id:$int}";
14
+$command_id = "{command_id:$int}";
15
+
16
+LuticateBusiness::setupAuth();
17
+LuticateBusiness::setupRoutes();
18
+LuDocBusiness::setupRoutes("/camotion");
19
+
20
+$route->get("/hosts", "Hosts", "getAll", CamotionPermissions::HOST_GET);
21
+$route->get("/hosts/$host_id", "Hosts", "get", CamotionPermissions::HOST_GET);
22
+$route->post("/hosts/add", "Hosts", "add", array(CamotionPermissions::HOST_GET, CamotionPermissions::HOST_ADD));
23
+$route->post("/hosts/$host_id/edit", "Hosts", "edit", array(CamotionPermissions::HOST_GET, CamotionPermissions::HOST_EDIT));
24
+$route->post("/hosts/$host_id/del", "Hosts", "del", array(CamotionPermissions::HOST_GET, CamotionPermissions::HOST_DEL));
25
+
26
+
27
+$route->get("/cameras/types", "Cameras", "getAllTypes", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_ADD));
28
+$route->get("/cameras", "Cameras", "getAll", CamotionPermissions::CAMERA_GET);
29
+$route->get("/cameras/$camera_id", "Cameras", "get", CamotionPermissions::CAMERA_GET);
30
+$route->post("/cameras/add", "Cameras", "add", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_ADD));
31
+$route->post("/cameras/$camera_id/edit", "Cameras", "edit", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_EDIT));
32
+$route->post("/cameras/$camera_id/del", "Cameras", "del", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_DEL));
33
+$route->post("/cameras/$camera_id/image", "Cameras", "getImage", array(CamotionPermissions::CAMERA_GET, CamotionPermissions::CAMERA_EXEC));
34
+
35
+
36
+$route->get("/sensors/types", "Sensors", "getAllTypes", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_ADD));
37
+$route->get("/sensors", "Sensors", "getAll", CamotionPermissions::SENSOR_GET);
38
+$route->get("/sensors/$sensor_id", "Sensors", "get", CamotionPermissions::SENSOR_GET);
39
+$route->post("/sensors/add", "Sensors", "add", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_ADD));
40
+$route->post("/sensors/$sensor_id/edit", "Sensors", "edit", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_EDIT));
41
+$route->post("/sensors/$sensor_id/del", "Sensors", "del", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_DEL));
42
+$route->post("/sensors/$sensor_id/value", "Sensors", "getValue", array(CamotionPermissions::SENSOR_GET, CamotionPermissions::SENSOR_EXEC));
43
+
44
+
45
+$route->get("/commands/types", "Commands", "getAllTypes", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_ADD));
46
+$route->get("/commands", "Commands", "getAll", CamotionPermissions::COMMAND_GET);
47
+$route->get("/commands/$command_id", "Commands", "get", CamotionPermissions::COMMAND_GET);
48
+$route->post("/commands/add", "Commands", "add", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_ADD));
49
+$route->post("/commands/$command_id/edit", "Commands", "edit", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_EDIT));
50
+$route->post("/commands/$command_id/del", "Commands", "del", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_DEL));
51
+$route->post("/commands/$command_id/exec", "Commands", "exec", array(CamotionPermissions::COMMAND_GET, CamotionPermissions::COMMAND_EXEC));
52
+
53
+$route->get("/other/config", "Other", "configApp");
54
+//sleep(1);

+ 25
- 0
app/Jobs/Job.php View File

@@ -0,0 +1,25 @@
1
+<?php
2
+
3
+namespace App\Jobs;
4
+
5
+use Illuminate\Bus\Queueable;
6
+use Illuminate\Queue\SerializesModels;
7
+use Illuminate\Queue\InteractsWithQueue;
8
+use Illuminate\Contracts\Bus\SelfHandling;
9
+use Illuminate\Contracts\Queue\ShouldQueue;
10
+
11
+abstract class Job implements SelfHandling, ShouldQueue
12
+{
13
+    /*
14
+    |--------------------------------------------------------------------------
15
+    | Queueable Jobs
16
+    |--------------------------------------------------------------------------
17
+    |
18
+    | This job base class provides a central location to place any logic that
19
+    | is shared across all of your jobs. The trait included with the class
20
+    | provides access to the "queueOn" and "delay" queue helper methods.
21
+    |
22
+    */
23
+
24
+    use InteractsWithQueue, Queueable, SerializesModels;
25
+}

+ 11
- 0
app/Listeners/Listener.php View File

@@ -0,0 +1,11 @@
1
+<?php
2
+
3
+namespace App\Listeners;
4
+
5
+use Illuminate\Queue\InteractsWithQueue;
6
+use Illuminate\Contracts\Queue\ShouldQueue;
7
+
8
+abstract class Listener
9
+{
10
+    //
11
+}

+ 18
- 0
app/Providers/AppServiceProvider.php View File

@@ -0,0 +1,18 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Support\ServiceProvider;
6
+
7
+class AppServiceProvider extends ServiceProvider
8
+{
9
+    /**
10
+     * Register any application services.
11
+     *
12
+     * @return void
13
+     */
14
+    public function register()
15
+    {
16
+        //
17
+    }
18
+}

+ 19
- 0
app/Providers/EventServiceProvider.php View File

@@ -0,0 +1,19 @@
1
+<?php
2
+
3
+namespace App\Providers;
4
+
5
+use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
6
+
7
+class EventServiceProvider extends ServiceProvider
8
+{
9
+    /**
10
+     * The event listener mappings for the application.
11
+     *
12
+     * @var array
13
+     */
14
+    protected $listen = [
15
+        'App\Events\SomeEvent' => [
16
+            'App\Listeners\EventListener',
17
+        ],
18
+    ];
19
+}

+ 35
- 0
artisan View File

@@ -0,0 +1,35 @@
1
+#!/usr/bin/env php
2
+<?php
3
+
4
+use Symfony\Component\Console\Input\ArgvInput;
5
+use Symfony\Component\Console\Output\ConsoleOutput;
6
+
7
+/*
8
+|--------------------------------------------------------------------------
9
+| Create The Application
10
+|--------------------------------------------------------------------------
11
+|
12
+| First we need to get an application instance. This creates an instance
13
+| of the application / container and bootstraps the application so it
14
+| is ready to receive HTTP / Console requests from the environment.
15
+|
16
+*/
17
+
18
+$app = require __DIR__.'/bootstrap/app.php';
19
+
20
+/*
21
+|--------------------------------------------------------------------------
22
+| Run The Artisan Application
23
+|--------------------------------------------------------------------------
24
+|
25
+| When we run the console application, the current CLI command will be
26
+| executed in this console and the response sent back to a terminal
27
+| or another output device for the developers. Here goes nothing!
28
+|
29
+*/
30
+
31
+$kernel = $app->make(
32
+    'Illuminate\Contracts\Console\Kernel'
33
+);
34
+
35
+exit($kernel->handle(new ArgvInput, new ConsoleOutput));

+ 99
- 0
bootstrap/app.php View File

@@ -0,0 +1,99 @@
1
+<?php
2
+
3
+require_once __DIR__.'/../vendor/autoload.php';
4
+
5
+Dotenv::load(__DIR__.'/../');
6
+
7
+/*
8
+|--------------------------------------------------------------------------
9
+| Create The Application
10
+|--------------------------------------------------------------------------
11
+|
12
+| Here we will load the environment and create the application instance
13
+| that serves as the central piece of this framework. We'll use this
14
+| application as an "IoC" container and router for this framework.
15
+|
16
+*/
17
+
18
+$app = new Laravel\Lumen\Application(
19
+    realpath(__DIR__.'/../')
20
+);
21
+
22
+$app->withFacades();
23
+
24
+$app->withEloquent();
25
+
26
+/*
27
+|--------------------------------------------------------------------------
28
+| Register Container Bindings
29
+|--------------------------------------------------------------------------
30
+|
31
+| Now we will register a few bindings in the service container. We will
32
+| register the exception handler and the console kernel. You may add
33
+| your own bindings here if you like or you can make another file.
34
+|
35
+*/
36
+
37
+$app->singleton(
38
+    Illuminate\Contracts\Debug\ExceptionHandler::class,
39
+    App\Exceptions\Handler::class
40
+);
41
+
42
+$app->singleton(
43
+    Illuminate\Contracts\Console\Kernel::class,
44
+    App\Console\Kernel::class
45
+);
46
+
47
+/*
48
+|--------------------------------------------------------------------------
49
+| Register Middleware
50
+|--------------------------------------------------------------------------
51
+|
52
+| Next, we will register the middleware with the application. These can
53
+| be global middleware that run before and after each request into a
54
+| route or middleware that'll be assigned to some specific routes.
55
+|
56
+*/
57
+
58
+// $app->middleware([
59
+//     // Illuminate\Cookie\Middleware\EncryptCookies::class,
60
+//     // Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
61
+//     // Illuminate\Session\Middleware\StartSession::class,
62
+//     // Illuminate\View\Middleware\ShareErrorsFromSession::class,
63
+//     // Laravel\Lumen\Http\Middleware\VerifyCsrfToken::class,
64
+// ]);
65
+
66
+// $app->routeMiddleware([
67
+
68
+// ]);
69
+
70
+/*
71
+|--------------------------------------------------------------------------
72
+| Register Service Providers
73
+|--------------------------------------------------------------------------
74
+|
75
+| Here we will register all of the application's service providers which
76
+| are used to bind services into the container. Service providers are
77
+| totally optional, so you are not required to uncomment this line.
78
+|
79
+*/
80
+
81
+// $app->register(App\Providers\AppServiceProvider::class);
82
+// $app->register(App\Providers\EventServiceProvider::class);
83
+
84
+/*
85
+|--------------------------------------------------------------------------
86
+| Load The Application Routes
87
+|--------------------------------------------------------------------------
88
+|
89
+| Next we will include the routes file so that they can all be added to
90
+| the application. This will provide all of the URLs the application
91
+| can respond to, as well as the controllers that may handle them.
92
+|
93
+*/
94
+
95
+$app->group(['namespace' => 'App\Http\Controllers'], function ($app) {
96
+    require __DIR__.'/../app/Http/routes.php';
97
+});
98
+
99
+return $app;

+ 48
- 0
composer.json View File

@@ -0,0 +1,48 @@
1
+{
2
+    "name": "laravel/lumen",
3
+    "description": "The Laravel Lumen Framework.",
4
+    "keywords": ["framework", "laravel", "lumen"],
5
+    "license": "MIT",
6
+    "type": "project",
7
+    "repositories": [{
8
+        "type": "vcs",
9
+        "url":  "https://git.rthoni.com/luticate/utils.git"
10
+    },{
11
+        "type": "vcs",
12
+        "url":  "https://git.rthoni.com/luticate/generator.git"
13
+    },{
14
+        "type": "vcs",
15
+        "url":  "https://git.rthoni.com/luticate/auth.git"
16
+    },{
17
+        "type": "vcs",
18
+        "url":  "https://git.rthoni.com/luticate/doc.git"
19
+    }],
20
+    "require": {
21
+        "php": ">=5.5.9",
22
+        "laravel/lumen-framework": "5.1.*",
23
+        "vlucas/phpdotenv": "~1.0",
24
+        "luticate/auth": "0.1.x"
25
+    },
26
+    "require-dev": {
27
+        "phpunit/phpunit": "~4.0",
28
+        "fzaninotto/faker": "~1.0",
29
+        "luticate/generator": "0.1.x",
30
+        "luticate/doc": "0.1.x"
31
+    },
32
+    "autoload": {
33
+        "psr-4": {
34
+            "App\\": "app/"
35
+        },
36
+        "classmap": [
37
+            "database/"
38
+        ]
39
+    },
40
+    "autoload-dev": {
41
+        "classmap": [
42
+            "tests/"
43
+        ]
44
+    },
45
+    "config": {
46
+        "preferred-install": "dist"
47
+    }
48
+}

+ 3770
- 0
composer.lock
File diff suppressed because it is too large
View File


+ 21
- 0
database/factories/ModelFactory.php View File

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+/*
4
+|--------------------------------------------------------------------------
5
+| Model Factories
6
+|--------------------------------------------------------------------------
7
+|
8
+| Here you may define all of your model factories. Model factories give
9
+| you a convenient way to create models for testing and seeding your
10
+| database. Just tell the factory how a default model should look.
11
+|
12
+*/
13
+
14
+$factory->define(App\User::class, function ($faker) {
15
+    return [
16
+        'name' => $faker->name,
17
+        'email' => $faker->email,
18
+        'password' => str_random(10),
19
+        'remember_token' => str_random(10),
20
+    ];
21
+});

+ 0
- 0
database/migrations/.gitkeep View File


+ 21
- 0
database/seeds/DatabaseSeeder.php View File

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+use Illuminate\Database\Seeder;
4
+use Illuminate\Database\Eloquent\Model;
5
+
6
+class DatabaseSeeder extends Seeder
7
+{
8
+    /**
9
+     * Run the database seeds.
10
+     *
11
+     * @return void
12
+     */
13
+    public function run()
14
+    {
15
+        Model::unguard();
16
+
17
+        // $this->call('UserTableSeeder');
18
+
19
+        Model::reguard();
20
+    }
21
+}

+ 9
- 0
example.env View File

@@ -0,0 +1,9 @@
1
+DB_CONNECTION=pgsql
2
+DB_HOST=localhost
3
+DB_PORT=5432
4
+DB_DATABASE=dev
5
+DB_USERNAME=dev
6
+DB_PASSWORD=dev
7
+
8
+MCRYPT_KEY=ffffffffffffffffffffffff
9
+JWT_KEY=ffffffffffffffffffffffffffffffffffffffff

+ 54
- 0
generate.php View File

@@ -0,0 +1,54 @@
1
+<?php
2
+
3
+use Luticate\Generator\LuGenerator;
4
+
5
+require_once('vendor/autoload.php');
6
+Dotenv::load(".");
7
+
8
+$gen = new LuGenerator(getenv("DB_CONNECTION"), getenv("DB_DATABASE"), getenv("DB_HOST"),
9
+    getenv("DB_PORT"), getenv("DB_USERNAME"), getenv("DB_PASSWORD"));
10
+
11
+$gen->setConfig(array("dbo" =>
12
+    array(
13
+        "namespace" => 'App\Http\DBO',
14
+        "folder" => 'app/Http/DBO'
15
+    ),
16
+    "models" =>
17
+        array(
18
+            "namespace" => 'App\Http\DataAccess\Models',
19
+            "folder" => 'app/Http/DataAccess/Models'
20
+        ),
21
+    "sp" =>
22
+        array(
23
+            "namespace" => 'App\Http\DataAccess\SP',
24
+            "folder" => 'app/Http/DataAccess/SP'
25
+        ),
26
+    "dataaccess" =>
27
+        array(
28
+            "namespace" => 'App\Http\DataAccess',
29
+            "folder" => 'app/Http/DataAccess'
30
+        ),
31
+    "business" =>
32
+        array(
33
+            "namespace" => 'App\Http\Business',
34
+            "folder" => 'app/Http/Business'
35
+        ),
36
+    "controller" =>
37
+        array(
38
+            "namespace" => 'App\Http\Controller',
39
+            "folder" => 'app/Http/Controller'
40
+        ),
41
+    "mode" => 0775,
42
+    "ignore" => array(
43
+        "tables" => array(
44
+            "/^luticate_.*/"
45
+        ),
46
+        "sp" => array(
47
+            "/^sp_lu_.*/"
48
+        ),
49
+        "controllers" => array(
50
+        )
51
+    )
52
+));
53
+
54
+$gen->run();

+ 28
- 0
phpunit.xml View File

@@ -0,0 +1,28 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<phpunit backupGlobals="false"
3
+         backupStaticAttributes="false"
4
+         bootstrap="bootstrap/app.php"
5
+         colors="true"
6
+         convertErrorsToExceptions="true"
7
+         convertNoticesToExceptions="true"
8
+         convertWarningsToExceptions="true"
9
+         processIsolation="false"
10
+         stopOnFailure="false"
11
+         syntaxCheck="false">
12
+    <testsuites>
13
+        <testsuite name="Application Test Suite">
14
+            <directory>./tests/</directory>
15
+        </testsuite>
16
+    </testsuites>
17
+    <filter>
18
+        <whitelist>
19
+            <directory suffix=".php">app/</directory>
20
+        </whitelist>
21
+    </filter>
22
+    <php>
23
+        <env name="APP_ENV" value="testing"/>
24
+        <env name="CACHE_DRIVER" value="array"/>
25
+        <env name="SESSION_DRIVER" value="array"/>
26
+        <env name="QUEUE_DRIVER" value="sync"/>
27
+    </php>
28
+</phpunit>

+ 15
- 0
public/.htaccess View File

@@ -0,0 +1,15 @@
1
+<IfModule mod_rewrite.c>
2
+    <IfModule mod_negotiation.c>
3
+        Options -MultiViews
4
+    </IfModule>
5
+
6
+    RewriteEngine On
7
+
8
+    # Redirect Trailing Slashes...
9
+    RewriteRule ^(.*)/$ /$1 [L,R=301]
10
+
11
+    # Handle Front Controller...
12
+    RewriteCond %{REQUEST_FILENAME} !-d
13
+    RewriteCond %{REQUEST_FILENAME} !-f
14
+    RewriteRule ^ index.php [L]
15
+</IfModule>

+ 28
- 0
public/index.php View File

@@ -0,0 +1,28 @@
1
+<?php
2
+
3
+/*
4
+|--------------------------------------------------------------------------
5
+| Create The Application
6
+|--------------------------------------------------------------------------
7
+|
8
+| First we need to get an application instance. This creates an instance
9
+| of the application / container and bootstraps the application so it
10
+| is ready to receive HTTP / Console requests from the environment.
11
+|
12
+*/
13
+
14
+$app = require __DIR__.'/../bootstrap/app.php';
15
+
16
+/*
17
+|--------------------------------------------------------------------------
18
+| Run The Application
19
+|--------------------------------------------------------------------------
20
+|
21
+| Once we have the application, we can handle the incoming request
22
+| through the kernel, and send the associated response back to
23
+| the client's browser allowing them to enjoy the creative
24
+| and wonderful application we have prepared for them.
25
+|
26
+*/
27
+
28
+$app->run();

+ 107
- 0
resources/lang/en/validation.php View File

@@ -0,0 +1,107 @@
1
+<?php
2
+
3
+return [
4
+
5
+    /*
6
+    |--------------------------------------------------------------------------
7
+    | Validation Language Lines
8
+    |--------------------------------------------------------------------------
9
+    |
10
+    | The following language lines contain the default error messages used by
11
+    | the validator class. Some of these rules have multiple versions such
12
+    | as the size rules. Feel free to tweak each of these messages here.
13
+    |
14
+    */
15
+
16
+    'accepted'             => '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
+    'alpha'                => 'The :attribute may only contain letters.',
20
+    'alpha_dash'           => 'The :attribute may only contain letters, numbers, and dashes.',
21
+    'alpha_num'            => 'The :attribute may only contain letters and numbers.',
22
+    'array'                => 'The :attribute must be an array.',
23
+    'before'               => 'The :attribute must be a date before :date.',
24
+    'between'              => [
25
+        'numeric' => 'The :attribute must be between :min and :max.',
26
+        'file'    => 'The :attribute must be between :min and :max kilobytes.',
27
+        'string'  => 'The :attribute must be between :min and :max characters.',
28
+        'array'   => 'The :attribute must have between :min and :max items.',
29
+    ],
30
+    'boolean'              => 'The :attribute field must be true or false.',
31
+    'confirmed'            => 'The :attribute confirmation does not match.',
32
+    'date'                 => 'The :attribute is not a valid date.',
33
+    'date_format'          => 'The :attribute does not match the format :format.',
34
+    'different'            => 'The :attribute and :other must be different.',
35
+    'digits'               => 'The :attribute must be :digits digits.',
36
+    'digits_between'       => 'The :attribute must be between :min and :max digits.',
37
+    'email'                => 'The :attribute must be a valid email address.',
38
+    'filled'               => 'The :attribute field is required.',
39
+    'exists'               => 'The selected :attribute is invalid.',
40
+    'image'                => 'The :attribute must be an image.',
41
+    'in'                   => 'The selected :attribute is invalid.',
42
+    'integer'              => 'The :attribute must be an integer.',
43
+    'ip'                   => 'The :attribute must be a valid IP address.',
44
+    'max'                  => [
45
+        'numeric' => 'The :attribute may not be greater than :max.',
46
+        'file'    => 'The :attribute may not be greater than :max kilobytes.',
47
+        'string'  => 'The :attribute may not be greater than :max characters.',
48
+        'array'   => 'The :attribute may not have more than :max items.',
49
+    ],
50
+    'mimes'                => 'The :attribute must be a file of type: :values.',
51
+    'min'                  => [
52
+        'numeric' => 'The :attribute must be at least :min.',
53
+        'file'    => 'The :attribute must be at least :min kilobytes.',
54
+        'string'  => 'The :attribute must be at least :min characters.',
55
+        'array'   => 'The :attribute must have at least :min items.',
56
+    ],
57
+    'not_in'               => 'The selected :attribute is invalid.',
58
+    'numeric'              => 'The :attribute must be a number.',
59
+    'regex'                => 'The :attribute format is invalid.',
60
+    'required'             => 'The :attribute field is required.',
61
+    'required_if'          => 'The :attribute field is required when :other is :value.',
62
+    'required_with'        => 'The :attribute field is required when :values is present.',
63
+    'required_with_all'    => 'The :attribute field is required when :values is present.',
64
+    'required_without'     => 'The :attribute field is required when :values is not present.',
65
+    'required_without_all' => 'The :attribute field is required when none of :values are present.',
66
+    'same'                 => 'The :attribute and :other must match.',
67
+    'size'                 => [
68
+        'numeric' => 'The :attribute must be :size.',
69
+        'file'    => 'The :attribute must be :size kilobytes.',
70
+        'string'  => 'The :attribute must be :size characters.',
71
+        'array'   => 'The :attribute must contain :size items.',
72
+    ],
73
+    'unique'               => 'The :attribute has already been taken.',
74
+    'url'                  => 'The :attribute format is invalid.',
75
+    'timezone'             => 'The :attribute must be a valid zone.',
76
+
77
+    /*
78
+    |--------------------------------------------------------------------------
79
+    | Custom Validation Language Lines
80
+    |--------------------------------------------------------------------------
81
+    |
82
+    | Here you may specify custom validation messages for attributes using the
83
+    | convention "attribute.rule" to name the lines. This makes it quick to
84
+    | specify a specific custom language line for a given attribute rule.
85
+    |
86
+    */
87
+
88
+    'custom' => [
89
+        'attribute-name' => [
90
+            'rule-name' => 'custom-message',
91
+        ],
92
+    ],
93
+
94
+    /*
95
+    |--------------------------------------------------------------------------
96
+    | Custom Validation Attributes
97
+    |--------------------------------------------------------------------------
98
+    |
99
+    | The following language lines are used to swap attribute place-holders
100
+    | with something more reader friendly such as E-Mail Address instead
101
+    | of "email". This simply helps us make messages a little cleaner.
102
+    |
103
+    */
104
+
105
+    'attributes' => [],
106
+
107
+];

+ 0
- 0
resources/views/.gitkeep View File


+ 12
- 0
server.php View File

@@ -0,0 +1,12 @@
1
+<?php
2
+
3
+$uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
4
+
5
+// This file allows us to emulate Apache's "mod_rewrite" functionality from the
6
+// built-in PHP web server. This provides a convenient way to test a Lumen
7
+// application without having installed a "real" server software here.
8
+if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
9
+    return false;
10
+}
11
+
12
+require_once __DIR__.'/public/index.php';

+ 0
- 0
sql/data_init.sql View File


+ 0
- 0
sql/struct_init.sql View File


+ 2
- 0
storage/app/.gitignore View File

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 2
- 0
storage/framework/cache/.gitignore View File

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 2
- 0
storage/framework/sessions/.gitignore View File

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 2
- 0
storage/framework/views/.gitignore View File

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 2
- 0
storage/logs/.gitignore View File

@@ -0,0 +1,2 @@
1
+*
2
+!.gitignore

+ 15
- 0
tests/ExampleTest.php View File

@@ -0,0 +1,15 @@
1
+<?php
2
+
3
+class ExampleTest extends TestCase
4
+{
5
+    /**
6
+     * A basic test example.
7
+     *
8
+     * @return void
9
+     */
10
+    public function testBasicExample()
11
+    {
12
+        $this->visit('/')
13
+             ->see('Lumen.');
14
+    }
15
+}

+ 14
- 0
tests/TestCase.php View File

@@ -0,0 +1,14 @@
1
+<?php
2
+
3
+class TestCase extends Laravel\Lumen\Testing\TestCase
4
+{
5
+    /**
6
+     * Creates the application.
7
+     *
8
+     * @return \Laravel\Lumen\Application
9
+     */
10
+    public function createApplication()
11
+    {
12
+        return require __DIR__.'/../bootstrap/app.php';
13
+    }
14
+}

Loading…
Cancel
Save