@@ -5,44 +5,44 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | class LogObserver { |
| 7 | 7 | |
| 8 | - public function saving($model) |
|
| 9 | - { |
|
| 10 | - // |
|
| 11 | - } |
|
| 12 | - |
|
| 13 | - public function saved($model) |
|
| 14 | - { |
|
| 15 | - // |
|
| 16 | - } |
|
| 17 | - |
|
| 18 | - public function creating($model) |
|
| 19 | - { |
|
| 20 | - // |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - public function created($model) |
|
| 24 | - { |
|
| 25 | - // |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - public function updating($model) |
|
| 29 | - { |
|
| 30 | - // |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - public function updated($model) |
|
| 34 | - { |
|
| 35 | - // |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - public function deleting($model) |
|
| 39 | - { |
|
| 40 | - // |
|
| 41 | - } |
|
| 42 | - |
|
| 43 | - public function deleted($model) |
|
| 44 | - { |
|
| 45 | - // |
|
| 46 | - } |
|
| 8 | + public function saving($model) |
|
| 9 | + { |
|
| 10 | + // |
|
| 11 | + } |
|
| 12 | + |
|
| 13 | + public function saved($model) |
|
| 14 | + { |
|
| 15 | + // |
|
| 16 | + } |
|
| 17 | + |
|
| 18 | + public function creating($model) |
|
| 19 | + { |
|
| 20 | + // |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + public function created($model) |
|
| 24 | + { |
|
| 25 | + // |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + public function updating($model) |
|
| 29 | + { |
|
| 30 | + // |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + public function updated($model) |
|
| 34 | + { |
|
| 35 | + // |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + public function deleting($model) |
|
| 39 | + { |
|
| 40 | + // |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + public function deleted($model) |
|
| 44 | + { |
|
| 45 | + // |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | } |
| 49 | 49 | \ No newline at end of file |
@@ -5,51 +5,51 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | class NotificationObserver { |
| 7 | 7 | |
| 8 | - public function saving($model) |
|
| 9 | - { |
|
| 10 | - // |
|
| 11 | - } |
|
| 12 | - |
|
| 13 | - public function saved($model) |
|
| 14 | - { |
|
| 15 | - // |
|
| 16 | - } |
|
| 17 | - |
|
| 18 | - public function creating($model) |
|
| 19 | - { |
|
| 20 | - // |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - /** |
|
| 24 | - * Publish the created notification to the redis server |
|
| 25 | - * to broadcast it to all listners. |
|
| 26 | - * |
|
| 27 | - * @param object $model the model beign created. |
|
| 28 | - * @return void |
|
| 29 | - */ |
|
| 30 | - public function created($model) |
|
| 31 | - { |
|
| 32 | - \Redis::publish('notification', json_encode($model->toArray())); |
|
| 33 | - } |
|
| 34 | - |
|
| 35 | - public function updating($model) |
|
| 36 | - { |
|
| 37 | - // |
|
| 38 | - } |
|
| 39 | - |
|
| 40 | - public function updated($model) |
|
| 41 | - { |
|
| 42 | - // |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - public function deleting($model) |
|
| 46 | - { |
|
| 47 | - // |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - public function deleted($model) |
|
| 51 | - { |
|
| 52 | - // |
|
| 53 | - } |
|
| 8 | + public function saving($model) |
|
| 9 | + { |
|
| 10 | + // |
|
| 11 | + } |
|
| 12 | + |
|
| 13 | + public function saved($model) |
|
| 14 | + { |
|
| 15 | + // |
|
| 16 | + } |
|
| 17 | + |
|
| 18 | + public function creating($model) |
|
| 19 | + { |
|
| 20 | + // |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * Publish the created notification to the redis server |
|
| 25 | + * to broadcast it to all listners. |
|
| 26 | + * |
|
| 27 | + * @param object $model the model beign created. |
|
| 28 | + * @return void |
|
| 29 | + */ |
|
| 30 | + public function created($model) |
|
| 31 | + { |
|
| 32 | + \Redis::publish('notification', json_encode($model->toArray())); |
|
| 33 | + } |
|
| 34 | + |
|
| 35 | + public function updating($model) |
|
| 36 | + { |
|
| 37 | + // |
|
| 38 | + } |
|
| 39 | + |
|
| 40 | + public function updated($model) |
|
| 41 | + { |
|
| 42 | + // |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + public function deleting($model) |
|
| 46 | + { |
|
| 47 | + // |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + public function deleted($model) |
|
| 51 | + { |
|
| 52 | + // |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | 55 | } |
| 56 | 56 | \ No newline at end of file |
@@ -13,19 +13,19 @@ |
||
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | 15 | Schema::create('groups', function (Blueprint $table) { |
| 16 | - $table->increments('id'); |
|
| 17 | - $table->string('name',100)->unique(); |
|
| 18 | - $table->softDeletes(); |
|
| 19 | - $table->timestamps(); |
|
| 20 | - }); |
|
| 16 | + $table->increments('id'); |
|
| 17 | + $table->string('name',100)->unique(); |
|
| 18 | + $table->softDeletes(); |
|
| 19 | + $table->timestamps(); |
|
| 20 | + }); |
|
| 21 | 21 | |
| 22 | - Schema::create('users_groups', function (Blueprint $table) { |
|
| 23 | - $table->increments('id'); |
|
| 24 | - $table->integer('user_id'); |
|
| 25 | - $table->integer('group_id'); |
|
| 26 | - $table->softDeletes(); |
|
| 27 | - $table->timestamps(); |
|
| 28 | - }); |
|
| 22 | + Schema::create('users_groups', function (Blueprint $table) { |
|
| 23 | + $table->increments('id'); |
|
| 24 | + $table->integer('user_id'); |
|
| 25 | + $table->integer('group_id'); |
|
| 26 | + $table->softDeletes(); |
|
| 27 | + $table->timestamps(); |
|
| 28 | + }); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -12,21 +12,21 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('permissions', function (Blueprint $table) { |
|
| 16 | - $table->increments('id'); |
|
| 17 | - $table->string('name',100); |
|
| 18 | - $table->string('model',100); |
|
| 19 | - $table->softDeletes(); |
|
| 20 | - $table->timestamps(); |
|
| 21 | - $table->unique(array('name', 'model')); |
|
| 22 | - }); |
|
| 23 | - Schema::create('groups_permissions', function (Blueprint $table) { |
|
| 24 | - $table->increments('id'); |
|
| 25 | - $table->integer('group_id'); |
|
| 26 | - $table->integer('permission_id'); |
|
| 27 | - $table->softDeletes(); |
|
| 28 | - $table->timestamps(); |
|
| 29 | - }); |
|
| 15 | + Schema::create('permissions', function (Blueprint $table) { |
|
| 16 | + $table->increments('id'); |
|
| 17 | + $table->string('name',100); |
|
| 18 | + $table->string('model',100); |
|
| 19 | + $table->softDeletes(); |
|
| 20 | + $table->timestamps(); |
|
| 21 | + $table->unique(array('name', 'model')); |
|
| 22 | + }); |
|
| 23 | + Schema::create('groups_permissions', function (Blueprint $table) { |
|
| 24 | + $table->increments('id'); |
|
| 25 | + $table->integer('group_id'); |
|
| 26 | + $table->integer('permission_id'); |
|
| 27 | + $table->softDeletes(); |
|
| 28 | + $table->timestamps(); |
|
| 29 | + }); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | /** |
@@ -7,10 +7,10 @@ |
||
| 7 | 7 | |
| 8 | 8 | class PermissionsController extends BaseApiController |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * The name of the model that is used by the base api controller |
|
| 12 | - * to preform actions like (add, edit ... etc). |
|
| 13 | - * @var string |
|
| 14 | - */ |
|
| 15 | - protected $model = 'permissions'; |
|
| 10 | + /** |
|
| 11 | + * The name of the model that is used by the base api controller |
|
| 12 | + * to preform actions like (add, edit ... etc). |
|
| 13 | + * @var string |
|
| 14 | + */ |
|
| 15 | + protected $model = 'permissions'; |
|
| 16 | 16 | } |
@@ -5,27 +5,27 @@ |
||
| 5 | 5 | |
| 6 | 6 | class PasswordResets extends Migration |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Run the migrations. |
|
| 10 | - * |
|
| 11 | - * @return void |
|
| 12 | - */ |
|
| 13 | - public function up() |
|
| 14 | - { |
|
| 15 | - Schema::create('password_resets', function (Blueprint $table) { |
|
| 16 | - $table->string('email')->index(); |
|
| 17 | - $table->string('token')->index(); |
|
| 18 | - $table->timestamp('created_at'); |
|
| 19 | - }); |
|
| 20 | - } |
|
| 8 | + /** |
|
| 9 | + * Run the migrations. |
|
| 10 | + * |
|
| 11 | + * @return void |
|
| 12 | + */ |
|
| 13 | + public function up() |
|
| 14 | + { |
|
| 15 | + Schema::create('password_resets', function (Blueprint $table) { |
|
| 16 | + $table->string('email')->index(); |
|
| 17 | + $table->string('token')->index(); |
|
| 18 | + $table->timestamp('created_at'); |
|
| 19 | + }); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Reverse the migrations. |
|
| 24 | - * |
|
| 25 | - * @return void |
|
| 26 | - */ |
|
| 27 | - public function down() |
|
| 28 | - { |
|
| 29 | - Schema::drop('password_resets'); |
|
| 30 | - } |
|
| 22 | + /** |
|
| 23 | + * Reverse the migrations. |
|
| 24 | + * |
|
| 25 | + * @return void |
|
| 26 | + */ |
|
| 27 | + public function down() |
|
| 28 | + { |
|
| 29 | + Schema::drop('password_resets'); |
|
| 30 | + } |
|
| 31 | 31 | } |
@@ -2,17 +2,17 @@ |
||
| 2 | 2 | |
| 3 | 3 | class Logging |
| 4 | 4 | { |
| 5 | - public function saveLog($action, $item_name, $item_type, $item_id) |
|
| 6 | - { |
|
| 7 | - if (\Core::logs() && $item_name !== 'Log') |
|
| 8 | - { |
|
| 9 | - \Core::logs()->save([ |
|
| 10 | - 'action' => $action, |
|
| 11 | - 'item_name' => $item_name, |
|
| 12 | - 'item_type' => $item_type, |
|
| 13 | - 'item_id' => $item_id, |
|
| 14 | - 'user_id' => \JWTAuth::parseToken()->authenticate()->id, |
|
| 15 | - ], false, false); |
|
| 16 | - } |
|
| 17 | - } |
|
| 5 | + public function saveLog($action, $item_name, $item_type, $item_id) |
|
| 6 | + { |
|
| 7 | + if (\Core::logs() && $item_name !== 'Log') |
|
| 8 | + { |
|
| 9 | + \Core::logs()->save([ |
|
| 10 | + 'action' => $action, |
|
| 11 | + 'item_name' => $item_name, |
|
| 12 | + 'item_type' => $item_type, |
|
| 13 | + 'item_id' => $item_id, |
|
| 14 | + 'user_id' => \JWTAuth::parseToken()->authenticate()->id, |
|
| 15 | + ], false, false); |
|
| 16 | + } |
|
| 17 | + } |
|
| 18 | 18 | } |
| 19 | 19 | \ No newline at end of file |
@@ -8,30 +8,30 @@ |
||
| 8 | 8 | class NotificationsController extends BaseApiController |
| 9 | 9 | { |
| 10 | 10 | /** |
| 11 | - * The name of the model that is used by the base api controller |
|
| 12 | - * to preform actions like (add, edit ... etc). |
|
| 13 | - * @var string |
|
| 14 | - */ |
|
| 15 | - protected $model = 'notifications'; |
|
| 11 | + * The name of the model that is used by the base api controller |
|
| 12 | + * to preform actions like (add, edit ... etc). |
|
| 13 | + * @var string |
|
| 14 | + */ |
|
| 15 | + protected $model = 'notifications'; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Set the notification notified to true. |
|
| 19 | - * |
|
| 20 | - * @param integer $id |
|
| 21 | - * @return \Illuminate\Http\Response |
|
| 22 | - */ |
|
| 23 | - public function notified($id) |
|
| 24 | - { |
|
| 25 | - return \Response::json(\Core::notifications()->notified($id), 200); |
|
| 26 | - } |
|
| 17 | + /** |
|
| 18 | + * Set the notification notified to true. |
|
| 19 | + * |
|
| 20 | + * @param integer $id |
|
| 21 | + * @return \Illuminate\Http\Response |
|
| 22 | + */ |
|
| 23 | + public function notified($id) |
|
| 24 | + { |
|
| 25 | + return \Response::json(\Core::notifications()->notified($id), 200); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Set the notification notified to all. |
|
| 30 | - * |
|
| 31 | - * @return \Illuminate\Http\Response |
|
| 32 | - */ |
|
| 33 | - public function notifyall() |
|
| 34 | - { |
|
| 35 | - return \Response::json(\Core::notifications()->notifyAll(), 200); |
|
| 36 | - } |
|
| 28 | + /** |
|
| 29 | + * Set the notification notified to all. |
|
| 30 | + * |
|
| 31 | + * @return \Illuminate\Http\Response |
|
| 32 | + */ |
|
| 33 | + public function notifyall() |
|
| 34 | + { |
|
| 35 | + return \Response::json(\Core::notifications()->notifyAll(), 200); |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -5,44 +5,44 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | class LogObserver { |
| 7 | 7 | |
| 8 | - public function saving($model) |
|
| 9 | - { |
|
| 10 | - // |
|
| 11 | - } |
|
| 12 | - |
|
| 13 | - public function saved($model) |
|
| 14 | - { |
|
| 15 | - // |
|
| 16 | - } |
|
| 17 | - |
|
| 18 | - public function creating($model) |
|
| 19 | - { |
|
| 20 | - // |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - public function created($model) |
|
| 24 | - { |
|
| 25 | - // |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - public function updating($model) |
|
| 29 | - { |
|
| 30 | - // |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - public function updated($model) |
|
| 34 | - { |
|
| 35 | - // |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - public function deleting($model) |
|
| 39 | - { |
|
| 40 | - // |
|
| 41 | - } |
|
| 42 | - |
|
| 43 | - public function deleted($model) |
|
| 44 | - { |
|
| 45 | - // |
|
| 46 | - } |
|
| 8 | + public function saving($model) |
|
| 9 | + { |
|
| 10 | + // |
|
| 11 | + } |
|
| 12 | + |
|
| 13 | + public function saved($model) |
|
| 14 | + { |
|
| 15 | + // |
|
| 16 | + } |
|
| 17 | + |
|
| 18 | + public function creating($model) |
|
| 19 | + { |
|
| 20 | + // |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + public function created($model) |
|
| 24 | + { |
|
| 25 | + // |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + public function updating($model) |
|
| 29 | + { |
|
| 30 | + // |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + public function updated($model) |
|
| 34 | + { |
|
| 35 | + // |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + public function deleting($model) |
|
| 39 | + { |
|
| 40 | + // |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + public function deleted($model) |
|
| 44 | + { |
|
| 45 | + // |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | 48 | } |
| 49 | 49 | \ No newline at end of file |