@@ -26,11 +26,11 @@ discard block |
||
26 | 26 | }); |
27 | 27 | Blade::directive('transarticles_tojs', function($expression) { |
28 | 28 | $auxExpression = explode(',', str_replace(['(', ')', ' ', '"', "'"], '', $expression)); |
29 | - if (count($auxExpression)>1){ |
|
30 | - $scope=$auxExpression[0]; |
|
31 | - $basevar=$auxExpression[1]; |
|
29 | + if (count($auxExpression)>1) { |
|
30 | + $scope = $auxExpression[0]; |
|
31 | + $basevar = $auxExpression[1]; |
|
32 | 32 | } else { |
33 | - $scope=$auxExpression[0]; |
|
33 | + $scope = $auxExpression[0]; |
|
34 | 34 | $basevar = ""; |
35 | 35 | } |
36 | 36 | $translations = new \Sirgrimorum\TransArticles\GetArticleFromDataBase($this->app); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $loader->alias( |
50 | 50 | 'TransArticles', GetArticleFromDataBase::class |
51 | 51 | ); |
52 | - $this->app->singleton(GetArticleFromDataBase::class, function ($app) { |
|
52 | + $this->app->singleton(GetArticleFromDataBase::class, function($app) { |
|
53 | 53 | return new GetArticleFromDataBase($app); |
54 | 54 | }); |
55 | 55 | //$this->app->alias(GetArticleFromDataBase::class, 'TransArticles'); |
@@ -5,35 +5,35 @@ |
||
5 | 5 | |
6 | 6 | class CreateSirgrimorumCmsArticles extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('articles', function($table) |
|
16 | - { |
|
17 | - $table->increments('id'); |
|
18 | - $table->string('nickname',50); |
|
19 | - $table->string('scope',50); |
|
20 | - $table->string('lang',10); |
|
21 | - $table->longtext('content'); |
|
22 | - $table->boolean('activated')->default(0); |
|
23 | - $table->integer('user_id')->nullable(); |
|
24 | - $table->timestamps(); |
|
25 | - $table->unique(array('nickname','lang','scope')); |
|
26 | - }); |
|
27 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('articles', function($table) |
|
16 | + { |
|
17 | + $table->increments('id'); |
|
18 | + $table->string('nickname',50); |
|
19 | + $table->string('scope',50); |
|
20 | + $table->string('lang',10); |
|
21 | + $table->longtext('content'); |
|
22 | + $table->boolean('activated')->default(0); |
|
23 | + $table->integer('user_id')->nullable(); |
|
24 | + $table->timestamps(); |
|
25 | + $table->unique(array('nickname','lang','scope')); |
|
26 | + }); |
|
27 | + } |
|
28 | 28 | |
29 | - /** |
|
30 | - * Reverse the migrations. |
|
31 | - * |
|
32 | - * @return void |
|
33 | - */ |
|
34 | - public function down() |
|
35 | - { |
|
36 | - Schema::drop('articles'); |
|
37 | - } |
|
29 | + /** |
|
30 | + * Reverse the migrations. |
|
31 | + * |
|
32 | + * @return void |
|
33 | + */ |
|
34 | + public function down() |
|
35 | + { |
|
36 | + Schema::drop('articles'); |
|
37 | + } |
|
38 | 38 | |
39 | 39 | } |
@@ -15,14 +15,14 @@ |
||
15 | 15 | Schema::create('articles', function($table) |
16 | 16 | { |
17 | 17 | $table->increments('id'); |
18 | - $table->string('nickname',50); |
|
19 | - $table->string('scope',50); |
|
20 | - $table->string('lang',10); |
|
18 | + $table->string('nickname', 50); |
|
19 | + $table->string('scope', 50); |
|
20 | + $table->string('lang', 10); |
|
21 | 21 | $table->longtext('content'); |
22 | 22 | $table->boolean('activated')->default(0); |
23 | 23 | $table->integer('user_id')->nullable(); |
24 | 24 | $table->timestamps(); |
25 | - $table->unique(array('nickname','lang','scope')); |
|
25 | + $table->unique(array('nickname', 'lang', 'scope')); |
|
26 | 26 | }); |
27 | 27 | } |
28 | 28 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | |
7 | 7 | class Article extends Model { |
8 | 8 | |
9 | - public $rules = [ //The validation rules |
|
9 | + public $rules = [//The validation rules |
|
10 | 10 | 'nickname' => 'bail|required|max:255', |
11 | 11 | 'scope' => 'bail|required|max:255', |
12 | 12 | 'lang' => 'bail|required|max:255', |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | return $this->scope . "." . $this->nickname . " (" . $this->lang . ")"; |
35 | 35 | } |
36 | 36 | |
37 | - public function user(){ |
|
37 | + public function user() { |
|
38 | 38 | return $this->belongsTo('App\User'); |
39 | 39 | } |
40 | 40 |