@@ -16,7 +16,6 @@ |
||
| 16 | 16 | |
| 17 | 17 | use App\Helpers; |
| 18 | 18 | use Illuminate\Http\Request; |
| 19 | - |
|
| 20 | 19 | use App\Http\Controllers\Controller; |
| 21 | 20 | use App\Image; |
| 22 | 21 | use Illuminate\Support\Facades\Response; |
@@ -52,17 +52,17 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * File not cached |
| 54 | 54 | */ |
| 55 | - else{ |
|
| 55 | + else { |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Get META information |
| 59 | 59 | */ |
| 60 | - $imageMeta = Image::where(['url' => $request->imageName, 'image_extension' => $request->imageExtension])->first(['image_mime_type', 'image_size', 'id', 'updated_at', 'image_etag']); |
|
| 60 | + $imageMeta = Image::where([ 'url' => $request->imageName, 'image_extension' => $request->imageExtension ])->first([ 'image_mime_type', 'image_size', 'id', 'updated_at', 'image_etag' ]); |
|
| 61 | 61 | |
| 62 | 62 | /** |
| 63 | 63 | * File does not exist |
| 64 | 64 | */ |
| 65 | - if(empty($imageMeta) == TRUE){ |
|
| 65 | + if (empty($imageMeta) == TRUE) { |
|
| 66 | 66 | App::abort(404); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | 'Content-Type' => $imageMeta->image_mime_type, |
| 92 | 92 | 'Content-Transfer-Encoding' => 'binary', |
| 93 | 93 | 'Pragma' => 'public', |
| 94 | - 'Expires' => Carbon::createFromTimestamp(time()+3600)->toRfc2822String(), |
|
| 94 | + 'Expires' => Carbon::createFromTimestamp(time() + 3600)->toRfc2822String(), |
|
| 95 | 95 | 'Last-Modified' => $imageMeta->updated_at->toRfc2822String(), |
| 96 | 96 | 'Etag' => $imageMeta->image_etag, |
| 97 | 97 | ); |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | /** |
| 100 | 100 | * Response code cached |
| 101 | 101 | */ |
| 102 | - if( (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $imageMeta->image_etag) |
|
| 103 | - || (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $_SERVER['HTTP_IF_MODIFIED_SINCE'] == $imageMeta->updated_at->toRfc2822String()) ){ |
|
| 102 | + if ((isset($_SERVER[ 'HTTP_IF_NONE_MATCH' ]) && $_SERVER[ 'HTTP_IF_NONE_MATCH' ] == $imageMeta->image_etag) |
|
| 103 | + || (isset($_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ]) && $_SERVER[ 'HTTP_IF_MODIFIED_SINCE' ] == $imageMeta->updated_at->toRfc2822String())) { |
|
| 104 | 104 | |
| 105 | 105 | $responseCode = 304; |
| 106 | 106 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | /** |
| 109 | 109 | * Response code not cached, but OK |
| 110 | 110 | */ |
| 111 | - else{ |
|
| 111 | + else { |
|
| 112 | 112 | |
| 113 | 113 | $responseCode = 200; |
| 114 | 114 | } |
@@ -33,21 +33,21 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 36 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The attributes that are mass assignable. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $fillable = ['name', 'color']; |
|
| 43 | + protected $fillable = [ 'name', 'color' ]; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Columns to exclude from index |
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $excludedFromIndex = []; |
|
| 50 | + protected $excludedFromIndex = [ ]; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Fields to search in fulltext mode |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @return object |
| 80 | 80 | */ |
| 81 | - public function comments(){ |
|
| 81 | + public function comments() { |
|
| 82 | 82 | |
| 83 | 83 | return $this->hasMany('App\Comment', 'commentstatus_id'); |
| 84 | 84 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @param query $query |
| 90 | 90 | * @return query |
| 91 | 91 | */ |
| 92 | - public function scopeRelationships($query){ |
|
| 92 | + public function scopeRelationships($query) { |
|
| 93 | 93 | |
| 94 | 94 | return $query->with('comments'); |
| 95 | 95 | } |
@@ -32,30 +32,30 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 35 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * The attributes that are mass assignable. |
| 39 | 39 | * |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - protected $fillable = ['name', 'description', 'alt', 'url', 'image', |
|
| 42 | + protected $fillable = [ 'name', 'description', 'alt', 'url', 'image', |
|
| 43 | 43 | 'imagecategory_id', 'image_mime_type', 'image_extension', |
| 44 | - 'image_original_name', 'image_size', 'image_width', 'image_height']; |
|
| 44 | + 'image_original_name', 'image_size', 'image_width', 'image_height' ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Columns to exclude from index |
| 48 | 48 | * |
| 49 | 49 | * @var array |
| 50 | 50 | */ |
| 51 | - protected $excludedFromIndex = ['image']; |
|
| 51 | + protected $excludedFromIndex = [ 'image' ]; |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Hidden from custom find |
| 55 | 55 | * |
| 56 | 56 | * @var arrat |
| 57 | 57 | */ |
| 58 | - protected $excludedFromFind = ['image']; |
|
| 58 | + protected $excludedFromFind = [ 'image' ]; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Fields to search in fulltext mode |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * |
| 101 | 101 | * @return object |
| 102 | 102 | */ |
| 103 | - public function imagecategories(){ |
|
| 103 | + public function imagecategories() { |
|
| 104 | 104 | |
| 105 | 105 | return $this->belongsTo('App\ImageCategory', 'imagecategory_id'); |
| 106 | 106 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * |
| 111 | 111 | * @return object |
| 112 | 112 | */ |
| 113 | - public function slides(){ |
|
| 113 | + public function slides() { |
|
| 114 | 114 | |
| 115 | 115 | return $this->hasMany('App\Slide', 'image_id'); |
| 116 | 116 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * |
| 121 | 121 | * @return object |
| 122 | 122 | */ |
| 123 | - public function articlecategories(){ |
|
| 123 | + public function articlecategories() { |
|
| 124 | 124 | |
| 125 | 125 | return $this->hasMany('App\ArticleCategory', 'image_id'); |
| 126 | 126 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * |
| 131 | 131 | * @return object |
| 132 | 132 | */ |
| 133 | - public function pages(){ |
|
| 133 | + public function pages() { |
|
| 134 | 134 | |
| 135 | 135 | return $this->hasMany('App\Page', 'image_id'); |
| 136 | 136 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * @param query $query |
| 142 | 142 | * @return query |
| 143 | 143 | */ |
| 144 | - public function scopeRelationships($query){ |
|
| 144 | + public function scopeRelationships($query) { |
|
| 145 | 145 | |
| 146 | 146 | return $query->with('imagecategories'); |
| 147 | 147 | } |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @param array $array |
| 153 | 153 | */ |
| 154 | - public function hide($array = []){ |
|
| 154 | + public function hide($array = [ ]) { |
|
| 155 | 155 | |
| 156 | - $this->hidden = ['image']; |
|
| 156 | + $this->hidden = [ 'image' ]; |
|
| 157 | 157 | } |
| 158 | 158 | } |
@@ -33,22 +33,22 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 36 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The attributes that are mass assignable. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $fillable = ['name', 'headline', 'text', 'email', |
|
| 44 | - 'url', 'approved', 'commentstatus_id', 'page_id', 'article_id']; |
|
| 43 | + protected $fillable = [ 'name', 'headline', 'text', 'email', |
|
| 44 | + 'url', 'approved', 'commentstatus_id', 'page_id', 'article_id' ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Columns to exclude from index |
| 48 | 48 | * |
| 49 | 49 | * @var array |
| 50 | 50 | */ |
| 51 | - protected $excludedFromIndex = []; |
|
| 51 | + protected $excludedFromIndex = [ ]; |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Fields to search in fulltext mode |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * |
| 90 | 90 | * @return object |
| 91 | 91 | */ |
| 92 | - public function commentstatuses(){ |
|
| 92 | + public function commentstatuses() { |
|
| 93 | 93 | |
| 94 | 94 | return $this->belongsTo('App\CommentStatus', 'commentstatus_id'); |
| 95 | 95 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @return object |
| 101 | 101 | */ |
| 102 | - public function articles(){ |
|
| 102 | + public function articles() { |
|
| 103 | 103 | |
| 104 | 104 | return $this->belongsTo('App\Article', 'article_id'); |
| 105 | 105 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * |
| 110 | 110 | * @return object |
| 111 | 111 | */ |
| 112 | - public function pages(){ |
|
| 112 | + public function pages() { |
|
| 113 | 113 | |
| 114 | 114 | return $this->belongsTo('App\Page', 'page_id'); |
| 115 | 115 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @param query $query |
| 121 | 121 | * @return query |
| 122 | 122 | */ |
| 123 | - public function scopeRelationships($query){ |
|
| 123 | + public function scopeRelationships($query) { |
|
| 124 | 124 | |
| 125 | 125 | return $query->with('articles', 'pages', 'commentstatuses'); |
| 126 | 126 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function map(Router $router) |
| 39 | 39 | { |
| 40 | - $router->group(['namespace' => $this->namespace], function ($router) { |
|
| 40 | + $router->group([ 'namespace' => $this->namespace ], function($router) { |
|
| 41 | 41 | require app_path('Http/routes.php'); |
| 42 | 42 | }); |
| 43 | 43 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function boot() |
| 15 | 15 | { |
| 16 | 16 | // |
| 17 | - require_once app_path().'/Http/helpers.php'; |
|
| 17 | + require_once app_path() . '/Http/helpers.php'; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
@@ -33,22 +33,22 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - protected $dates = ['created_at', 'updated_at', 'deleted_at', 'published_at']; |
|
| 36 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at', 'published_at' ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The attributes that are mass assignable. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $fillable = ['name', 'author_name', 'meta_title', 'meta_description', |
|
| 44 | - 'meta_keywords', 'text', 'url', 'image_id', 'user_id', 'published_at']; |
|
| 43 | + protected $fillable = [ 'name', 'author_name', 'meta_title', 'meta_description', |
|
| 44 | + 'meta_keywords', 'text', 'url', 'image_id', 'user_id', 'published_at' ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Columns to exclude from index |
| 48 | 48 | * |
| 49 | 49 | * @var array |
| 50 | 50 | */ |
| 51 | - protected $excludedFromIndex = []; |
|
| 51 | + protected $excludedFromIndex = [ ]; |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Fields to search in fulltext mode |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @return object |
| 80 | 80 | */ |
| 81 | - public function images(){ |
|
| 81 | + public function images() { |
|
| 82 | 82 | |
| 83 | 83 | return $this->belongsTo('App\Image', 'image_id')->select('id', 'name', 'description', |
| 84 | 84 | 'alt', 'url', 'imagecategory_id', 'image_mime_type', 'image_extension', |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * |
| 92 | 92 | * @return object |
| 93 | 93 | */ |
| 94 | - public function articlecategories(){ |
|
| 94 | + public function articlecategories() { |
|
| 95 | 95 | |
| 96 | 96 | return $this->belongsToMany('App\ArticleCategory', 'article_articlecategory', 'article_id', 'articlecategory_id'); |
| 97 | 97 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * |
| 102 | 102 | * @return object |
| 103 | 103 | */ |
| 104 | - public function comments(){ |
|
| 104 | + public function comments() { |
|
| 105 | 105 | |
| 106 | 106 | return $this->hasMany('App\Comment', 'article_id'); |
| 107 | 107 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * |
| 112 | 112 | * @return object |
| 113 | 113 | */ |
| 114 | - public function users(){ |
|
| 114 | + public function users() { |
|
| 115 | 115 | |
| 116 | 116 | return $this->belongsTo('App\User', 'user_id'); |
| 117 | 117 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param query $query |
| 123 | 123 | * @return query |
| 124 | 124 | */ |
| 125 | - public function scopeRelationships($query){ |
|
| 125 | + public function scopeRelationships($query) { |
|
| 126 | 126 | |
| 127 | 127 | return $query->with('images', 'images.imagecategories', 'articlecategories', 'users', 'comments'); |
| 128 | 128 | } |
@@ -41,28 +41,28 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @var array |
| 43 | 43 | */ |
| 44 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 44 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * The attributes that are mass assignable. |
| 48 | 48 | * |
| 49 | 49 | * @var array |
| 50 | 50 | */ |
| 51 | - protected $fillable = ['name', 'email', 'password']; |
|
| 51 | + protected $fillable = [ 'name', 'email', 'password' ]; |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * The attributes excluded from the model's JSON form. |
| 55 | 55 | * |
| 56 | 56 | * @var array |
| 57 | 57 | */ |
| 58 | - protected $hidden = ['password', 'remember_token']; |
|
| 58 | + protected $hidden = [ 'password', 'remember_token' ]; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * Columns to exclude from index |
| 62 | 62 | * |
| 63 | 63 | * @var array |
| 64 | 64 | */ |
| 65 | - protected $excludedFromIndex = ['password']; |
|
| 65 | + protected $excludedFromIndex = [ 'password' ]; |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * Fields to search in fulltext mode |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @return object |
| 99 | 99 | */ |
| 100 | - public function articles(){ |
|
| 100 | + public function articles() { |
|
| 101 | 101 | |
| 102 | 102 | return $this->hasMany('App\Article', 'user_id'); |
| 103 | 103 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * @param query $query |
| 109 | 109 | * @return query |
| 110 | 110 | */ |
| 111 | - public function scopeRelationships($query){ |
|
| 111 | + public function scopeRelationships($query) { |
|
| 112 | 112 | |
| 113 | 113 | return $query->with('articles'); |
| 114 | 114 | } |
@@ -33,22 +33,22 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 36 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The attributes that are mass assignable. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $fillable = ['name', 'caption', 'text', 'link_url', |
|
| 44 | - 'link_title', 'image_id', 'position']; |
|
| 43 | + protected $fillable = [ 'name', 'caption', 'text', 'link_url', |
|
| 44 | + 'link_title', 'image_id', 'position' ]; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Columns to exclude from index |
| 48 | 48 | * |
| 49 | 49 | * @var array |
| 50 | 50 | */ |
| 51 | - protected $excludedFromIndex = []; |
|
| 51 | + protected $excludedFromIndex = [ ]; |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Fields to search in fulltext mode |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @return object |
| 86 | 86 | */ |
| 87 | - public function images(){ |
|
| 87 | + public function images() { |
|
| 88 | 88 | |
| 89 | 89 | return $this->belongsTo('App\Image', 'image_id')->select('id', 'name', 'description', |
| 90 | 90 | 'alt', 'url', 'imagecategory_id', 'image_mime_type', 'image_extension', |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @return object |
| 99 | 99 | */ |
| 100 | - public function advertlocations(){ |
|
| 100 | + public function advertlocations() { |
|
| 101 | 101 | |
| 102 | 102 | return $this->belongsToMany('App\AdvertLocation', 'advert_advertlocation', 'advertlocation_id', 'advert_id'); |
| 103 | 103 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * @param type $query |
| 109 | 109 | * @return object |
| 110 | 110 | */ |
| 111 | - public function scopeRelationships($query){ |
|
| 111 | + public function scopeRelationships($query) { |
|
| 112 | 112 | |
| 113 | 113 | return $query->with('images', 'images.imagecategories', 'advertlocations'); |
| 114 | 114 | } |