├── .env.example ├── .gitattributes ├── .gitignore ├── apiary.apib ├── app ├── Api │ └── V1 │ │ ├── Controllers │ │ └── OnixCodelistController.php │ │ └── Transformers │ │ ├── CodeTransformer.php │ │ └── CodelistTransformer.php ├── Code.php ├── CodeTranslation.php ├── Codelist.php ├── CodelistTranslation.php ├── Console │ ├── Commands │ │ ├── Inspire.php │ │ ├── UpdateCodelists.php │ │ └── UpdateElements.php │ └── Kernel.php ├── Element.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Auth │ │ │ ├── ForgotPasswordController.php │ │ │ ├── LoginController.php │ │ │ ├── RegisterController.php │ │ │ └── ResetPasswordController.php │ │ ├── CodelistController.php │ │ └── Controller.php │ ├── Kernel.php │ └── Middleware │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ └── VerifyCsrfToken.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Schemas │ ├── ONIX_BookProduct_3.0_reference.rng │ ├── ONIX_BookProduct_3.0_short.rng │ ├── ONIX_BookProduct_CodeLists.rng │ └── ONIX_XHTML_Subset.rng └── User.php ├── artisan ├── bootstrap ├── app.php ├── autoload.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── algolia.php ├── api.php ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── compile.php ├── database.php ├── filesystems.php ├── mail.php ├── onix_codelist.php ├── queue.php ├── services.php ├── session.php ├── translatable.php └── view.php ├── database ├── .gitignore ├── factories │ └── ModelFactory.php ├── migrations │ ├── .gitkeep │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2016_03_14_204109_create_codelists_table.php │ ├── 2016_03_14_204347_create_codes_table.php │ ├── 2016_03_22_200201_create_elements_table.php │ ├── 2016_09_14_093751_make_codelist_issue_number_nullable.php │ ├── 2016_11_24_113429_create_codelist_translations_table.php │ ├── 2016_11_24_122306_create_code_translation_table.php │ └── 2018_01_24_142522_add_last_issue_modified_at_to_codes_table.php └── seeds │ ├── .gitkeep │ └── DatabaseSeeder.php ├── gulpfile.js ├── license.txt ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── algolia-autocomplete.css ├── favicon.ico ├── index.php ├── robots.txt ├── search.js └── web.config ├── readme.md ├── resources ├── assets │ └── sass │ │ └── app.scss ├── lang │ └── en │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php └── views │ ├── about.blade.php │ ├── api-docs.blade.php │ ├── codelists.blade.php │ ├── codes.blade.php │ ├── errors │ ├── 404.blade.php │ └── 503.blade.php │ ├── shared │ └── master.blade.php │ ├── vendor │ └── .gitkeep │ └── welcome.blade.php ├── routes ├── api.php ├── console.php └── web.php ├── server.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore └── tests ├── ApiTest.php ├── TestCase.php ├── UpdateCodelistsTest.php └── WebSiteTest.php /.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_DEBUG=true 3 | APP_KEY=SomeRandomString 4 | APP_URL=http://localhost 5 | 6 | DB_HOST=127.0.0.1 7 | DB_PORT=3306 8 | DB_DATABASE=homestead 9 | DB_USERNAME=homestead 10 | DB_PASSWORD=secret 11 | 12 | CACHE_DRIVER=file 13 | SESSION_DRIVER=file 14 | QUEUE_DRIVER=sync 15 | 16 | REDIS_HOST=127.0.0.1 17 | REDIS_PASSWORD=null 18 | REDIS_PORT=6379 19 | 20 | MAIL_DRIVER=smtp 21 | MAIL_HOST=mailtrap.io 22 | MAIL_PORT=2525 23 | MAIL_USERNAME=null 24 | MAIL_PASSWORD=null 25 | MAIL_ENCRYPTION=null 26 | 27 | ALGOLIA_APP_ID= 28 | ALGOLIA_API_KEY= 29 | 30 | ANALYTICS_PROVIDER=GoogleAnalytics 31 | ANALYTICS_TRACKING_ID=your-tracking-id -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.css linguist-vendored 3 | *.less linguist-vendored 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /node_modules 3 | /public/storage 4 | Homestead.yaml 5 | Homestead.json 6 | .env 7 | onix-codelist.sublime-project 8 | onix-codelist.sublime-workspace 9 | deploy.php -------------------------------------------------------------------------------- /apiary.apib: -------------------------------------------------------------------------------- 1 | FORMAT: 1A 2 | HOST: https://onix-codelists.io 3 | 4 | # onix-codelists.io 5 | 6 | # Onix codelists [/api/v1/codelist] 7 | 8 | ## Show all codelists [GET /api/v1/codelist{?page,limit,include}] 9 | Get a JSON representation of all Onix codelists. 10 | 11 | + Parameters 12 | + page (integer, optional) - The page of results to view. 13 | + Default: 1 14 | + limit (integer, optional) - The amount of results per page. 15 | + Default: 25 16 | + include (enum[enum], optional) - Available additional details to request. 17 | + Default: codes 18 | + Members 19 | + `codes` - The code values that the codelist has 20 | 21 | + Response 200 (application/json) 22 | + Body 23 | 24 | { 25 | "id": 1, 26 | "number": 1, 27 | "description": "Notification or update type code", 28 | "issue_number": 0 29 | } 30 | 31 | + Response 422 (application/json) 32 | + Body 33 | 34 | { 35 | "message": "Could not list codelists.", 36 | "errors": { 37 | "page": [ 38 | "The page must be a number." 39 | ] 40 | }, 41 | "status_code": 422 42 | } 43 | 44 | + Response 422 (application/json) 45 | + Body 46 | 47 | { 48 | "message": "Could not list codelists.", 49 | "errors": { 50 | "page": [ 51 | "The page must be at least 1." 52 | ] 53 | }, 54 | "status_code": 422 55 | } 56 | 57 | + Response 422 (application/json) 58 | + Body 59 | 60 | { 61 | "message": "Could not list codelists.", 62 | "errors": { 63 | "limit": [ 64 | "The limit must be a number." 65 | ] 66 | }, 67 | "status_code": 422 68 | } 69 | 70 | + Response 422 (application/json) 71 | + Body 72 | 73 | { 74 | "message": "Could not list codelists.", 75 | "errors": { 76 | "limit": [ 77 | "The limit must be at least 1." 78 | ] 79 | }, 80 | "status_code": 422 81 | } 82 | 83 | ## Show the specified Codelist [GET /api/v1/codelist/{number}?include={include}] 84 | Show a spesific codelist by the codelist number. 85 | 86 | + Parameters 87 | + number (integer, required) - Number of the codelist 88 | + include (enum[enum], optional) - Available additional details to request. 89 | + Default: codes 90 | + Members 91 | + `codes` - The code values that the codelist has 92 | 93 | + Response 200 (application/json) 94 | + Body 95 | 96 | { 97 | "id": 1, 98 | "number": 1, 99 | "description": "Notification or update type code", 100 | "issue_number": 0 101 | } 102 | 103 | + Response 422 (application/json) 104 | + Body 105 | 106 | { 107 | "message": "Could not list codelist.", 108 | "errors": { 109 | "number": [ 110 | "The number must be a number." 111 | ] 112 | }, 113 | "status_code": 422 114 | } 115 | 116 | + Response 422 (application/json) 117 | + Body 118 | 119 | { 120 | "message": "Could not list codelist.", 121 | "errors": { 122 | "number": [ 123 | "The selected number is invalid." 124 | ] 125 | }, 126 | "status_code": 422 127 | } -------------------------------------------------------------------------------- /app/Api/V1/Controllers/OnixCodelistController.php: -------------------------------------------------------------------------------- 1 | all(), [ 47 | 'page' => 'numeric|min:1', 48 | 'limit' => 'numeric|min:1', 49 | ]); 50 | 51 | if ($validator->fails()) { 52 | throw new \Dingo\Api\Exception\ResourceException('Could not list codelists.', $validator->errors()); 53 | } 54 | 55 | $codelists = Codelist::paginate($request->input('limit', 25)); 56 | 57 | return $this->response->paginator($codelists, new CodelistTransformer); 58 | } 59 | 60 | /** 61 | * Show the specified Codelist 62 | * 63 | * Show a spesific codelist by the codelist number. 64 | * 65 | * @Get("/{number}?include={include}") 66 | * @Versions({"v1"}) 67 | * @Parameters({ 68 | * @Parameter("number", type="integer", required=true, description="Number of the codelist"), 69 | * @Parameter("include", type="enum", description="Available additional details to request.", default="codes", members={ 70 | * @Member("codes", description="The code values that the codelist has") 71 | * }) 72 | * }) 73 | * @Transaction({ 74 | * @Response(200, body={"id":1,"number":1,"description":"Notification or update type code","issue_number":0}), 75 | * @Response(422, body={"message":"Could not list codelist.","errors":{"number":{"The number must be a number."}},"status_code":422}), 76 | * @Response(422, body={"message":"Could not list codelist.","errors":{"number":{"The selected number is invalid."}},"status_code":422}) 77 | * }) 78 | * @param int $number 79 | * @return Response 80 | */ 81 | public function show($number) 82 | { 83 | $validator = Validator::make(['number' => $number], [ 84 | 'number' => 'numeric|exists:codelists,number', 85 | ]); 86 | 87 | if ($validator->fails()) { 88 | throw new \Dingo\Api\Exception\ResourceException('Could not list codelist.', $validator->errors()); 89 | } 90 | 91 | $codelist = Codelist::where('number', $number)->first(); 92 | 93 | return $this->response->item($codelist, new CodelistTransformer); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /app/Api/V1/Transformers/CodeTransformer.php: -------------------------------------------------------------------------------- 1 | (int) $code->id, 14 | 'value' => $code->value, 15 | 'description' => $code->description, 16 | 'notes' => $code->notes, 17 | 'issue_number' => (int) $code->issue_number, 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Api/V1/Transformers/CodelistTransformer.php: -------------------------------------------------------------------------------- 1 | (int) $codelist->id, 23 | 'number' => (int) $codelist->number, 24 | 'description' => $codelist->description, 25 | 'issue_number' => (int) $codelist->issue_number, 26 | ]; 27 | } 28 | 29 | /** 30 | * Include Code 31 | * 32 | * @return League\Fractal\ItemResource 33 | */ 34 | public function includeCodes(Codelist $codelist) 35 | { 36 | $codes = $codelist->codes; 37 | 38 | return $this->collection($codes, new CodeTransformer); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Code.php: -------------------------------------------------------------------------------- 1 | [ 19 | 'value', 20 | 'description', 21 | 'notes', 22 | ], 23 | ]; 24 | 25 | public $translatedAttributes = ['description', 'notes']; 26 | 27 | /** 28 | * The attributes that are mass assignable. 29 | * 30 | * @var array 31 | */ 32 | protected $fillable = ['codelist_id', 'value', 'description', 'notes', 'issue_number']; 33 | 34 | /** 35 | * Get the Codelist that owns the Code. 36 | */ 37 | public function codelist() 38 | { 39 | return $this->belongsTo('App\Codelist'); 40 | } 41 | 42 | /** 43 | * Append codelist number to Algolia record 44 | * @return void 45 | */ 46 | public function getAlgoliaRecord() 47 | { 48 | $this->number = $this->codelist->number; 49 | return $this->toArray(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/CodeTranslation.php: -------------------------------------------------------------------------------- 1 | [ 19 | 'description', 20 | 'number', 21 | ], 22 | ]; 23 | 24 | public $translatedAttributes = ['description']; 25 | 26 | /** 27 | * The attributes that are mass assignable. 28 | * 29 | * @var array 30 | */ 31 | protected $fillable = ['number']; 32 | 33 | /** 34 | * Get the Codes for the Codelist. 35 | */ 36 | public function codes() 37 | { 38 | return $this->hasMany('App\Code'); 39 | } 40 | 41 | /** 42 | * Get the Elements for the Codelist. 43 | */ 44 | public function elements() 45 | { 46 | return $this->hasMany('App\Element'); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/CodelistTranslation.php: -------------------------------------------------------------------------------- 1 | comment(PHP_EOL.Inspiring::quote().PHP_EOL); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/Console/Commands/UpdateCodelists.php: -------------------------------------------------------------------------------- 1 | client = $client; 42 | parent::__construct(); 43 | } 44 | 45 | /** 46 | * Execute the console command. 47 | * 48 | * @return mixed 49 | */ 50 | public function handle() 51 | { 52 | // Send a request to the JSON formatted codelist 53 | $response = $this->client->request('GET', $this->formUri()); 54 | 55 | // Parse codelists from response 56 | $onixCodelists = json_decode($response->getBody()->getContents()); 57 | 58 | // Disable Algolia auto-indexing temporarily 59 | Codelist::$autoIndex = false; 60 | Code::$autoIndex = false; 61 | 62 | foreach ($onixCodelists->ONIXCodeTable->CodeList as $onixCodelist) { 63 | // Create or update codelist 64 | $codelist = Codelist::firstOrCreate(['number' => $onixCodelist->CodeListNumber]); 65 | $codelist->issue_number = $onixCodelist->IssueNumber; 66 | 67 | // Save the english description 68 | $codelist->translateOrNew('en')->description = $onixCodelist->CodeListDescription; 69 | 70 | $codelist->save(); 71 | 72 | // Remove all existing codes from codelist 73 | $codelist->codes()->delete(); 74 | 75 | // In case of many codes, go through array 76 | if (isset($onixCodelist->Code) && is_array($onixCodelist->Code)) { 77 | foreach ($onixCodelist->Code as $onixCodelistCode) { 78 | $code = new Code; 79 | $code->codelist_id = $codelist->id; 80 | $code->value = $onixCodelistCode->CodeValue; 81 | $code->issue_number = $onixCodelistCode->IssueNumber; 82 | 83 | if(isset($onixCodelistCode->ModifiedNumber)) { 84 | $code->last_issue_modified_at = $onixCodelistCode->ModifiedNumber; 85 | } 86 | 87 | $code->save(); 88 | 89 | // Save the english description and notes 90 | $code->translateOrNew('en')->description = $onixCodelistCode->CodeDescription; 91 | if (isset($onixCodelistCode->CodeNotes)) { 92 | $code->translateOrNew('en')->notes = $onixCodelistCode->CodeNotes; 93 | } 94 | 95 | $code->save(); 96 | } 97 | } 98 | 99 | // In case of one code, pass the object 100 | if (isset($onixCodelist->Code) && is_object($onixCodelist->Code)) { 101 | $code = new Code; 102 | $code->codelist_id = $codelist->id; 103 | $code->value = $onixCodelistCode->CodeValue; 104 | $code->issue_number = $onixCodelistCode->IssueNumber; 105 | $code->save(); 106 | 107 | // Save the english description and notes 108 | $code->translateOrNew('en')->description = $onixCodelistCode->CodeDescription; 109 | if (isset($onixCodelistCode->CodeNotes)) { 110 | $code->translateOrNew('en')->notes = $onixCodelistCode->CodeNotes; 111 | } 112 | 113 | $code->save(); 114 | } 115 | } 116 | 117 | // Reindex Algolia and set settings 118 | Codelist::clearIndices(); 119 | Codelist::reindex(); 120 | Codelist::setSettings(); 121 | 122 | Code::clearIndices(); 123 | Code::reindex(); 124 | Code::setSettings(); 125 | } 126 | 127 | /** 128 | * Form and URL to the JSON version of the codelist 129 | * @return League\Uri\Schemes\Http 130 | */ 131 | public function formUri() 132 | { 133 | $uri = HttpUri::createFromString('http://www.editeur.org/files/ONIX for books - code lists/'); 134 | $modifier = new AppendSegment('ONIX_BookProduct_Codelists_Issue_' . config('onix_codelist.issue_number') . '.json'); 135 | $newUri = $modifier->__invoke($uri); 136 | return $newUri; 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /app/Console/Commands/UpdateElements.php: -------------------------------------------------------------------------------- 1 | define as $define) { 50 | foreach ($define->element as $element) { 51 | foreach ($element->ref as $ref) { 52 | if (preg_match("/List(\d+)/", (string) $ref['name'], $output)) { 53 | // Get reference and short name from optional elements 54 | foreach ($element->optional as $optional) { 55 | $attributeName = (string) $optional->attribute['name']; 56 | switch ($attributeName) { 57 | case 'refname': 58 | $referenceName = (string) $optional->attribute->value; 59 | break; 60 | case 'shortname': 61 | $shortName = (string) $optional->attribute->value; 62 | break; 63 | } 64 | } 65 | 66 | // Create element and attach the codelist to it 67 | $codelist = Codelist::where('number', $output[1])->firstOrFail(); 68 | $element = Element::firstOrNew(['reference_name' => $referenceName, 'short_name' => $shortName]); 69 | $codelist->elements()->save($element); 70 | } 71 | } 72 | } 73 | } 74 | 75 | // Reindex Algolia and set settings 76 | Element::clearIndices(); 77 | Element::reindex(); 78 | Element::setSettings(); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire') 29 | // ->hourly(); 30 | } 31 | /** 32 | * Register the Closure based commands for the application. 33 | * 34 | * @return void 35 | */ 36 | protected function commands() 37 | { 38 | require base_path('routes/console.php'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Element.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'reference_name', 18 | 'short_name', 19 | 'codelist.description' 20 | ], 21 | 'disableTypoToleranceOnAttributes' => [ 22 | 'short_name' 23 | ] 24 | ]; 25 | 26 | /** 27 | * The attributes that are mass assignable. 28 | * 29 | * @var array 30 | */ 31 | protected $fillable = ['reference_name', 'short_name']; 32 | 33 | /** 34 | * Get the Codelist that owns the Element. 35 | */ 36 | public function codelist() 37 | { 38 | return $this->belongsTo('App\Codelist'); 39 | } 40 | 41 | /** 42 | * Append codelist number to Algolia record 43 | * @return void 44 | */ 45 | public function getAlgoliaRecord() 46 | { 47 | $this->number = $this->codelist->number; 48 | return $this->toArray(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 60 | return response()->json(['error' => 'Unauthenticated.'], 401); 61 | } 62 | 63 | return redirect()->guest('login'); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ForgotPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/LoginController.php: -------------------------------------------------------------------------------- 1 | middleware('guest', ['except' => 'logout']); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/RegisterController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 40 | } 41 | 42 | /** 43 | * Get a validator for an incoming registration request. 44 | * 45 | * @param array $data 46 | * @return \Illuminate\Contracts\Validation\Validator 47 | */ 48 | protected function validator(array $data) 49 | { 50 | return Validator::make($data, [ 51 | 'name' => 'required|max:255', 52 | 'email' => 'required|email|max:255|unique:users', 53 | 'password' => 'required|min:6|confirmed', 54 | ]); 55 | } 56 | 57 | /** 58 | * Create a new user instance after a valid registration. 59 | * 60 | * @param array $data 61 | * @return User 62 | */ 63 | protected function create(array $data) 64 | { 65 | return User::create([ 66 | 'name' => $data['name'], 67 | 'email' => $data['email'], 68 | 'password' => bcrypt($data['password']), 69 | ]); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /app/Http/Controllers/Auth/ResetPasswordController.php: -------------------------------------------------------------------------------- 1 | middleware('guest'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Controllers/CodelistController.php: -------------------------------------------------------------------------------- 1 | with('codelists', $codelists); 21 | } 22 | 23 | /** 24 | * Show the specified codelist 25 | * 26 | * @param int $number 27 | * @return Response 28 | */ 29 | public function show($number) 30 | { 31 | $codelist = Codelist::where('number', $number)->firstOrFail(); 32 | return view('codes')->with('codelist', $codelist); 33 | } 34 | 35 | /** 36 | * Rudimentary search through Algolia 37 | * @param Request $request 38 | * @return Response 39 | */ 40 | public function search(Request $request) 41 | { 42 | $searchResults = Codelist::search($request->input('q'), ['hitsPerPage' => 9999]); 43 | 44 | // Array to store the codelist numbers found in search results 45 | $codelistNumbers = []; 46 | foreach ($searchResults['hits'] as $hit) { 47 | $codelistNumbers[] = $hit['number']; 48 | } 49 | 50 | $codelists = Codelist::whereIn('number', $codelistNumbers)->paginate(20); 51 | 52 | return view('codelists')->with('codelists', $codelists->appends($request->except('page'))); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | [ 27 | \App\Http\Middleware\EncryptCookies::class, 28 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 29 | \Illuminate\Session\Middleware\StartSession::class, 30 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 31 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 32 | \App\Http\Middleware\VerifyCsrfToken::class, 33 | ], 34 | 35 | 'api' => [ 36 | 'throttle:60,1', 37 | 'bindings', 38 | ], 39 | ]; 40 | 41 | /** 42 | * The application's route middleware. 43 | * 44 | * These middleware may be assigned to groups or used individually. 45 | * 46 | * @var array 47 | */ 48 | protected $routeMiddleware = [ 49 | 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 50 | 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 51 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 52 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 53 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 54 | ]; 55 | } 56 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | check()) { 21 | return redirect('/home'); 22 | } 23 | 24 | return $next($request); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.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 | id === (int) $userId; 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Providers/EventServiceProvider.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'App\Listeners\EventListener', 18 | ], 19 | ]; 20 | 21 | /** 22 | * Register any events for your application. 23 | * 24 | * @return void 25 | */ 26 | public function boot() 27 | { 28 | parent::boot(); 29 | 30 | // 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | mapApiRoutes(); 39 | 40 | $this->mapWebRoutes(); 41 | 42 | // 43 | } 44 | 45 | /** 46 | * Define the "web" routes for the application. 47 | * 48 | * These routes all receive session state, CSRF protection, etc. 49 | * 50 | * @return void 51 | */ 52 | protected function mapWebRoutes() 53 | { 54 | Route::group([ 55 | 'middleware' => 'web', 56 | 'namespace' => $this->namespace, 57 | ], function ($router) { 58 | require base_path('routes/web.php'); 59 | }); 60 | } 61 | 62 | /** 63 | * Define the "api" routes for the application. 64 | * 65 | * These routes are typically stateless. 66 | * 67 | * @return void 68 | */ 69 | protected function mapApiRoutes() 70 | { 71 | Route::group([ 72 | 'middleware' => 'api', 73 | 'namespace' => $this->namespace, 74 | 'prefix' => 'api', 75 | ], function ($router) { 76 | require base_path('routes/api.php'); 77 | }); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /app/Schemas/ONIX_XHTML_Subset.rng: -------------------------------------------------------------------------------- 1 | 2 | 75 | 76 | 77 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | rect 158 | circle 159 | poly 160 | default 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | ltr 211 | rtl 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | preserve 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | ltr 681 | rtl 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 887 | 970 | 976 | 1009 | 1010 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | ismap 1056 | 1057 | 1058 | 1059 | 1060 | 1064 | 1065 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | nohref 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1150 | 1151 | 1152 | void 1153 | above 1154 | below 1155 | hsides 1156 | lhs 1157 | rhs 1158 | vsides 1159 | box 1160 | border 1161 | 1162 | 1163 | 1169 | 1170 | 1171 | none 1172 | groups 1173 | rows 1174 | cols 1175 | all 1176 | 1177 | 1178 | 1179 | 1185 | 1186 | 1187 | 1188 | 1189 | left 1190 | center 1191 | right 1192 | justify 1193 | char 1194 | 1195 | 1196 | 1197 | 1198 | 1199 | 1200 | 1201 | 1202 | 1203 | 1204 | 1205 | 1206 | 1207 | 1208 | 1209 | 1210 | 1211 | 1212 | 1213 | top 1214 | middle 1215 | bottom 1216 | baseline 1217 | 1218 | 1219 | 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | 1241 | 1242 | 1243 | 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1275 | 1276 | 1277 | 1278 | 1279 | 1280 | 1281 | 1282 | 1283 | 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | 1290 | 1291 | 1292 | 1293 | 1294 | 1295 | 1296 | 1297 | 1298 | 1299 | 1300 | 1301 | 1302 | 1303 | 1304 | 1305 | 1306 | 1307 | 1308 | 1309 | 1310 | 1311 | 1312 | 1313 | 1314 | 1315 | 1316 | 1317 | 1318 | 1319 | 1320 | 1321 | 1322 | 1323 | 1324 | 1325 | 1326 | 1327 | 1328 | 1329 | 1330 | 1331 | 1332 | 1333 | 1334 | 1335 | 1336 | 1337 | 1338 | 1339 | 1340 | 1341 | 1342 | 1343 | 1344 | 1345 | 1346 | 1347 | 1348 | 1349 | 1350 | 1351 | 1352 | 1353 | 1354 | 1355 | 1356 | 1357 | 1358 | 1359 | 1363 | 1364 | 1365 | 1366 | 1367 | 1368 | 1369 | 1370 | 1371 | 1372 | 1373 | 1374 | 1375 | 1376 | 1377 | 1378 | 1390 | 1391 | 1392 | 1393 | 1394 | 1395 | 1396 | 1397 | 1398 | 1399 | 1400 | 1401 | 1402 | 1403 | 1404 | 1405 | 1417 | 1418 | 1419 | 1420 | 1421 | 1422 | 1423 | 1424 | 1425 | 1426 | 1427 | 1428 | 1429 | 1430 | 1431 | 1432 | 1433 | 1434 | 1435 | 1436 | 1437 | 1438 | 1439 | 1440 | row 1441 | col 1442 | rowgroup 1443 | colgroup 1444 | 1445 | 1446 | 1447 | 1448 | 1449 | 1450 | 1451 | 1452 | 1453 | 1454 | 1455 | 1456 | 1457 | 1458 | 1459 | 1460 | 1461 | 1462 | 1463 | 1464 | 1465 | 1466 | 1467 | 1468 | 1469 | 1470 | 1471 | 1472 | 1473 | 1474 | 1475 | 1476 | 1477 | 1478 | 1479 | 1480 | 1481 | 1482 | 1483 | 1484 | 1485 | 1486 | 1487 | 1488 | 1489 | 1490 | 1491 | 1492 | 1493 | 1494 | 1495 | 1496 | 1497 | 1498 | 1499 | 1500 | 1501 | 1502 | 1503 | 1504 | 1505 | 1506 | 1507 | 1508 | 1509 | 1510 | 1511 | 1512 | 1513 | 1514 | 1515 | 1516 | 1517 | 1518 | 1519 | 1520 | 1521 | 1522 | 1523 | 1524 | 1525 | 1526 | 1527 | 1528 | 1529 | 1530 | 1531 | 1532 | 1533 | 1534 | 1535 | 1536 | 1537 | 1538 | 1539 | 1540 | 1541 | 1542 | 1543 | 1544 | 1545 | 1546 | 1547 | 1548 | 1549 | 1550 | 1551 | 1552 | 1553 | 1554 | 1555 | 1556 | 1557 | 1558 | 1559 | 1560 | 1561 | 1562 | 1563 | 1564 | 1565 | 1566 | 1567 | 1568 | 1569 | 1570 | 1571 | 1572 | 1573 | 1574 | 1575 | 1576 | 1577 | 1578 | 1579 | 1580 | 1581 | 1582 | 1583 | 1584 | 1585 | 1586 | 1587 | 1588 | 1589 | 1590 | 1591 | 1592 | 1593 | 1594 | 1595 | 1596 | 1597 | 1598 | 1599 | 1600 | 1601 | 1602 | 1603 | 1604 | -------------------------------------------------------------------------------- /app/User.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class); 32 | 33 | $status = $kernel->handle( 34 | $input = new Symfony\Component\Console\Input\ArgvInput, 35 | new Symfony\Component\Console\Output\ConsoleOutput 36 | ); 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Shutdown The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once Artisan has finished running. We will fire off the shutdown events 44 | | so that any final work may be done by the application before we shut 45 | | down the process. This is the last thing to happen to the request. 46 | | 47 | */ 48 | 49 | $kernel->terminate($input, $status); 50 | 51 | exit($status); 52 | -------------------------------------------------------------------------------- /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/autoload.php: -------------------------------------------------------------------------------- 1 | =5.6.4", 12 | "laravel/framework": "5.5.*", 13 | "guzzlehttp/guzzle": "~6.0", 14 | "league/uri": "^5.0", 15 | "algolia/algoliasearch-laravel": "^1.0", 16 | "dingo/api": "v2.0.0-alpha1", 17 | "hieu-le/active": "^3.0", 18 | "ipunkt/laravel-analytics": "^1.1", 19 | "doctrine/dbal": "^2.5", 20 | "predis/predis": "^1.1", 21 | "dimsav/laravel-translatable": "^6.0", 22 | "pda/pheanstalk": "~3.0" 23 | }, 24 | "require-dev": { 25 | "fzaninotto/faker": "~1.4", 26 | "mockery/mockery": "0.9.*", 27 | "phpunit/phpunit": "~6.0", 28 | "symfony/css-selector": "~4.0", 29 | "symfony/dom-crawler": "~4.0", 30 | "filp/whoops": "~2.0" 31 | }, 32 | "autoload": { 33 | "classmap": [ 34 | "database" 35 | ], 36 | "psr-4": { 37 | "App\\": "app/" 38 | } 39 | }, 40 | "autoload-dev": { 41 | "classmap": [ 42 | "tests/TestCase.php" 43 | ] 44 | }, 45 | "scripts": { 46 | "post-root-package-install": [ 47 | "php -r \"copy('.env.example', '.env');\"" 48 | ], 49 | "post-create-project-cmd": [ 50 | "php artisan key:generate" 51 | ], 52 | "post-install-cmd": [ 53 | "php artisan clear-compiled", 54 | "php artisan optimize" 55 | ], 56 | "pre-update-cmd": [ 57 | "php artisan clear-compiled" 58 | ], 59 | "post-update-cmd": [ 60 | "php artisan optimize" 61 | ], 62 | "post-autoload-dump": [ 63 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 64 | "@php artisan package:discover" 65 | ] 66 | }, 67 | "config": { 68 | "preferred-install": "dist" 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /config/algolia.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | return [ 13 | 14 | /* 15 | |-------------------------------------------------------------------------- 16 | | Default Connection Name 17 | |-------------------------------------------------------------------------- 18 | | 19 | | Here you may specify which of the connections below you wish to use as 20 | | your default connection for all work. Of course, you may use many 21 | | connections at once using the manager class. 22 | | 23 | */ 24 | 25 | 'default' => 'main', 26 | 27 | /* 28 | |-------------------------------------------------------------------------- 29 | | Algolia Connections 30 | |-------------------------------------------------------------------------- 31 | | 32 | | Here are each of the connections setup for your application. Example 33 | | configuration has been included, but you may add as many connections as 34 | | you would like. 35 | | 36 | */ 37 | 38 | 'connections' => [ 39 | 40 | 'main' => [ 41 | 'id' => env('ALGOLIA_APP_ID'), 42 | 'key' => env('ALGOLIA_API_KEY'), 43 | ], 44 | ], 45 | 46 | ]; 47 | -------------------------------------------------------------------------------- /config/api.php: -------------------------------------------------------------------------------- 1 | env('API_STANDARDS_TREE', 'x'), 22 | 23 | /* 24 | |-------------------------------------------------------------------------- 25 | | API Subtype 26 | |-------------------------------------------------------------------------- 27 | | 28 | | Your subtype will follow the standards tree you use when used in the 29 | | "Accept" header to negotiate the content type and version. 30 | | 31 | | For example: Accept: application/x.SUBTYPE.v1+json 32 | | 33 | */ 34 | 35 | 'subtype' => env('API_SUBTYPE', ''), 36 | 37 | /* 38 | |-------------------------------------------------------------------------- 39 | | Default API Version 40 | |-------------------------------------------------------------------------- 41 | | 42 | | This is the default version when strict mode is disabled and your API 43 | | is accessed via a web browser. It's also used as the default version 44 | | when generating your APIs documentation. 45 | | 46 | */ 47 | 48 | 'version' => env('API_VERSION', 'v1'), 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | Default API Prefix 53 | |-------------------------------------------------------------------------- 54 | | 55 | | A default prefix to use for your API routes so you don't have to 56 | | specify it for each group. 57 | | 58 | */ 59 | 60 | 'prefix' => env('API_PREFIX', null), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Default API Domain 65 | |-------------------------------------------------------------------------- 66 | | 67 | | A default domain to use for your API routes so you don't have to 68 | | specify it for each group. 69 | | 70 | */ 71 | 72 | 'domain' => env('API_DOMAIN', null), 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Name 77 | |-------------------------------------------------------------------------- 78 | | 79 | | When documenting your API using the API Blueprint syntax you can 80 | | configure a default name to avoid having to manually specify 81 | | one when using the command. 82 | | 83 | */ 84 | 85 | 'name' => env('API_NAME', null), 86 | 87 | /* 88 | |-------------------------------------------------------------------------- 89 | | Conditional Requests 90 | |-------------------------------------------------------------------------- 91 | | 92 | | Globally enable conditional requests so that an ETag header is added to 93 | | any successful response. Subsequent requests will perform a check and 94 | | will return a 304 Not Modified. This can also be enabled or disabled 95 | | on certain groups or routes. 96 | | 97 | */ 98 | 99 | 'conditionalRequest' => env('API_CONDITIONAL_REQUEST', true), 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Strict Mode 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Enabling strict mode will require clients to send a valid Accept header 107 | | with every request. This also voids the default API version, meaning 108 | | your API will not be browsable via a web browser. 109 | | 110 | */ 111 | 112 | 'strict' => env('API_STRICT', false), 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Debug Mode 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Enabling debug mode will result in error responses caused by thrown 120 | | exceptions to have a "debug" key that will be populated with 121 | | more detailed information on the exception. 122 | | 123 | */ 124 | 125 | 'debug' => env('API_DEBUG', false), 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Generic Error Format 130 | |-------------------------------------------------------------------------- 131 | | 132 | | When some HTTP exceptions are not caught and dealt with the API will 133 | | generate a generic error response in the format provided. Any 134 | | keys that aren't replaced with corresponding values will be 135 | | removed from the final response. 136 | | 137 | */ 138 | 139 | 'errorFormat' => [ 140 | 'message' => ':message', 141 | 'errors' => ':errors', 142 | 'code' => ':code', 143 | 'status_code' => ':status_code', 144 | 'debug' => ':debug', 145 | ], 146 | 147 | /* 148 | |-------------------------------------------------------------------------- 149 | | Authentication Providers 150 | |-------------------------------------------------------------------------- 151 | | 152 | | The authentication providers that should be used when attempting to 153 | | authenticate an incoming API request. 154 | | 155 | */ 156 | 157 | 'auth' => [ 158 | 159 | ], 160 | 161 | /* 162 | |-------------------------------------------------------------------------- 163 | | Throttling / Rate Limiting 164 | |-------------------------------------------------------------------------- 165 | | 166 | | Consumers of your API can be limited to the amount of requests they can 167 | | make. You can create your own throttles or simply change the default 168 | | throttles. 169 | | 170 | */ 171 | 172 | 'throttling' => [ 173 | 174 | ], 175 | 176 | /* 177 | |-------------------------------------------------------------------------- 178 | | Response Transformer 179 | |-------------------------------------------------------------------------- 180 | | 181 | | Responses can be transformed so that they are easier to format. By 182 | | default a Fractal transformer will be used to transform any 183 | | responses prior to formatting. You can easily replace 184 | | this with your own transformer. 185 | | 186 | */ 187 | 188 | 'transformer' => env('API_TRANSFORMER', Dingo\Api\Transformer\Adapter\Fractal::class), 189 | 190 | /* 191 | |-------------------------------------------------------------------------- 192 | | Response Formats 193 | |-------------------------------------------------------------------------- 194 | | 195 | | Responses can be returned in multiple formats by registering different 196 | | response formatters. You can also customize an existing response 197 | | formatter. 198 | | 199 | */ 200 | 201 | 'defaultFormat' => env('API_DEFAULT_FORMAT', 'json'), 202 | 203 | 'formats' => [ 204 | 205 | 'json' => Dingo\Api\Http\Response\Format\Json::class, 206 | 207 | ], 208 | 209 | ]; 210 | -------------------------------------------------------------------------------- /config/app.php: -------------------------------------------------------------------------------- 1 | 'Onix codelists', 16 | 17 | /* 18 | |-------------------------------------------------------------------------- 19 | | Application Environment 20 | |-------------------------------------------------------------------------- 21 | | 22 | | This value determines the "environment" your application is currently 23 | | running in. This may determine how you prefer to configure various 24 | | services your application utilizes. Set this in your ".env" file. 25 | | 26 | */ 27 | 28 | 'env' => env('APP_ENV', 'production'), 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Application Debug Mode 33 | |-------------------------------------------------------------------------- 34 | | 35 | | When your application is in debug mode, detailed error messages with 36 | | stack traces will be shown on every error that occurs within your 37 | | application. If disabled, a simple generic error page is shown. 38 | | 39 | */ 40 | 41 | 'debug' => env('APP_DEBUG', false), 42 | 43 | /* 44 | |-------------------------------------------------------------------------- 45 | | Application URL 46 | |-------------------------------------------------------------------------- 47 | | 48 | | This URL is used by the console to properly generate URLs when using 49 | | the Artisan command line tool. You should set this to the root of 50 | | your application so that it is used when running Artisan tasks. 51 | | 52 | */ 53 | 54 | 'url' => env('APP_URL', 'http://localhost'), 55 | 56 | /* 57 | |-------------------------------------------------------------------------- 58 | | Application Timezone 59 | |-------------------------------------------------------------------------- 60 | | 61 | | Here you may specify the default timezone for your application, which 62 | | will be used by the PHP date and date-time functions. We have gone 63 | | ahead and set this to a sensible default for you out of the box. 64 | | 65 | */ 66 | 67 | 'timezone' => 'UTC', 68 | 69 | /* 70 | |-------------------------------------------------------------------------- 71 | | Application Locale Configuration 72 | |-------------------------------------------------------------------------- 73 | | 74 | | The application locale determines the default locale that will be used 75 | | by the translation service provider. You are free to set this value 76 | | to any of the locales which will be supported by the application. 77 | | 78 | */ 79 | 80 | 'locale' => 'en', 81 | 82 | /* 83 | |-------------------------------------------------------------------------- 84 | | Application Fallback Locale 85 | |-------------------------------------------------------------------------- 86 | | 87 | | The fallback locale determines the locale to use when the current one 88 | | is not available. You may change the value to correspond to any of 89 | | the language folders that are provided through your application. 90 | | 91 | */ 92 | 93 | 'fallback_locale' => 'en', 94 | 95 | /* 96 | |-------------------------------------------------------------------------- 97 | | Encryption Key 98 | |-------------------------------------------------------------------------- 99 | | 100 | | This key is used by the Illuminate encrypter service and should be set 101 | | to a random, 32 character string, otherwise these encrypted strings 102 | | will not be safe. Please do this before deploying an application! 103 | | 104 | */ 105 | 106 | 'key' => env('APP_KEY'), 107 | 108 | 'cipher' => 'AES-256-CBC', 109 | 110 | /* 111 | |-------------------------------------------------------------------------- 112 | | Logging Configuration 113 | |-------------------------------------------------------------------------- 114 | | 115 | | Here you may configure the log settings for your application. Out of 116 | | the box, Laravel uses the Monolog PHP logging library. This gives 117 | | you a variety of powerful log handlers / formatters to utilize. 118 | | 119 | | Available Settings: "single", "daily", "syslog", "errorlog" 120 | | 121 | */ 122 | 123 | 'log' => env('APP_LOG', 'single'), 124 | 125 | /* 126 | |-------------------------------------------------------------------------- 127 | | Autoloaded Service Providers 128 | |-------------------------------------------------------------------------- 129 | | 130 | | The service providers listed here will be automatically loaded on the 131 | | request to your application. Feel free to add your own services to 132 | | this array to grant expanded functionality to your applications. 133 | | 134 | */ 135 | 136 | 'providers' => [ 137 | 138 | /* 139 | * Laravel Framework Service Providers... 140 | */ 141 | Illuminate\Auth\AuthServiceProvider::class, 142 | Illuminate\Broadcasting\BroadcastServiceProvider::class, 143 | Illuminate\Bus\BusServiceProvider::class, 144 | Illuminate\Cache\CacheServiceProvider::class, 145 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, 146 | Illuminate\Cookie\CookieServiceProvider::class, 147 | Illuminate\Database\DatabaseServiceProvider::class, 148 | Illuminate\Encryption\EncryptionServiceProvider::class, 149 | Illuminate\Filesystem\FilesystemServiceProvider::class, 150 | Illuminate\Foundation\Providers\FoundationServiceProvider::class, 151 | Illuminate\Hashing\HashServiceProvider::class, 152 | Illuminate\Mail\MailServiceProvider::class, 153 | Illuminate\Notifications\NotificationServiceProvider::class, 154 | Illuminate\Pagination\PaginationServiceProvider::class, 155 | Illuminate\Pipeline\PipelineServiceProvider::class, 156 | Illuminate\Queue\QueueServiceProvider::class, 157 | Illuminate\Redis\RedisServiceProvider::class, 158 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, 159 | Illuminate\Session\SessionServiceProvider::class, 160 | Illuminate\Translation\TranslationServiceProvider::class, 161 | Illuminate\Validation\ValidationServiceProvider::class, 162 | Illuminate\View\ViewServiceProvider::class, 163 | 164 | /* 165 | * Application Service Providers... 166 | */ 167 | App\Providers\AppServiceProvider::class, 168 | // App\Providers\BroadcastServiceProvider::class, 169 | App\Providers\AuthServiceProvider::class, 170 | App\Providers\EventServiceProvider::class, 171 | App\Providers\RouteServiceProvider::class, 172 | AlgoliaSearch\Laravel\AlgoliaServiceProvider::class, 173 | Dingo\Api\Provider\LaravelServiceProvider::class, 174 | HieuLe\Active\ActiveServiceProvider::class, 175 | Ipunkt\LaravelAnalytics\AnalyticsServiceProvider::class, 176 | Dimsav\Translatable\TranslatableServiceProvider::class, 177 | ], 178 | 179 | /* 180 | |-------------------------------------------------------------------------- 181 | | Class Aliases 182 | |-------------------------------------------------------------------------- 183 | | 184 | | This array of class aliases will be registered when this application 185 | | is started. However, feel free to register as many as you wish as 186 | | the aliases are "lazy" loaded so they don't hinder performance. 187 | | 188 | */ 189 | 190 | 'aliases' => [ 191 | 192 | 'App' => Illuminate\Support\Facades\App::class, 193 | 'Artisan' => Illuminate\Support\Facades\Artisan::class, 194 | 'Auth' => Illuminate\Support\Facades\Auth::class, 195 | 'Blade' => Illuminate\Support\Facades\Blade::class, 196 | 'Cache' => Illuminate\Support\Facades\Cache::class, 197 | 'Config' => Illuminate\Support\Facades\Config::class, 198 | 'Cookie' => Illuminate\Support\Facades\Cookie::class, 199 | 'Crypt' => Illuminate\Support\Facades\Crypt::class, 200 | 'DB' => Illuminate\Support\Facades\DB::class, 201 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 202 | 'Event' => Illuminate\Support\Facades\Event::class, 203 | 'File' => Illuminate\Support\Facades\File::class, 204 | 'Gate' => Illuminate\Support\Facades\Gate::class, 205 | 'Hash' => Illuminate\Support\Facades\Hash::class, 206 | 'Lang' => Illuminate\Support\Facades\Lang::class, 207 | 'Log' => Illuminate\Support\Facades\Log::class, 208 | 'Mail' => Illuminate\Support\Facades\Mail::class, 209 | 'Notification' => Illuminate\Support\Facades\Notification::class, 210 | 'Password' => Illuminate\Support\Facades\Password::class, 211 | 'Queue' => Illuminate\Support\Facades\Queue::class, 212 | 'Redirect' => Illuminate\Support\Facades\Redirect::class, 213 | 'Redis' => Illuminate\Support\Facades\Redis::class, 214 | 'Request' => Illuminate\Support\Facades\Request::class, 215 | 'Response' => Illuminate\Support\Facades\Response::class, 216 | 'Route' => Illuminate\Support\Facades\Route::class, 217 | 'Schema' => Illuminate\Support\Facades\Schema::class, 218 | 'Session' => Illuminate\Support\Facades\Session::class, 219 | 'Storage' => Illuminate\Support\Facades\Storage::class, 220 | 'URL' => Illuminate\Support\Facades\URL::class, 221 | 'Validator' => Illuminate\Support\Facades\Validator::class, 222 | 'View' => Illuminate\Support\Facades\View::class, 223 | 'Active' => HieuLe\Active\Facades\Active::class, 224 | 'Analytics' => Ipunkt\LaravelAnalytics\AnalyticsFacade::class, 225 | ], 226 | 227 | ]; 228 | -------------------------------------------------------------------------------- /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 | ], 48 | ], 49 | 50 | /* 51 | |-------------------------------------------------------------------------- 52 | | User 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' => 'eloquent', 70 | 'model' => App\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 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'pusher'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Broadcast Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may define all of the broadcast connections that will be used 24 | | to broadcast events to other systems or over websockets. Samples of 25 | | each available type of connection are provided inside this array. 26 | | 27 | */ 28 | 29 | 'connections' => [ 30 | 31 | 'pusher' => [ 32 | 'driver' => 'pusher', 33 | 'key' => env('PUSHER_KEY'), 34 | 'secret' => env('PUSHER_SECRET'), 35 | 'app_id' => env('PUSHER_APP_ID'), 36 | 'options' => [ 37 | // 38 | ], 39 | ], 40 | 41 | 'redis' => [ 42 | 'driver' => 'redis', 43 | 'connection' => 'default', 44 | ], 45 | 46 | 'log' => [ 47 | 'driver' => 'log', 48 | ], 49 | 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | */ 30 | 31 | 'stores' => [ 32 | 33 | 'apc' => [ 34 | 'driver' => 'apc', 35 | ], 36 | 37 | 'array' => [ 38 | 'driver' => 'array', 39 | ], 40 | 41 | 'database' => [ 42 | 'driver' => 'database', 43 | 'table' => 'cache', 44 | 'connection' => null, 45 | ], 46 | 47 | 'file' => [ 48 | 'driver' => 'file', 49 | 'path' => storage_path('framework/cache'), 50 | ], 51 | 52 | 'memcached' => [ 53 | 'driver' => 'memcached', 54 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 55 | 'sasl' => [ 56 | env('MEMCACHED_USERNAME'), 57 | env('MEMCACHED_PASSWORD'), 58 | ], 59 | 'options' => [ 60 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 61 | ], 62 | 'servers' => [ 63 | [ 64 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 65 | 'port' => env('MEMCACHED_PORT', 11211), 66 | 'weight' => 100, 67 | ], 68 | ], 69 | ], 70 | 71 | 'redis' => [ 72 | 'driver' => 'redis', 73 | 'connection' => 'default', 74 | ], 75 | 76 | ], 77 | 78 | /* 79 | |-------------------------------------------------------------------------- 80 | | Cache Key Prefix 81 | |-------------------------------------------------------------------------- 82 | | 83 | | When utilizing a RAM based store such as APC or Memcached, there might 84 | | be other applications utilizing the same cache. So, we'll specify a 85 | | value to get prefixed to all our keys so we can avoid collisions. 86 | | 87 | */ 88 | 89 | 'prefix' => 'laravel', 90 | 91 | ]; 92 | -------------------------------------------------------------------------------- /config/compile.php: -------------------------------------------------------------------------------- 1 | [ 17 | // 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled File Providers 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may list service providers which define a "compiles" function 26 | | that returns additional files that should be compiled, providing an 27 | | easy way to get common files from any packages you are utilizing. 28 | | 29 | */ 30 | 31 | 'providers' => [ 32 | // 33 | ], 34 | 35 | ]; 36 | -------------------------------------------------------------------------------- /config/database.php: -------------------------------------------------------------------------------- 1 | PDO::FETCH_OBJ, 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Default Database Connection Name 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may specify which of the database connections below you wish 24 | | to use as your default connection for all database work. Of course 25 | | you may use many connections at once using the Database library. 26 | | 27 | */ 28 | 29 | 'default' => env('DB_CONNECTION', 'mysql'), 30 | 31 | /* 32 | |-------------------------------------------------------------------------- 33 | | Database Connections 34 | |-------------------------------------------------------------------------- 35 | | 36 | | Here are each of the database connections setup for your application. 37 | | Of course, examples of configuring each database platform that is 38 | | supported by Laravel is shown below to make development simple. 39 | | 40 | | 41 | | All database work in Laravel is done through the PHP PDO facilities 42 | | so make sure you have the driver for your particular database of 43 | | choice installed on your machine before you begin development. 44 | | 45 | */ 46 | 47 | 'connections' => [ 48 | 49 | 'sqlite' => [ 50 | 'driver' => 'sqlite', 51 | 'database' => env('DB_DATABASE', database_path('database.sqlite')), 52 | 'prefix' => '', 53 | ], 54 | 55 | 'mysql' => [ 56 | 'driver' => 'mysql', 57 | 'host' => env('DB_HOST', 'localhost'), 58 | 'port' => env('DB_PORT', '3306'), 59 | 'database' => env('DB_DATABASE', 'forge'), 60 | 'username' => env('DB_USERNAME', 'forge'), 61 | 'password' => env('DB_PASSWORD', ''), 62 | 'charset' => 'utf8', 63 | 'collation' => 'utf8_unicode_ci', 64 | 'prefix' => '', 65 | 'strict' => true, 66 | 'engine' => null, 67 | ], 68 | 69 | 'pgsql' => [ 70 | 'driver' => 'pgsql', 71 | 'host' => env('DB_HOST', 'localhost'), 72 | 'port' => env('DB_PORT', '5432'), 73 | 'database' => env('DB_DATABASE', 'forge'), 74 | 'username' => env('DB_USERNAME', 'forge'), 75 | 'password' => env('DB_PASSWORD', ''), 76 | 'charset' => 'utf8', 77 | 'prefix' => '', 78 | 'schema' => 'public', 79 | 'sslmode' => 'prefer', 80 | ], 81 | 82 | ], 83 | 84 | /* 85 | |-------------------------------------------------------------------------- 86 | | Migration Repository Table 87 | |-------------------------------------------------------------------------- 88 | | 89 | | This table keeps track of all the migrations that have already run for 90 | | your application. Using this information, we can determine which of 91 | | the migrations on disk haven't actually been run in the database. 92 | | 93 | */ 94 | 95 | 'migrations' => 'migrations', 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Redis Databases 100 | |-------------------------------------------------------------------------- 101 | | 102 | | Redis is an open source, fast, and advanced key-value store that also 103 | | provides a richer set of commands than a typical key-value systems 104 | | such as APC or Memcached. Laravel makes it easy to dig right in. 105 | | 106 | */ 107 | 108 | 'redis' => [ 109 | 110 | 'cluster' => false, 111 | 112 | 'default' => [ 113 | 'host' => env('REDIS_HOST', 'localhost'), 114 | 'password' => env('REDIS_PASSWORD', null), 115 | 'port' => env('REDIS_PORT', 6379), 116 | 'database' => 0, 117 | ], 118 | 119 | ], 120 | 121 | ]; 122 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | 'local', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Default Cloud Filesystem Disk 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Many applications store files both locally and in the cloud. For this 26 | | reason, you may specify a default "cloud" driver here. This driver 27 | | will be bound as the Cloud disk implementation in the container. 28 | | 29 | */ 30 | 31 | 'cloud' => 's3', 32 | 33 | /* 34 | |-------------------------------------------------------------------------- 35 | | Filesystem Disks 36 | |-------------------------------------------------------------------------- 37 | | 38 | | Here you may configure as many filesystem "disks" as you wish, and you 39 | | may even configure multiple disks of the same driver. Defaults have 40 | | been setup for each driver as an example of the required options. 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 | 'visibility' => 'public', 55 | ], 56 | 57 | 's3' => [ 58 | 'driver' => 's3', 59 | 'key' => 'your-key', 60 | 'secret' => 'your-secret', 61 | 'region' => 'your-region', 62 | 'bucket' => 'your-bucket', 63 | ], 64 | 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_DRIVER', 'smtp'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | SMTP Host Address 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may provide the host address of the SMTP server used by your 27 | | applications. A default option is provided that is compatible with 28 | | the Mailgun mail service which will provide reliable deliveries. 29 | | 30 | */ 31 | 32 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 33 | 34 | /* 35 | |-------------------------------------------------------------------------- 36 | | SMTP Host Port 37 | |-------------------------------------------------------------------------- 38 | | 39 | | This is the SMTP port used by your application to deliver e-mails to 40 | | users of the application. Like the host we have set this value to 41 | | stay compatible with the Mailgun e-mail application by default. 42 | | 43 | */ 44 | 45 | 'port' => env('MAIL_PORT', 587), 46 | 47 | /* 48 | |-------------------------------------------------------------------------- 49 | | Global "From" Address 50 | |-------------------------------------------------------------------------- 51 | | 52 | | You may wish for all e-mails sent by your application to be sent from 53 | | the same address. Here, you may specify a name and address that is 54 | | used globally for all e-mails that are sent by your application. 55 | | 56 | */ 57 | 58 | 'from' => ['address' => null, 'name' => null], 59 | 60 | /* 61 | |-------------------------------------------------------------------------- 62 | | E-Mail Encryption Protocol 63 | |-------------------------------------------------------------------------- 64 | | 65 | | Here you may specify the encryption protocol that should be used when 66 | | the application send e-mail messages. A sensible default using the 67 | | transport layer security protocol should provide great security. 68 | | 69 | */ 70 | 71 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 72 | 73 | /* 74 | |-------------------------------------------------------------------------- 75 | | SMTP Server Username 76 | |-------------------------------------------------------------------------- 77 | | 78 | | If your SMTP server requires a username for authentication, you should 79 | | set it here. This will get used to authenticate with your server on 80 | | connection. You may also set the "password" value below this one. 81 | | 82 | */ 83 | 84 | 'username' => env('MAIL_USERNAME'), 85 | 86 | /* 87 | |-------------------------------------------------------------------------- 88 | | SMTP Server Password 89 | |-------------------------------------------------------------------------- 90 | | 91 | | Here you may set the password required by your SMTP server to send out 92 | | messages from your application. This will be given to the server on 93 | | connection so that the application will be able to send messages. 94 | | 95 | */ 96 | 97 | 'password' => env('MAIL_PASSWORD'), 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Sendmail System Path 102 | |-------------------------------------------------------------------------- 103 | | 104 | | When using the "sendmail" driver to send e-mails, we will need to know 105 | | the path to where Sendmail lives on this server. A default path has 106 | | been provided here, which will work well on most of your systems. 107 | | 108 | */ 109 | 110 | 'sendmail' => '/usr/sbin/sendmail -bs', 111 | 112 | ]; 113 | -------------------------------------------------------------------------------- /config/onix_codelist.php: -------------------------------------------------------------------------------- 1 | env('ISSUE_NUMBER', 40), 15 | 16 | ]; 17 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_DRIVER', 'sync'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Queue Connections 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may configure the connection information for each server that 27 | | is used by your application. A default configuration has been added 28 | | for each back-end shipped with Laravel. You are free to add more. 29 | | 30 | */ 31 | 32 | 'connections' => [ 33 | 34 | 'sync' => [ 35 | 'driver' => 'sync', 36 | ], 37 | 38 | 'database' => [ 39 | 'driver' => 'database', 40 | 'table' => 'jobs', 41 | 'queue' => 'default', 42 | 'retry_after' => 60, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 60, 50 | ], 51 | 52 | 'sqs' => [ 53 | 'driver' => 'sqs', 54 | 'key' => 'your-public-key', 55 | 'secret' => 'your-secret-key', 56 | 'prefix' => 'https://sqs.us-east-1.amazonaws.com/your-account-id', 57 | 'queue' => 'your-queue-name', 58 | 'region' => 'us-east-1', 59 | ], 60 | 61 | 'redis' => [ 62 | 'driver' => 'redis', 63 | 'connection' => 'default', 64 | 'queue' => 'default', 65 | 'retry_after' => 60, 66 | ], 67 | 68 | ], 69 | 70 | /* 71 | |-------------------------------------------------------------------------- 72 | | Failed Queue Jobs 73 | |-------------------------------------------------------------------------- 74 | | 75 | | These options configure the behavior of failed queue job logging so you 76 | | can control which database and table are used to store the jobs that 77 | | have failed. You may change them to any database / table you wish. 78 | | 79 | */ 80 | 81 | 'failed' => [ 82 | 'database' => env('DB_CONNECTION', 'mysql'), 83 | 'table' => 'failed_jobs', 84 | ], 85 | 86 | ]; 87 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | ], 21 | 22 | 'ses' => [ 23 | 'key' => env('SES_KEY'), 24 | 'secret' => env('SES_SECRET'), 25 | 'region' => 'us-east-1', 26 | ], 27 | 28 | 'sparkpost' => [ 29 | 'secret' => env('SPARKPOST_SECRET'), 30 | ], 31 | 32 | 'stripe' => [ 33 | 'model' => App\User::class, 34 | 'key' => env('STRIPE_KEY'), 35 | 'secret' => env('STRIPE_SECRET'), 36 | ], 37 | 38 | ]; 39 | -------------------------------------------------------------------------------- /config/session.php: -------------------------------------------------------------------------------- 1 | env('SESSION_DRIVER', 'file'), 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Session Lifetime 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Here you may specify the number of minutes that you wish the session 27 | | to be allowed to remain idle before it expires. If you want them 28 | | to immediately expire on the browser closing, set that option. 29 | | 30 | */ 31 | 32 | 'lifetime' => 120, 33 | 34 | 'expire_on_close' => false, 35 | 36 | /* 37 | |-------------------------------------------------------------------------- 38 | | Session Encryption 39 | |-------------------------------------------------------------------------- 40 | | 41 | | This option allows you to easily specify that all of your session data 42 | | should be encrypted before it is stored. All encryption will be run 43 | | automatically by Laravel and you can use the Session like normal. 44 | | 45 | */ 46 | 47 | 'encrypt' => false, 48 | 49 | /* 50 | |-------------------------------------------------------------------------- 51 | | Session File Location 52 | |-------------------------------------------------------------------------- 53 | | 54 | | When using the native session driver, we need a location where session 55 | | files may be stored. A default has been set for you but a different 56 | | location may be specified. This is only needed for file sessions. 57 | | 58 | */ 59 | 60 | 'files' => storage_path('framework/sessions'), 61 | 62 | /* 63 | |-------------------------------------------------------------------------- 64 | | Session Database Connection 65 | |-------------------------------------------------------------------------- 66 | | 67 | | When using the "database" or "redis" session drivers, you may specify a 68 | | connection that should be used to manage these sessions. This should 69 | | correspond to a connection in your database configuration options. 70 | | 71 | */ 72 | 73 | 'connection' => null, 74 | 75 | /* 76 | |-------------------------------------------------------------------------- 77 | | Session Database Table 78 | |-------------------------------------------------------------------------- 79 | | 80 | | When using the "database" session driver, you may specify the table we 81 | | should use to manage the sessions. Of course, a sensible default is 82 | | provided for you; however, you are free to change this as needed. 83 | | 84 | */ 85 | 86 | 'table' => 'sessions', 87 | 88 | /* 89 | |-------------------------------------------------------------------------- 90 | | Session Cache Store 91 | |-------------------------------------------------------------------------- 92 | | 93 | | When using the "apc" or "memcached" session drivers, you may specify a 94 | | cache store that should be used for these sessions. This value must 95 | | correspond with one of the application's configured cache stores. 96 | | 97 | */ 98 | 99 | 'store' => null, 100 | 101 | /* 102 | |-------------------------------------------------------------------------- 103 | | Session Sweeping Lottery 104 | |-------------------------------------------------------------------------- 105 | | 106 | | Some session drivers must manually sweep their storage location to get 107 | | rid of old sessions from storage. Here are the chances that it will 108 | | happen on a given request. By default, the odds are 2 out of 100. 109 | | 110 | */ 111 | 112 | 'lottery' => [2, 100], 113 | 114 | /* 115 | |-------------------------------------------------------------------------- 116 | | Session Cookie Name 117 | |-------------------------------------------------------------------------- 118 | | 119 | | Here you may change the name of the cookie used to identify a session 120 | | instance by ID. The name specified here will get used every time a 121 | | new session cookie is created by the framework for every driver. 122 | | 123 | */ 124 | 125 | 'cookie' => 'laravel_session', 126 | 127 | /* 128 | |-------------------------------------------------------------------------- 129 | | Session Cookie Path 130 | |-------------------------------------------------------------------------- 131 | | 132 | | The session cookie path determines the path for which the cookie will 133 | | be regarded as available. Typically, this will be the root path of 134 | | your application but you are free to change this when necessary. 135 | | 136 | */ 137 | 138 | 'path' => '/', 139 | 140 | /* 141 | |-------------------------------------------------------------------------- 142 | | Session Cookie Domain 143 | |-------------------------------------------------------------------------- 144 | | 145 | | Here you may change the domain of the cookie used to identify a session 146 | | in your application. This will determine which domains the cookie is 147 | | available to in your application. A sensible default has been set. 148 | | 149 | */ 150 | 151 | 'domain' => env('SESSION_DOMAIN', null), 152 | 153 | /* 154 | |-------------------------------------------------------------------------- 155 | | HTTPS Only Cookies 156 | |-------------------------------------------------------------------------- 157 | | 158 | | By setting this option to true, session cookies will only be sent back 159 | | to the server if the browser has a HTTPS connection. This will keep 160 | | the cookie from being sent to you if it can not be done securely. 161 | | 162 | */ 163 | 164 | 'secure' => env('SESSION_SECURE_COOKIE', false), 165 | 166 | /* 167 | |-------------------------------------------------------------------------- 168 | | HTTP Access Only 169 | |-------------------------------------------------------------------------- 170 | | 171 | | Setting this value to true will prevent JavaScript from accessing the 172 | | value of the cookie and the cookie will only be accessible through 173 | | the HTTP protocol. You are free to modify this option if needed. 174 | | 175 | */ 176 | 177 | 'http_only' => true, 178 | 179 | ]; 180 | -------------------------------------------------------------------------------- /config/translatable.php: -------------------------------------------------------------------------------- 1 | [ 14 | 'en', 15 | 'es', 16 | ], 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Locale separator 21 | |-------------------------------------------------------------------------- 22 | | 23 | | This is a string used to glue the language and the country when defining 24 | | the available locales. Example: if set to '-', then the locale for 25 | | colombian spanish will be saved as 'es-CO' into the database. 26 | | 27 | */ 28 | 'locale_separator' => '-', 29 | 30 | /* 31 | |-------------------------------------------------------------------------- 32 | | Default locale 33 | |-------------------------------------------------------------------------- 34 | | 35 | | As a default locale, Translatable takes the locale of Laravel's 36 | | translator. If for some reason you want to override this, 37 | | you can specify what default should be used here. 38 | | 39 | */ 40 | 'locale' => 'en', 41 | 42 | /* 43 | |-------------------------------------------------------------------------- 44 | | Use fallback 45 | |-------------------------------------------------------------------------- 46 | | 47 | | Determine if fallback locales are returned by default or not. To add 48 | | more flexibility and configure this option per "translatable" 49 | | instance, this value will be overridden by the property 50 | | $useTranslationFallback when defined 51 | | 52 | */ 53 | 'use_fallback' => false, 54 | 55 | /* 56 | |-------------------------------------------------------------------------- 57 | | Fallback Locale 58 | |-------------------------------------------------------------------------- 59 | | 60 | | A fallback locale is the locale being used to return a translation 61 | | when the requested translation is not existing. To disable it 62 | | set it to false. 63 | | 64 | */ 65 | 'fallback_locale' => 'en', 66 | 67 | /* 68 | |-------------------------------------------------------------------------- 69 | | Translation Suffix 70 | |-------------------------------------------------------------------------- 71 | | 72 | | Defines the default 'Translation' class suffix. For example, if 73 | | you want to use CountryTrans instead of CountryTranslation 74 | | application, set this to 'Trans'. 75 | | 76 | */ 77 | 'translation_suffix' => 'Translation', 78 | 79 | /* 80 | |-------------------------------------------------------------------------- 81 | | Locale key 82 | |-------------------------------------------------------------------------- 83 | | 84 | | Defines the 'locale' field name, which is used by the 85 | | translation model. 86 | | 87 | */ 88 | 'locale_key' => 'locale', 89 | 90 | ]; 91 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | realpath(base_path('resources/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' => realpath(storage_path('framework/views')), 32 | 33 | ]; 34 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite 2 | -------------------------------------------------------------------------------- /database/factories/ModelFactory.php: -------------------------------------------------------------------------------- 1 | define(App\User::class, function (Faker\Generator $faker) { 15 | return [ 16 | 'name' => $faker->name, 17 | 'email' => $faker->safeEmail, 18 | 'password' => bcrypt(str_random(10)), 19 | 'remember_token' => str_random(10), 20 | ]; 21 | }); 22 | -------------------------------------------------------------------------------- /database/migrations/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->string('name'); 19 | $table->string('email')->unique(); 20 | $table->string('password'); 21 | $table->rememberToken(); 22 | $table->timestamps(); 23 | }); 24 | } 25 | 26 | /** 27 | * Reverse the migrations. 28 | * 29 | * @return void 30 | */ 31 | public function down() 32 | { 33 | Schema::drop('users'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token')->index(); 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::drop('password_resets'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2016_03_14_204109_create_codelists_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->timestamps(); 18 | $table->integer('number')->unsigned(); 19 | $table->integer('issue_number'); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::drop('codelists'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /database/migrations/2016_03_14_204347_create_codes_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->timestamps(); 18 | $table->integer('codelist_id')->unsigned(); 19 | $table->string('value'); 20 | $table->integer('issue_number'); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('codes'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2016_03_22_200201_create_elements_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 17 | $table->timestamps(); 18 | $table->string('reference_name'); 19 | $table->string('short_name'); 20 | $table->integer('codelist_id')->unsigned(); 21 | }); 22 | } 23 | 24 | /** 25 | * Reverse the migrations. 26 | * 27 | * @return void 28 | */ 29 | public function down() 30 | { 31 | Schema::drop('elements'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /database/migrations/2016_09_14_093751_make_codelist_issue_number_nullable.php: -------------------------------------------------------------------------------- 1 | integer('issue_number')->nullable()->change(); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('codelists', function ($table) { 28 | $table->integer('issue_number')->change(); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/migrations/2016_11_24_113429_create_codelist_translations_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->timestamps(); 19 | $table->integer('codelist_id')->unsigned(); 20 | $table->string('description'); 21 | $table->string('locale')->index(); 22 | $table->unique(['codelist_id', 'locale']); 23 | $table->foreign('codelist_id')->references('id')->on('codelists')->onDelete('cascade'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('codelist_translations'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /database/migrations/2016_11_24_122306_create_code_translation_table.php: -------------------------------------------------------------------------------- 1 | increments('id'); 18 | $table->timestamps(); 19 | $table->integer('code_id')->unsigned(); 20 | $table->string('description'); 21 | $table->longtext('notes')->nullable(); 22 | $table->string('locale')->index(); 23 | $table->unique(['code_id', 'locale']); 24 | $table->foreign('code_id')->references('id')->on('codes')->onDelete('cascade'); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('code_translations'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /database/migrations/2018_01_24_142522_add_last_issue_modified_at_to_codes_table.php: -------------------------------------------------------------------------------- 1 | integer('last_issue_modified_at')->nullable(); 17 | }); 18 | } 19 | 20 | /** 21 | * Reverse the migrations. 22 | * 23 | * @return void 24 | */ 25 | public function down() 26 | { 27 | Schema::table('codes', function ($table) { 28 | Schema::dropIfExists('last_issue_modified_at'); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /database/seeds/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /database/seeds/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | call(UsersTableSeeder::class); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | const elixir = require('laravel-elixir'); 2 | 3 | require('laravel-elixir-vue'); 4 | 5 | /* 6 | |-------------------------------------------------------------------------- 7 | | Elixir Asset Management 8 | |-------------------------------------------------------------------------- 9 | | 10 | | Elixir provides a clean, fluent API for defining some basic Gulp tasks 11 | | for your Laravel application. By default, we are compiling the Sass 12 | | file for our application, as well as publishing vendor resources. 13 | | 14 | */ 15 | 16 | elixir(mix => { 17 | mix.sass('app.scss') 18 | .webpack('app.js'); 19 | }); 20 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Lasse Lehtinen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private":true, 3 | "scripts":{ 4 | "prod":"gulp --production", 5 | "dev":"gulp watch" 6 | }, 7 | "devDependencies":{ 8 | "bootstrap-sass":"^3.3.7", 9 | "gulp":"^3.9.1", 10 | "jquery":"^3.1.0", 11 | "laravel-elixir":"^6.0.0-9", 12 | "laravel-elixir-vue":"^0.1.4", 13 | "laravel-elixir-webpack-official":"^1.0.2", 14 | "lodash":"^4.14.0", 15 | "vue":"^1.0.26", 16 | "vue-resource":"^0.9.3" 17 | } 18 | } -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | ./tests/ 14 | 15 | 16 | 17 | 18 | app/ 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Redirect Trailing Slashes If Not A Folder... 9 | RewriteCond %{REQUEST_FILENAME} !-d 10 | RewriteRule ^(.*)/$ /$1 [L,R=301] 11 | 12 | # Handle Front Controller... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_FILENAME} !-f 15 | RewriteRule ^ index.php [L] 16 | 17 | # Handle Authorization Header 18 | RewriteCond %{HTTP:Authorization} . 19 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 20 | 21 | -------------------------------------------------------------------------------- /public/algolia-autocomplete.css: -------------------------------------------------------------------------------- 1 | .algolia-autocomplete { 2 | width: 100%; 3 | } 4 | .algolia-autocomplete .aa-input, .algolia-autocomplete .aa-hint { 5 | width: 100%; 6 | } 7 | .algolia-autocomplete .aa-hint { 8 | color: #999; 9 | } 10 | .algolia-autocomplete .aa-dropdown-menu { 11 | width: 100%; 12 | background-color: #fff; 13 | border: 1px solid #999; 14 | border-top: none; 15 | } 16 | .algolia-autocomplete .aa-dropdown-menu .aa-suggestion { 17 | cursor: pointer; 18 | padding: 5px 4px; 19 | } 20 | .algolia-autocomplete .aa-dropdown-menu .aa-suggestion.aa-cursor { 21 | background-color: #B2D7FF; 22 | } 23 | .algolia-autocomplete .aa-dropdown-menu .aa-suggestion em { 24 | font-weight: bold; 25 | font-style: normal; 26 | } 27 | .algolia-autocomplete .category { 28 | text-align: left; 29 | background: #efefef; 30 | padding: 10px 5px; 31 | font-weight: bold; 32 | } -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lasselehtinen/onix-codelist/aa95851feb750e1e26a87893883d38b4f53161a3/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | /* 11 | |-------------------------------------------------------------------------- 12 | | Register The Auto Loader 13 | |-------------------------------------------------------------------------- 14 | | 15 | | Composer provides a convenient, automatically generated class loader for 16 | | our application. We just need to utilize it! We'll simply require it 17 | | into the script here so that we don't have to worry about manual 18 | | loading any of our classes later on. It feels nice to relax. 19 | | 20 | */ 21 | 22 | require __DIR__.'/../bootstrap/autoload.php'; 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Turn On The Lights 27 | |-------------------------------------------------------------------------- 28 | | 29 | | We need to illuminate PHP development, so let us turn on the lights. 30 | | This bootstraps the framework and gets it ready for use, then it 31 | | will load up this application so that we can run it and send 32 | | the responses back to the browser and delight our users. 33 | | 34 | */ 35 | 36 | $app = require_once __DIR__.'/../bootstrap/app.php'; 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Run The Application 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Once we have the application, we can handle the incoming request 44 | | through the kernel, and send the associated response back to 45 | | the client's browser allowing them to enjoy the creative 46 | | and wonderful application we have prepared for them. 47 | | 48 | */ 49 | 50 | $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class); 51 | 52 | $response = $kernel->handle( 53 | $request = Illuminate\Http\Request::capture() 54 | ); 55 | 56 | $response->send(); 57 | 58 | $kernel->terminate($request, $response); 59 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/search.js: -------------------------------------------------------------------------------- 1 | var instantsearch = instantsearch; 2 | 3 | var search = instantsearch({ 4 | appId: '0AX2Y3FFW8', // Mandatory 5 | apiKey: 'ed59fb1126ff48502e68207c0488c5ba', // Mandatory 6 | indexName: 'codelists', // Mandatory 7 | urlSync: { // optionnal, activate url sync if defined 8 | useHash: false 9 | } 10 | }); 11 | 12 | // Add a searchBox widget 13 | search.addWidget( 14 | instantsearch.widgets.searchBox({ 15 | container: '#search-box', 16 | placeholder: 'Search for libraries in France...' 17 | }) 18 | ); 19 | 20 | var hitTemplate = 21 | '

{{description}}

'; 22 | 23 | var noResultsTemplate = 24 | '
No results found matching {{query}}.
'; 25 | 26 | // Add a hits widget 27 | search.addWidget( 28 | instantsearch.widgets.hits({ 29 | container: '#hits-container', 30 | hitsPerPage: 10, 31 | templates: { 32 | empty: noResultsTemplate, 33 | item: hitTemplate 34 | }, 35 | }) 36 | ); 37 | 38 | // start 39 | search.start(); -------------------------------------------------------------------------------- /public/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # About 2 | This is a hobby weekend project I did because I found myself quite often searching through the [Onix codelists](http://www.editeur.org/14/Code-Lists/). The auto-complete search is indexed with codelists and codelist code descriptions and notes. It also has a simple REST API if you need one. I hope you might find this service useful. Feel free to [create an issue](https://github.com/lasselehtinen/onix-codelist/issues) if you have some development wishes.

3 | 4 | # Live demo 5 | You can find a live version of the app at https://onix-codelists.io 6 | -------------------------------------------------------------------------------- /resources/assets/sass/app.scss: -------------------------------------------------------------------------------- 1 | // @import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap"; 2 | 3 | -------------------------------------------------------------------------------- /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 six characters and match the confirmation.', 17 | 'reset' => 'Your password has been reset!', 18 | 'sent' => 'We have e-mailed your password reset link!', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that e-mail address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /resources/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 | '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 | 'distinct' => 'The :attribute field has a duplicate value.', 38 | 'email' => 'The :attribute must be a valid email address.', 39 | 'exists' => 'The selected :attribute is invalid.', 40 | 'filled' => 'The :attribute field is required.', 41 | 'image' => 'The :attribute must be an image.', 42 | 'in' => 'The selected :attribute is invalid.', 43 | 'in_array' => 'The :attribute field does not exist in :other.', 44 | 'integer' => 'The :attribute must be an integer.', 45 | 'ip' => 'The :attribute must be a valid IP address.', 46 | 'json' => 'The :attribute must be a valid JSON string.', 47 | 'max' => [ 48 | 'numeric' => 'The :attribute may not be greater than :max.', 49 | 'file' => 'The :attribute may not be greater than :max kilobytes.', 50 | 'string' => 'The :attribute may not be greater than :max characters.', 51 | 'array' => 'The :attribute may not have more than :max items.', 52 | ], 53 | 'mimes' => 'The :attribute must be a file of type: :values.', 54 | 'min' => [ 55 | 'numeric' => 'The :attribute must be at least :min.', 56 | 'file' => 'The :attribute must be at least :min kilobytes.', 57 | 'string' => 'The :attribute must be at least :min characters.', 58 | 'array' => 'The :attribute must have at least :min items.', 59 | ], 60 | 'not_in' => 'The selected :attribute is invalid.', 61 | 'numeric' => 'The :attribute must be a number.', 62 | 'present' => 'The :attribute field must be present.', 63 | 'regex' => 'The :attribute format is invalid.', 64 | 'required' => 'The :attribute field is required.', 65 | 'required_if' => 'The :attribute field is required when :other is :value.', 66 | 'required_unless' => 'The :attribute field is required unless :other is in :values.', 67 | 'required_with' => 'The :attribute field is required when :values is present.', 68 | 'required_with_all' => 'The :attribute field is required when :values is present.', 69 | 'required_without' => 'The :attribute field is required when :values is not present.', 70 | 'required_without_all' => 'The :attribute field is required when none of :values are present.', 71 | 'same' => 'The :attribute and :other must match.', 72 | 'size' => [ 73 | 'numeric' => 'The :attribute must be :size.', 74 | 'file' => 'The :attribute must be :size kilobytes.', 75 | 'string' => 'The :attribute must be :size characters.', 76 | 'array' => 'The :attribute must contain :size items.', 77 | ], 78 | 'string' => 'The :attribute must be a string.', 79 | 'timezone' => 'The :attribute must be a valid zone.', 80 | 'unique' => 'The :attribute has already been taken.', 81 | 'url' => 'The :attribute format is invalid.', 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Custom Validation Language Lines 86 | |-------------------------------------------------------------------------- 87 | | 88 | | Here you may specify custom validation messages for attributes using the 89 | | convention "attribute.rule" to name the lines. This makes it quick to 90 | | specify a specific custom language line for a given attribute rule. 91 | | 92 | */ 93 | 94 | 'custom' => [ 95 | 'attribute-name' => [ 96 | 'rule-name' => 'custom-message', 97 | ], 98 | ], 99 | 100 | /* 101 | |-------------------------------------------------------------------------- 102 | | Custom Validation Attributes 103 | |-------------------------------------------------------------------------- 104 | | 105 | | The following language lines are used to swap attribute place-holders 106 | | with something more reader friendly such as E-Mail Address instead 107 | | of "email". This simply helps us make messages a little cleaner. 108 | | 109 | */ 110 | 111 | 'attributes' => [], 112 | 113 | ]; 114 | -------------------------------------------------------------------------------- /resources/views/about.blade.php: -------------------------------------------------------------------------------- 1 | @extends('shared.master') 2 | 3 | @section('title', 'Onix codelists - About') 4 | 5 | @section('content') 6 |

About ONIX for Books codelists

7 | 8 |

This is a hobby weekend project I did because I found myself quite often searching through the Onix codelists. The auto-complete search 9 | is indexed with codelists and codelist code descriptions and notes. I hope you might find this service useful. The site is built on 10 | Laravel and the source code is provided as open-source 11 | with MIT license in Github. So please create an issue if you have any wishes.

12 | @endsection -------------------------------------------------------------------------------- /resources/views/api-docs.blade.php: -------------------------------------------------------------------------------- 1 | 2 | @extends('shared.master') 3 | 4 | @section('title', 'API documentation') 5 | 6 | @section('content') 7 |

API documentation

8 | 9 |

The REST API documentation can be found in Apiary. There is no need for 10 | authentication. Below you can also find a link to a Postman collection. 11 |

12 | 13 |
16 | 25 | 26 | @endsection -------------------------------------------------------------------------------- /resources/views/codelists.blade.php: -------------------------------------------------------------------------------- 1 | 2 | @extends('shared.master') 3 | 4 | @section('title', 'Onix codelists') 5 | 6 | @section('content') 7 |

Onix codelists

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | @foreach ($codelists as $codelist) 20 | 21 | 22 | 23 | 24 | 25 | 26 | @endforeach 27 | 28 |
NumberDescriptionIssue numberCode values
{{ $codelist->number }}{{ $codelist->translate()->description }}{{ $codelist->issue_number }}
29 | 30 | {!! $codelists->render() !!} 31 | @endsection 32 | -------------------------------------------------------------------------------- /resources/views/codes.blade.php: -------------------------------------------------------------------------------- 1 | @extends('shared.master') 2 | 3 | @section('title', 'Onix codelist ' . $codelist->number . ' - ' . $codelist->description) 4 | 5 | @section('content') 6 |

List {{ $codelist->number }}: {{ $codelist->description }}

7 | Last updated in issue {{ $codelist->codes->max('last_issue_modified_at') }} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | @foreach ($codelist->codes as $code) 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | @endforeach 29 | 30 |
ValueDescriptionNotesIssue numberModified in Issue
{{ $code->value }}{{ $code->translate()->description }}{{ $code->translate()->notes }}{{ $code->issue_number }}{{ $code->last_issue_modified_at }}
31 | 32 | Back to Codelists 33 | @endsection 34 | -------------------------------------------------------------------------------- /resources/views/errors/404.blade.php: -------------------------------------------------------------------------------- 1 | @extends('shared.master') 2 | 3 | @section('title', 'Onix codelist') 4 | 5 | @section('content') 6 |

Whoops!

7 | 8 |

That page could not be found.

9 | 10 | Go back 11 | @endsection -------------------------------------------------------------------------------- /resources/views/errors/503.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Be right back. 5 | 6 | 7 | 8 | 39 | 40 | 41 |
42 |
43 |
Be right back.
44 |
45 |
46 | 47 | 48 | -------------------------------------------------------------------------------- /resources/views/shared/master.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | @yield('title') 11 | 12 | 17 | 18 | 19 | 20 | 21 | 22 | {!! Analytics::render() !!} 23 | 24 | 25 | 29 | 30 | 31 | 32 | 33 | 61 | 62 | Fork me on GitHub 63 | 64 |
65 | @yield('content') 66 |
67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /resources/views/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /resources/views/welcome.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Laravel 5 | 6 | 7 | 8 | 37 | 38 | 39 |
40 |
41 |
Laravel 5
42 |
43 |
44 | 45 | 46 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | version('v1', function ($api) { 17 | $api->get('/v1/codelist', 'App\Api\V1\Controllers\OnixCodelistController@index'); 18 | $api->get('/v1/codelist/{number}', 'App\Api\V1\Controllers\OnixCodelistController@show'); 19 | }); 20 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 18 | })->describe('Display an inspiring quote'); 19 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | ['web']], function () { 15 | Route::resource('codelist', 'CodelistController', ['only' => ['index', 'show']]); 16 | 17 | Route::get('search', 'CodelistController@search'); 18 | 19 | Route::get('/api-docs', function () { 20 | return response()->view('api-docs'); 21 | }); 22 | 23 | Route::get('/about', function () { 24 | return response()->view('about'); 25 | }); 26 | 27 | Route::get('/', function () { 28 | return redirect()->route('codelist.index'); 29 | }); 30 | }); 31 | -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | 10 | $uri = urldecode( 11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) 12 | ); 13 | 14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the 15 | // built-in PHP web server. This provides a convenient way to test a Laravel 16 | // application without having installed a "real" web server software here. 17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { 18 | return false; 19 | } 20 | 21 | require_once __DIR__.'/public/index.php'; 22 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | routes.php 3 | compiled.php 4 | services.json 5 | events.scanned.php 6 | routes.scanned.php 7 | down 8 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/ApiTest.php: -------------------------------------------------------------------------------- 1 | json('GET', '/api/v1/codelist'); 29 | 30 | $response 31 | ->assertStatus(200) 32 | ->assertJsonFragment([ 33 | 'id' => 1, 34 | 'number' => 1, 35 | 'description' => 'Notification or update type', 36 | 'issue_number' => 0, 37 | ]); 38 | 39 | // Deleting codelists 40 | $response = $this->json('DELETE', '/api/v1/codelist'); 41 | 42 | $response 43 | ->assertStatus(405) 44 | ->assertExactJson([ 45 | 'message' => '405 Method Not Allowed', 46 | 'status_code' => 405, 47 | ]); 48 | } 49 | 50 | /** 51 | * Check that JSON response structure is correct 52 | * @return void 53 | */ 54 | public function testGetCodelistStructure() 55 | { 56 | // All codelists with pagination metadata 57 | $this->get('/api/v1/codelist')->assertJsonStructure([ 58 | 'data' => [ 59 | '*' => [ 60 | 'id', 'number', 'description', 'number', 61 | ], 62 | ], 63 | 'meta' => [ 64 | 'pagination' => [ 65 | 'total', 'count', 'per_page', 'current_page', 'total_pages', 'links', 66 | ], 67 | ], 68 | ]); 69 | 70 | // Individual codelist structure 71 | $this->get('/api/v1/codelist/1')->assertJsonStructure([ 72 | 'data' => [ 73 | 'id', 'number', 'description', 'number', 74 | ], 75 | ]); 76 | 77 | // Individual codelist contents 78 | $this->json('GET', '/api/v1/codelist/1')->assertExactJson([ 79 | 'data' => [ 80 | 'id' => 1, 81 | 'number' => 1, 82 | 'description' => 'Notification or update type', 83 | 'issue_number' => 0, 84 | ], 85 | ]); 86 | } 87 | 88 | /** 89 | * Tests that giving incorrect page and limit parameters return correct error message 90 | * @return void 91 | */ 92 | public function testIncorrectPageAndLimitParameters() 93 | { 94 | // Both parameters are non-numeric 95 | $this->json('get', '/api/v1/codelist', ['page' => 'incorrect', 'limit' => 'incorrect'])->assertExactJson([ 96 | 'message' => 'Could not list codelists.', 97 | 'errors' => [ 98 | 'page' => [ 99 | 'The page must be a number.', 100 | ], 101 | 'limit' => [ 102 | 'The limit must be a number.', 103 | ], 104 | ], 105 | 'status_code' => 422, 106 | ]); 107 | 108 | // Page is less than 1 109 | $this->json('get', '/api/v1/codelist', ['page' => 0])->assertExactJson([ 110 | 'message' => 'Could not list codelists.', 111 | 'errors' => [ 112 | 'page' => [ 113 | 'The page must be at least 1.', 114 | ], 115 | ], 116 | 'status_code' => 422, 117 | ]); 118 | } 119 | 120 | /** 121 | * Test Onix codelist number that does not exist 122 | * @return void 123 | */ 124 | public function testInvalidCodelistNumber() 125 | { 126 | $this->json('get', '/api/v1/codelist/12345')->assertExactJson([ 127 | 'message' => 'Could not list codelist.', 128 | 'errors' => [ 129 | 'number' => [ 130 | 'The selected number is invalid.', 131 | ], 132 | ], 133 | 'status_code' => 422, 134 | ]); 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); 22 | 23 | return $app; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/UpdateCodelistsTest.php: -------------------------------------------------------------------------------- 1 | assertcount(1, Codelist::where('number', 97)->first()->codes()->get()); 30 | 31 | // Codelist with more than one code 32 | $this->assertGreaterThanOrEqual(2, Codelist::where('number', 1)->first()->codes()->get()->count()); 33 | 34 | // Check for last known codelist 35 | $this->assertcount(1, Codelist::where('number', 227)->get()); 36 | 37 | // Check that the notes are not truncated 38 | $code = Codelist::where('number', 1)->first()->codes()->where('value', '05')->first(); 39 | $this->assertEquals('Use when sending an instruction to delete a record which was previously issued. Note that a Delete instruction should NOT be used when a product is cancelled, put out of print, or otherwise withdrawn from sale: this should be handled as a change of Publishing status, leaving the receiver to decide whether to retain or delete the record. A Delete instruction is used ONLY when there is a particular reason to withdraw a record completely, eg because it was issued in error', $code->notes); 40 | } 41 | 42 | /** 43 | * Check that the amount of codelists and their codes match with the source data 44 | * @return void 45 | */ 46 | public function testCodelistCounts() 47 | { 48 | // Create new instance of the command 49 | $client = new GuzzleHttp\Client(); 50 | $updateCodelistCommand = new App\Console\Commands\UpdateCodelists($client); 51 | 52 | // Send Request 53 | $response = $client->request('GET', $updateCodelistCommand->formUri()); 54 | 55 | // Parse codelists from response 56 | $onixCodelists = json_decode($response->getBody()->getContents()); 57 | 58 | // Check that the amount of codelists in the DB correspond with the data 59 | $this->assertEquals(count($onixCodelists->CodeList), Codelist::all()->count()); 60 | 61 | // Get the total amount of codelist codes 62 | $codeCount = 0; 63 | foreach ($onixCodelists->CodeList as $onixCodelist) { 64 | if (isset($onixCodelist->Code) && is_array($onixCodelist->Code)) { 65 | foreach ($onixCodelist->Code as $onixCodelistCode) { 66 | $codeCount++; 67 | } 68 | } 69 | 70 | if (isset($onixCodelist->Code) && is_object($onixCodelist->Code)) { 71 | $codeCount++; 72 | } 73 | } 74 | 75 | // Check that amount codes correspond with the data 76 | $this->assertEquals($codeCount, Code::all()->count()); 77 | } 78 | 79 | /** 80 | * Tests the formUri 81 | * @return void 82 | */ 83 | public function testFormUri() 84 | { 85 | // Create new instance of the command and get URI 86 | $client = new GuzzleHttp\Client(); 87 | $updateCodelistCommand = new App\Console\Commands\UpdateCodelists($client); 88 | $uri = $updateCodelistCommand->formUri(); 89 | 90 | $expectedUri = 'http://www.editeur.org/files/ONIX%20for%20books%20-%20code%20lists/ONIX_BookProduct_Codelists_Issue_' . config('onix_codelist.issue_number') . '.json'; 91 | 92 | $this->assertInstanceOf('League\Uri\Schemes\Http', $uri); 93 | $this->assertEquals($expectedUri, $uri->__toString()); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /tests/WebSiteTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 28 | $response->assertStatus(302); 29 | $response->assertRedirect('/codelist'); 30 | } 31 | 32 | /** 33 | * Test that requesting a non-existing page returns a 404 34 | * @return void 35 | */ 36 | public function testNonExistingPage() 37 | { 38 | $response = $this->get('/this_page_does_not_exist'); 39 | $response->assertStatus(404); 40 | } 41 | } 42 | --------------------------------------------------------------------------------