@@ -13,203 +13,203 @@ discard block |
||
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * Insert the permissions related to this module. |
|
| 17 | - */ |
|
| 18 | - DB::table('permissions')->insert( |
|
| 19 | - [ |
|
| 20 | - /** |
|
| 21 | - * Users model permissions. |
|
| 22 | - */ |
|
| 23 | - [ |
|
| 24 | - 'name' => 'save', |
|
| 25 | - 'model' => 'users', |
|
| 26 | - 'created_at' => \DB::raw('NOW()'), |
|
| 27 | - 'updated_at' => \DB::raw('NOW()') |
|
| 28 | - ], |
|
| 29 | - [ |
|
| 30 | - 'name' => 'delete', |
|
| 31 | - 'model' => 'users', |
|
| 32 | - 'created_at' => \DB::raw('NOW()'), |
|
| 33 | - 'updated_at' => \DB::raw('NOW()') |
|
| 34 | - ], |
|
| 35 | - [ |
|
| 36 | - 'name' => 'find', |
|
| 37 | - 'model' => 'users', |
|
| 38 | - 'created_at' => \DB::raw('NOW()'), |
|
| 39 | - 'updated_at' => \DB::raw('NOW()') |
|
| 40 | - ], |
|
| 41 | - [ |
|
| 42 | - 'name' => 'list', |
|
| 43 | - 'model' => 'users', |
|
| 44 | - 'created_at' => \DB::raw('NOW()'), |
|
| 45 | - 'updated_at' => \DB::raw('NOW()') |
|
| 46 | - ], |
|
| 47 | - [ |
|
| 48 | - 'name' => 'search', |
|
| 49 | - 'model' => 'users', |
|
| 50 | - 'created_at' => \DB::raw('NOW()'), |
|
| 51 | - 'updated_at' => \DB::raw('NOW()') |
|
| 52 | - ], |
|
| 53 | - [ |
|
| 54 | - 'name' => 'findby', |
|
| 55 | - 'model' => 'users', |
|
| 56 | - 'created_at' => \DB::raw('NOW()'), |
|
| 57 | - 'updated_at' => \DB::raw('NOW()') |
|
| 58 | - ], |
|
| 59 | - [ |
|
| 60 | - 'name' => 'first', |
|
| 61 | - 'model' => 'users', |
|
| 62 | - 'created_at' => \DB::raw('NOW()'), |
|
| 63 | - 'updated_at' => \DB::raw('NOW()') |
|
| 64 | - ], |
|
| 65 | - [ |
|
| 66 | - 'name' => 'paginate', |
|
| 67 | - 'model' => 'users', |
|
| 68 | - 'created_at' => \DB::raw('NOW()'), |
|
| 69 | - 'updated_at' => \DB::raw('NOW()') |
|
| 70 | - ], |
|
| 71 | - [ |
|
| 72 | - 'name' => 'paginateby', |
|
| 73 | - 'model' => 'users', |
|
| 74 | - 'created_at' => \DB::raw('NOW()'), |
|
| 75 | - 'updated_at' => \DB::raw('NOW()') |
|
| 76 | - ], |
|
| 77 | - [ |
|
| 78 | - 'name' => 'assigngroups', |
|
| 79 | - 'model' => 'users', |
|
| 80 | - 'created_at' => \DB::raw('NOW()'), |
|
| 81 | - 'updated_at' => \DB::raw('NOW()') |
|
| 82 | - ], |
|
| 83 | - [ |
|
| 84 | - 'name' => 'block', |
|
| 85 | - 'model' => 'users', |
|
| 86 | - 'created_at' => \DB::raw('NOW()'), |
|
| 87 | - 'updated_at' => \DB::raw('NOW()') |
|
| 88 | - ], |
|
| 89 | - [ |
|
| 90 | - 'name' => 'unblock', |
|
| 91 | - 'model' => 'users', |
|
| 92 | - 'created_at' => \DB::raw('NOW()'), |
|
| 93 | - 'updated_at' => \DB::raw('NOW()') |
|
| 94 | - ], |
|
| 16 | + * Insert the permissions related to this module. |
|
| 17 | + */ |
|
| 18 | + DB::table('permissions')->insert( |
|
| 19 | + [ |
|
| 20 | + /** |
|
| 21 | + * Users model permissions. |
|
| 22 | + */ |
|
| 23 | + [ |
|
| 24 | + 'name' => 'save', |
|
| 25 | + 'model' => 'users', |
|
| 26 | + 'created_at' => \DB::raw('NOW()'), |
|
| 27 | + 'updated_at' => \DB::raw('NOW()') |
|
| 28 | + ], |
|
| 29 | + [ |
|
| 30 | + 'name' => 'delete', |
|
| 31 | + 'model' => 'users', |
|
| 32 | + 'created_at' => \DB::raw('NOW()'), |
|
| 33 | + 'updated_at' => \DB::raw('NOW()') |
|
| 34 | + ], |
|
| 35 | + [ |
|
| 36 | + 'name' => 'find', |
|
| 37 | + 'model' => 'users', |
|
| 38 | + 'created_at' => \DB::raw('NOW()'), |
|
| 39 | + 'updated_at' => \DB::raw('NOW()') |
|
| 40 | + ], |
|
| 41 | + [ |
|
| 42 | + 'name' => 'list', |
|
| 43 | + 'model' => 'users', |
|
| 44 | + 'created_at' => \DB::raw('NOW()'), |
|
| 45 | + 'updated_at' => \DB::raw('NOW()') |
|
| 46 | + ], |
|
| 47 | + [ |
|
| 48 | + 'name' => 'search', |
|
| 49 | + 'model' => 'users', |
|
| 50 | + 'created_at' => \DB::raw('NOW()'), |
|
| 51 | + 'updated_at' => \DB::raw('NOW()') |
|
| 52 | + ], |
|
| 53 | + [ |
|
| 54 | + 'name' => 'findby', |
|
| 55 | + 'model' => 'users', |
|
| 56 | + 'created_at' => \DB::raw('NOW()'), |
|
| 57 | + 'updated_at' => \DB::raw('NOW()') |
|
| 58 | + ], |
|
| 59 | + [ |
|
| 60 | + 'name' => 'first', |
|
| 61 | + 'model' => 'users', |
|
| 62 | + 'created_at' => \DB::raw('NOW()'), |
|
| 63 | + 'updated_at' => \DB::raw('NOW()') |
|
| 64 | + ], |
|
| 65 | + [ |
|
| 66 | + 'name' => 'paginate', |
|
| 67 | + 'model' => 'users', |
|
| 68 | + 'created_at' => \DB::raw('NOW()'), |
|
| 69 | + 'updated_at' => \DB::raw('NOW()') |
|
| 70 | + ], |
|
| 71 | + [ |
|
| 72 | + 'name' => 'paginateby', |
|
| 73 | + 'model' => 'users', |
|
| 74 | + 'created_at' => \DB::raw('NOW()'), |
|
| 75 | + 'updated_at' => \DB::raw('NOW()') |
|
| 76 | + ], |
|
| 77 | + [ |
|
| 78 | + 'name' => 'assigngroups', |
|
| 79 | + 'model' => 'users', |
|
| 80 | + 'created_at' => \DB::raw('NOW()'), |
|
| 81 | + 'updated_at' => \DB::raw('NOW()') |
|
| 82 | + ], |
|
| 83 | + [ |
|
| 84 | + 'name' => 'block', |
|
| 85 | + 'model' => 'users', |
|
| 86 | + 'created_at' => \DB::raw('NOW()'), |
|
| 87 | + 'updated_at' => \DB::raw('NOW()') |
|
| 88 | + ], |
|
| 89 | + [ |
|
| 90 | + 'name' => 'unblock', |
|
| 91 | + 'model' => 'users', |
|
| 92 | + 'created_at' => \DB::raw('NOW()'), |
|
| 93 | + 'updated_at' => \DB::raw('NOW()') |
|
| 94 | + ], |
|
| 95 | 95 | |
| 96 | - /** |
|
| 97 | - * Permissions model permissions. |
|
| 98 | - */ |
|
| 99 | - [ |
|
| 100 | - 'name' => 'find', |
|
| 101 | - 'model' => 'permissions', |
|
| 102 | - 'created_at' => \DB::raw('NOW()'), |
|
| 103 | - 'updated_at' => \DB::raw('NOW()') |
|
| 104 | - ], |
|
| 105 | - [ |
|
| 106 | - 'name' => 'search', |
|
| 107 | - 'model' => 'permissions', |
|
| 108 | - 'created_at' => \DB::raw('NOW()'), |
|
| 109 | - 'updated_at' => \DB::raw('NOW()') |
|
| 110 | - ], |
|
| 111 | - [ |
|
| 112 | - 'name' => 'list', |
|
| 113 | - 'model' => 'permissions', |
|
| 114 | - 'created_at' => \DB::raw('NOW()'), |
|
| 115 | - 'updated_at' => \DB::raw('NOW()') |
|
| 116 | - ], |
|
| 117 | - [ |
|
| 118 | - 'name' => 'findby', |
|
| 119 | - 'model' => 'permissions', |
|
| 120 | - 'created_at' => \DB::raw('NOW()'), |
|
| 121 | - 'updated_at' => \DB::raw('NOW()') |
|
| 122 | - ], |
|
| 123 | - [ |
|
| 124 | - 'name' => 'first', |
|
| 125 | - 'model' => 'permissions', |
|
| 126 | - 'created_at' => \DB::raw('NOW()'), |
|
| 127 | - 'updated_at' => \DB::raw('NOW()') |
|
| 128 | - ], |
|
| 129 | - [ |
|
| 130 | - 'name' => 'paginate', |
|
| 131 | - 'model' => 'permissions', |
|
| 132 | - 'created_at' => \DB::raw('NOW()'), |
|
| 133 | - 'updated_at' => \DB::raw('NOW()') |
|
| 134 | - ], |
|
| 135 | - [ |
|
| 136 | - 'name' => 'paginateby', |
|
| 137 | - 'model' => 'permissions', |
|
| 138 | - 'created_at' => \DB::raw('NOW()'), |
|
| 139 | - 'updated_at' => \DB::raw('NOW()') |
|
| 140 | - ], |
|
| 96 | + /** |
|
| 97 | + * Permissions model permissions. |
|
| 98 | + */ |
|
| 99 | + [ |
|
| 100 | + 'name' => 'find', |
|
| 101 | + 'model' => 'permissions', |
|
| 102 | + 'created_at' => \DB::raw('NOW()'), |
|
| 103 | + 'updated_at' => \DB::raw('NOW()') |
|
| 104 | + ], |
|
| 105 | + [ |
|
| 106 | + 'name' => 'search', |
|
| 107 | + 'model' => 'permissions', |
|
| 108 | + 'created_at' => \DB::raw('NOW()'), |
|
| 109 | + 'updated_at' => \DB::raw('NOW()') |
|
| 110 | + ], |
|
| 111 | + [ |
|
| 112 | + 'name' => 'list', |
|
| 113 | + 'model' => 'permissions', |
|
| 114 | + 'created_at' => \DB::raw('NOW()'), |
|
| 115 | + 'updated_at' => \DB::raw('NOW()') |
|
| 116 | + ], |
|
| 117 | + [ |
|
| 118 | + 'name' => 'findby', |
|
| 119 | + 'model' => 'permissions', |
|
| 120 | + 'created_at' => \DB::raw('NOW()'), |
|
| 121 | + 'updated_at' => \DB::raw('NOW()') |
|
| 122 | + ], |
|
| 123 | + [ |
|
| 124 | + 'name' => 'first', |
|
| 125 | + 'model' => 'permissions', |
|
| 126 | + 'created_at' => \DB::raw('NOW()'), |
|
| 127 | + 'updated_at' => \DB::raw('NOW()') |
|
| 128 | + ], |
|
| 129 | + [ |
|
| 130 | + 'name' => 'paginate', |
|
| 131 | + 'model' => 'permissions', |
|
| 132 | + 'created_at' => \DB::raw('NOW()'), |
|
| 133 | + 'updated_at' => \DB::raw('NOW()') |
|
| 134 | + ], |
|
| 135 | + [ |
|
| 136 | + 'name' => 'paginateby', |
|
| 137 | + 'model' => 'permissions', |
|
| 138 | + 'created_at' => \DB::raw('NOW()'), |
|
| 139 | + 'updated_at' => \DB::raw('NOW()') |
|
| 140 | + ], |
|
| 141 | 141 | |
| 142 | - /** |
|
| 143 | - * Groups model permissions. |
|
| 144 | - */ |
|
| 145 | - [ |
|
| 146 | - 'name' => 'save', |
|
| 147 | - 'model' => 'groups', |
|
| 148 | - 'created_at' => \DB::raw('NOW()'), |
|
| 149 | - 'updated_at' => \DB::raw('NOW()') |
|
| 150 | - ], |
|
| 151 | - [ |
|
| 152 | - 'name' => 'delete', |
|
| 153 | - 'model' => 'groups', |
|
| 154 | - 'created_at' => \DB::raw('NOW()'), |
|
| 155 | - 'updated_at' => \DB::raw('NOW()') |
|
| 156 | - ], |
|
| 157 | - [ |
|
| 158 | - 'name' => 'find', |
|
| 159 | - 'model' => 'groups', |
|
| 160 | - 'created_at' => \DB::raw('NOW()'), |
|
| 161 | - 'updated_at' => \DB::raw('NOW()') |
|
| 162 | - ], |
|
| 163 | - [ |
|
| 164 | - 'name' => 'search', |
|
| 165 | - 'model' => 'groups', |
|
| 166 | - 'created_at' => \DB::raw('NOW()'), |
|
| 167 | - 'updated_at' => \DB::raw('NOW()') |
|
| 168 | - ], |
|
| 169 | - [ |
|
| 170 | - 'name' => 'list', |
|
| 171 | - 'model' => 'groups', |
|
| 172 | - 'created_at' => \DB::raw('NOW()'), |
|
| 173 | - 'updated_at' => \DB::raw('NOW()') |
|
| 174 | - ], |
|
| 175 | - [ |
|
| 176 | - 'name' => 'findby', |
|
| 177 | - 'model' => 'groups', |
|
| 178 | - 'created_at' => \DB::raw('NOW()'), |
|
| 179 | - 'updated_at' => \DB::raw('NOW()') |
|
| 180 | - ], |
|
| 181 | - [ |
|
| 182 | - 'name' => 'first', |
|
| 183 | - 'model' => 'groups', |
|
| 184 | - 'created_at' => \DB::raw('NOW()'), |
|
| 185 | - 'updated_at' => \DB::raw('NOW()') |
|
| 186 | - ], |
|
| 187 | - [ |
|
| 188 | - 'name' => 'paginate', |
|
| 189 | - 'model' => 'groups', |
|
| 190 | - 'created_at' => \DB::raw('NOW()'), |
|
| 191 | - 'updated_at' => \DB::raw('NOW()') |
|
| 192 | - ], |
|
| 193 | - [ |
|
| 194 | - 'name' => 'paginateby', |
|
| 195 | - 'model' => 'groups', |
|
| 196 | - 'created_at' => \DB::raw('NOW()'), |
|
| 197 | - 'updated_at' => \DB::raw('NOW()') |
|
| 198 | - ], |
|
| 199 | - [ |
|
| 200 | - 'name' => 'assignpermissions', |
|
| 201 | - 'model' => 'groups', |
|
| 202 | - 'created_at' => \DB::raw('NOW()'), |
|
| 203 | - 'updated_at' => \DB::raw('NOW()') |
|
| 204 | - ], |
|
| 205 | - [ |
|
| 206 | - 'name' => 'users', |
|
| 207 | - 'model' => 'groups', |
|
| 208 | - 'created_at' => \DB::raw('NOW()'), |
|
| 209 | - 'updated_at' => \DB::raw('NOW()') |
|
| 210 | - ], |
|
| 211 | - ] |
|
| 212 | - ); |
|
| 142 | + /** |
|
| 143 | + * Groups model permissions. |
|
| 144 | + */ |
|
| 145 | + [ |
|
| 146 | + 'name' => 'save', |
|
| 147 | + 'model' => 'groups', |
|
| 148 | + 'created_at' => \DB::raw('NOW()'), |
|
| 149 | + 'updated_at' => \DB::raw('NOW()') |
|
| 150 | + ], |
|
| 151 | + [ |
|
| 152 | + 'name' => 'delete', |
|
| 153 | + 'model' => 'groups', |
|
| 154 | + 'created_at' => \DB::raw('NOW()'), |
|
| 155 | + 'updated_at' => \DB::raw('NOW()') |
|
| 156 | + ], |
|
| 157 | + [ |
|
| 158 | + 'name' => 'find', |
|
| 159 | + 'model' => 'groups', |
|
| 160 | + 'created_at' => \DB::raw('NOW()'), |
|
| 161 | + 'updated_at' => \DB::raw('NOW()') |
|
| 162 | + ], |
|
| 163 | + [ |
|
| 164 | + 'name' => 'search', |
|
| 165 | + 'model' => 'groups', |
|
| 166 | + 'created_at' => \DB::raw('NOW()'), |
|
| 167 | + 'updated_at' => \DB::raw('NOW()') |
|
| 168 | + ], |
|
| 169 | + [ |
|
| 170 | + 'name' => 'list', |
|
| 171 | + 'model' => 'groups', |
|
| 172 | + 'created_at' => \DB::raw('NOW()'), |
|
| 173 | + 'updated_at' => \DB::raw('NOW()') |
|
| 174 | + ], |
|
| 175 | + [ |
|
| 176 | + 'name' => 'findby', |
|
| 177 | + 'model' => 'groups', |
|
| 178 | + 'created_at' => \DB::raw('NOW()'), |
|
| 179 | + 'updated_at' => \DB::raw('NOW()') |
|
| 180 | + ], |
|
| 181 | + [ |
|
| 182 | + 'name' => 'first', |
|
| 183 | + 'model' => 'groups', |
|
| 184 | + 'created_at' => \DB::raw('NOW()'), |
|
| 185 | + 'updated_at' => \DB::raw('NOW()') |
|
| 186 | + ], |
|
| 187 | + [ |
|
| 188 | + 'name' => 'paginate', |
|
| 189 | + 'model' => 'groups', |
|
| 190 | + 'created_at' => \DB::raw('NOW()'), |
|
| 191 | + 'updated_at' => \DB::raw('NOW()') |
|
| 192 | + ], |
|
| 193 | + [ |
|
| 194 | + 'name' => 'paginateby', |
|
| 195 | + 'model' => 'groups', |
|
| 196 | + 'created_at' => \DB::raw('NOW()'), |
|
| 197 | + 'updated_at' => \DB::raw('NOW()') |
|
| 198 | + ], |
|
| 199 | + [ |
|
| 200 | + 'name' => 'assignpermissions', |
|
| 201 | + 'model' => 'groups', |
|
| 202 | + 'created_at' => \DB::raw('NOW()'), |
|
| 203 | + 'updated_at' => \DB::raw('NOW()') |
|
| 204 | + ], |
|
| 205 | + [ |
|
| 206 | + 'name' => 'users', |
|
| 207 | + 'model' => 'groups', |
|
| 208 | + 'created_at' => \DB::raw('NOW()'), |
|
| 209 | + 'updated_at' => \DB::raw('NOW()') |
|
| 210 | + ], |
|
| 211 | + ] |
|
| 212 | + ); |
|
| 213 | 213 | |
| 214 | 214 | /** |
| 215 | 215 | * Delete previous data. |
@@ -237,29 +237,29 @@ discard block |
||
| 237 | 237 | * Create Default users. |
| 238 | 238 | */ |
| 239 | 239 | $adminUserId = DB::table('users')->insertGetId( |
| 240 | - [ |
|
| 240 | + [ |
|
| 241 | 241 | 'email' => '[email protected]', |
| 242 | 242 | 'password' => bcrypt('123456'), |
| 243 | 243 | 'created_at' => \DB::raw('NOW()'), |
| 244 | 244 | 'updated_at' => \DB::raw('NOW()') |
| 245 | 245 | ] |
| 246 | - ); |
|
| 246 | + ); |
|
| 247 | 247 | |
| 248 | 248 | /** |
| 249 | 249 | * Assign users to groups. |
| 250 | 250 | */ |
| 251 | 251 | DB::table('users_groups')->insert( |
| 252 | - [ |
|
| 253 | - [ |
|
| 252 | + [ |
|
| 253 | + [ |
|
| 254 | 254 | 'user_id' => $adminUserId, |
| 255 | 255 | 'group_id' => $adminGroupId, |
| 256 | 256 | 'created_at' => \DB::raw('NOW()'), |
| 257 | 257 | 'updated_at' => \DB::raw('NOW()') |
| 258 | - ] |
|
| 259 | - ] |
|
| 260 | - ); |
|
| 258 | + ] |
|
| 259 | + ] |
|
| 260 | + ); |
|
| 261 | 261 | |
| 262 | - /** |
|
| 262 | + /** |
|
| 263 | 263 | * Assign the permissions to the admin group. |
| 264 | 264 | */ |
| 265 | 265 | $permissionIds = DB::table('permissions')->whereIn('model', ['users', 'permissions', 'groups'])->select('id')->lists('id'); |
@@ -6,53 +6,53 @@ |
||
| 6 | 6 | |
| 7 | 7 | class AclUser extends User { |
| 8 | 8 | |
| 9 | - use SoftDeletes; |
|
| 10 | - protected $table = 'users'; |
|
| 11 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 12 | - protected $hidden = ['password', 'remember_token','deleted_at']; |
|
| 13 | - protected $guarded = ['id']; |
|
| 14 | - protected $fillable = ['name', 'email', 'password']; |
|
| 15 | - public $searchable = ['name', 'email']; |
|
| 9 | + use SoftDeletes; |
|
| 10 | + protected $table = 'users'; |
|
| 11 | + protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 12 | + protected $hidden = ['password', 'remember_token','deleted_at']; |
|
| 13 | + protected $guarded = ['id']; |
|
| 14 | + protected $fillable = ['name', 'email', 'password']; |
|
| 15 | + public $searchable = ['name', 'email']; |
|
| 16 | 16 | |
| 17 | - public function getCreatedAtAttribute($value) |
|
| 18 | - { |
|
| 19 | - return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 20 | - } |
|
| 21 | - |
|
| 22 | - public function getUpdatedAtAttribute($value) |
|
| 23 | - { |
|
| 24 | - return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 25 | - } |
|
| 26 | - |
|
| 27 | - public function getDeletedAtAttribute($value) |
|
| 28 | - { |
|
| 29 | - return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * Encrypt the password attribute before |
|
| 34 | - * saving it in the storage. |
|
| 35 | - * |
|
| 36 | - * @param string $value |
|
| 37 | - */ |
|
| 38 | - public function setPasswordAttribute($value) |
|
| 39 | - { |
|
| 40 | - $this->attributes['password'] = bcrypt($value); |
|
| 41 | - } |
|
| 42 | - |
|
| 43 | - public function logs() |
|
| 44 | - { |
|
| 45 | - return $this->hasMany('App\Modules\V1\Core\Log', 'user_id'); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function groups() |
|
| 49 | - { |
|
| 50 | - return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
| 51 | - } |
|
| 17 | + public function getCreatedAtAttribute($value) |
|
| 18 | + { |
|
| 19 | + return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 20 | + } |
|
| 21 | + |
|
| 22 | + public function getUpdatedAtAttribute($value) |
|
| 23 | + { |
|
| 24 | + return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 25 | + } |
|
| 26 | + |
|
| 27 | + public function getDeletedAtAttribute($value) |
|
| 28 | + { |
|
| 29 | + return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * Encrypt the password attribute before |
|
| 34 | + * saving it in the storage. |
|
| 35 | + * |
|
| 36 | + * @param string $value |
|
| 37 | + */ |
|
| 38 | + public function setPasswordAttribute($value) |
|
| 39 | + { |
|
| 40 | + $this->attributes['password'] = bcrypt($value); |
|
| 41 | + } |
|
| 42 | + |
|
| 43 | + public function logs() |
|
| 44 | + { |
|
| 45 | + return $this->hasMany('App\Modules\V1\Core\Log', 'user_id'); |
|
| 46 | + } |
|
| 47 | + |
|
| 48 | + public function groups() |
|
| 49 | + { |
|
| 50 | + return $this->belongsToMany('\App\Modules\V1\Acl\AclGroup','users_groups','user_id','group_id')->whereNull('users_groups.deleted_at')->withTimestamps(); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - public static function boot() |
|
| 54 | - { |
|
| 55 | - parent::boot(); |
|
| 56 | - parent::observe(\App::make('App\Modules\V1\Acl\ModelObservers\AclUserObserver')); |
|
| 57 | - } |
|
| 53 | + public static function boot() |
|
| 54 | + { |
|
| 55 | + parent::boot(); |
|
| 56 | + parent::observe(\App::make('App\Modules\V1\Acl\ModelObservers\AclUserObserver')); |
|
| 57 | + } |
|
| 58 | 58 | } |
@@ -7,201 +7,201 @@ |
||
| 7 | 7 | |
| 8 | 8 | class UsersController 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 = 'users'; |
|
| 16 | - |
|
| 17 | - /** |
|
| 18 | - * List of all route actions that the base api controller |
|
| 19 | - * will skip permissions check for them. |
|
| 20 | - * @var array |
|
| 21 | - */ |
|
| 22 | - protected $skipPermissionCheck = ['account', 'logout', 'sendreset']; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * List of all route actions that the base api controller |
|
| 26 | - * will skip login check for them. |
|
| 27 | - * @var array |
|
| 28 | - */ |
|
| 29 | - protected $skipLoginCheck = ['login', 'loginSocial', 'register', 'sendreset', 'resetpassword', 'refreshtoken']; |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * The validations rules used by the base api controller |
|
| 33 | - * to check before add. |
|
| 34 | - * @var array |
|
| 35 | - */ |
|
| 36 | - protected $validationRules = [ |
|
| 37 | - 'email' => 'required|email|unique:users,email,{id}', |
|
| 38 | - 'password' => 'min:6' |
|
| 39 | - ]; |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * Return the logged in user account. |
|
| 43 | - * |
|
| 44 | - * @return \Illuminate\Http\Response |
|
| 45 | - */ |
|
| 46 | - public function account() |
|
| 47 | - { |
|
| 48 | - $relations = $this->relations && $this->relations['account'] ? $this->relations['account'] : []; |
|
| 49 | - return \Response::json(\Core::users()->account($relations), 200); |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * Block the user. |
|
| 54 | - * |
|
| 55 | - * @param integer $id |
|
| 56 | - * @return \Illuminate\Http\Response |
|
| 57 | - */ |
|
| 58 | - public function block($id) |
|
| 59 | - { |
|
| 60 | - return \Response::json(\Core::users()->block($id), 200); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Unblock the user. |
|
| 65 | - * |
|
| 66 | - * @param integer $id |
|
| 67 | - * @return \Illuminate\Http\Response |
|
| 68 | - */ |
|
| 69 | - public function unblock($id) |
|
| 70 | - { |
|
| 71 | - return \Response::json(\Core::users()->unblock($id), 200); |
|
| 72 | - } |
|
| 73 | - |
|
| 74 | - /** |
|
| 75 | - * Logout the user. |
|
| 76 | - * |
|
| 77 | - * @return \Illuminate\Http\Response |
|
| 78 | - */ |
|
| 79 | - public function logout() |
|
| 80 | - { |
|
| 81 | - return \Response::json(\Core::users()->logout(), 200); |
|
| 82 | - } |
|
| 83 | - |
|
| 84 | - /** |
|
| 85 | - * Handle a registration request. |
|
| 86 | - * |
|
| 87 | - * @param \Illuminate\Http\Request $request |
|
| 88 | - * @return \Illuminate\Http\Response |
|
| 89 | - */ |
|
| 90 | - public function register(Request $request) |
|
| 91 | - { |
|
| 92 | - $this->validate($request, [ |
|
| 93 | - 'email' => 'required|email|unique:users,email,{id}', |
|
| 94 | - 'password' => 'required|min:6' |
|
| 95 | - ]); |
|
| 96 | - |
|
| 97 | - return \Response::json(\Core::users()->register($request->only('email', 'password')), 200); |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - /** |
|
| 101 | - * Handle a login request of the none admin to the application. |
|
| 102 | - * |
|
| 103 | - * @param \Illuminate\Http\Request $request |
|
| 104 | - * @return \Illuminate\Http\Response |
|
| 105 | - */ |
|
| 106 | - public function login(Request $request) |
|
| 107 | - { |
|
| 108 | - $this->validate($request, [ |
|
| 109 | - 'email' => 'required|email', |
|
| 110 | - 'password' => 'required|min:6', |
|
| 111 | - 'admin' => 'boolean' |
|
| 112 | - ]); |
|
| 113 | - |
|
| 114 | - return \Response::json(\Core::users()->login($request->only('email', 'password'), $request->get('admin')), 200); |
|
| 115 | - } |
|
| 116 | - |
|
| 117 | - /** |
|
| 118 | - * Handle a social login request of the none admin to the application. |
|
| 119 | - * |
|
| 120 | - * @param \Illuminate\Http\Request $request |
|
| 121 | - * @return \Illuminate\Http\Response |
|
| 122 | - */ |
|
| 123 | - public function loginSocial(Request $request) |
|
| 124 | - { |
|
| 125 | - $this->validate($request, [ |
|
| 126 | - 'auth_code' => 'required_without:access_token', |
|
| 127 | - 'access_token' => 'required_without:auth_code', |
|
| 128 | - 'type' => 'required|in:facebook,google' |
|
| 129 | - ]); |
|
| 130 | - |
|
| 131 | - return \Response::json(\Core::users()->loginSocial($request->only('auth_code', 'access_token', 'type')), 200); |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - /** |
|
| 135 | - * Handle an assign groups to user request. |
|
| 136 | - * |
|
| 137 | - * @param \Illuminate\Http\Request $request |
|
| 138 | - * @return \Illuminate\Http\Response |
|
| 139 | - */ |
|
| 140 | - public function assigngroups(Request $request) |
|
| 141 | - { |
|
| 142 | - $this->validate($request, [ |
|
| 143 | - 'group_ids' => 'required|exists:groups,id', |
|
| 144 | - 'user_id' => 'required|exists:users,id' |
|
| 145 | - ]); |
|
| 146 | - |
|
| 147 | - return \Response::json(\Core::users()->assignGroups($request->get('user_id'), $request->get('group_ids')), 200); |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * Send a reset link to the given user. |
|
| 152 | - * |
|
| 153 | - * @param \Illuminate\Http\Request $request |
|
| 154 | - * @return \Illuminate\Http\Response |
|
| 155 | - */ |
|
| 156 | - public function sendreset(Request $request) |
|
| 157 | - { |
|
| 158 | - $this->validate($request, ['email' => 'required|email', 'url' => 'required|url']); |
|
| 159 | - |
|
| 160 | - return \Response::json(\Core::users()->sendReset($request->only('email'), $request->get('url')), 200); |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - /** |
|
| 164 | - * Reset the given user's password. |
|
| 165 | - * |
|
| 166 | - * @param \Illuminate\Http\Request $request |
|
| 167 | - * @return \Illuminate\Http\Response |
|
| 168 | - */ |
|
| 169 | - public function resetpassword(Request $request) |
|
| 170 | - { |
|
| 171 | - $this->validate($request, [ |
|
| 172 | - 'token' => 'required', |
|
| 173 | - 'email' => 'required|email', |
|
| 174 | - 'password' => 'required|confirmed|min:6', |
|
| 175 | - 'password_confirmation' => 'required', |
|
| 176 | - ]); |
|
| 177 | - |
|
| 178 | - return \Response::json(\Core::users()->resetPassword($request->only('email', 'password', 'password_confirmation', 'token')), 200); |
|
| 179 | - } |
|
| 180 | - |
|
| 181 | - /** |
|
| 182 | - * Change the logged in user password. |
|
| 183 | - * |
|
| 184 | - * @param \Illuminate\Http\Request $request |
|
| 185 | - * @return \Illuminate\Http\Response |
|
| 186 | - */ |
|
| 187 | - public function changePassword(Request $request) |
|
| 188 | - { |
|
| 189 | - $this->validate($request, [ |
|
| 190 | - 'old_password' => 'required', |
|
| 191 | - 'password' => 'required|confirmed|min:6', |
|
| 192 | - 'password_confirmation' => 'required', |
|
| 193 | - ]); |
|
| 194 | - |
|
| 195 | - return \Response::json(\Core::users()->changePassword($request->only('old_password', 'password', 'password_confirmation')), 200); |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - /** |
|
| 199 | - * Refresh the expired login token. |
|
| 200 | - * |
|
| 201 | - * @return \Illuminate\Http\Response |
|
| 202 | - */ |
|
| 203 | - public function refreshtoken() |
|
| 204 | - { |
|
| 205 | - return \Response::json(\Core::users()->refreshtoken(), 200); |
|
| 206 | - } |
|
| 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 = 'users'; |
|
| 16 | + |
|
| 17 | + /** |
|
| 18 | + * List of all route actions that the base api controller |
|
| 19 | + * will skip permissions check for them. |
|
| 20 | + * @var array |
|
| 21 | + */ |
|
| 22 | + protected $skipPermissionCheck = ['account', 'logout', 'sendreset']; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * List of all route actions that the base api controller |
|
| 26 | + * will skip login check for them. |
|
| 27 | + * @var array |
|
| 28 | + */ |
|
| 29 | + protected $skipLoginCheck = ['login', 'loginSocial', 'register', 'sendreset', 'resetpassword', 'refreshtoken']; |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * The validations rules used by the base api controller |
|
| 33 | + * to check before add. |
|
| 34 | + * @var array |
|
| 35 | + */ |
|
| 36 | + protected $validationRules = [ |
|
| 37 | + 'email' => 'required|email|unique:users,email,{id}', |
|
| 38 | + 'password' => 'min:6' |
|
| 39 | + ]; |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * Return the logged in user account. |
|
| 43 | + * |
|
| 44 | + * @return \Illuminate\Http\Response |
|
| 45 | + */ |
|
| 46 | + public function account() |
|
| 47 | + { |
|
| 48 | + $relations = $this->relations && $this->relations['account'] ? $this->relations['account'] : []; |
|
| 49 | + return \Response::json(\Core::users()->account($relations), 200); |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * Block the user. |
|
| 54 | + * |
|
| 55 | + * @param integer $id |
|
| 56 | + * @return \Illuminate\Http\Response |
|
| 57 | + */ |
|
| 58 | + public function block($id) |
|
| 59 | + { |
|
| 60 | + return \Response::json(\Core::users()->block($id), 200); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Unblock the user. |
|
| 65 | + * |
|
| 66 | + * @param integer $id |
|
| 67 | + * @return \Illuminate\Http\Response |
|
| 68 | + */ |
|
| 69 | + public function unblock($id) |
|
| 70 | + { |
|
| 71 | + return \Response::json(\Core::users()->unblock($id), 200); |
|
| 72 | + } |
|
| 73 | + |
|
| 74 | + /** |
|
| 75 | + * Logout the user. |
|
| 76 | + * |
|
| 77 | + * @return \Illuminate\Http\Response |
|
| 78 | + */ |
|
| 79 | + public function logout() |
|
| 80 | + { |
|
| 81 | + return \Response::json(\Core::users()->logout(), 200); |
|
| 82 | + } |
|
| 83 | + |
|
| 84 | + /** |
|
| 85 | + * Handle a registration request. |
|
| 86 | + * |
|
| 87 | + * @param \Illuminate\Http\Request $request |
|
| 88 | + * @return \Illuminate\Http\Response |
|
| 89 | + */ |
|
| 90 | + public function register(Request $request) |
|
| 91 | + { |
|
| 92 | + $this->validate($request, [ |
|
| 93 | + 'email' => 'required|email|unique:users,email,{id}', |
|
| 94 | + 'password' => 'required|min:6' |
|
| 95 | + ]); |
|
| 96 | + |
|
| 97 | + return \Response::json(\Core::users()->register($request->only('email', 'password')), 200); |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + /** |
|
| 101 | + * Handle a login request of the none admin to the application. |
|
| 102 | + * |
|
| 103 | + * @param \Illuminate\Http\Request $request |
|
| 104 | + * @return \Illuminate\Http\Response |
|
| 105 | + */ |
|
| 106 | + public function login(Request $request) |
|
| 107 | + { |
|
| 108 | + $this->validate($request, [ |
|
| 109 | + 'email' => 'required|email', |
|
| 110 | + 'password' => 'required|min:6', |
|
| 111 | + 'admin' => 'boolean' |
|
| 112 | + ]); |
|
| 113 | + |
|
| 114 | + return \Response::json(\Core::users()->login($request->only('email', 'password'), $request->get('admin')), 200); |
|
| 115 | + } |
|
| 116 | + |
|
| 117 | + /** |
|
| 118 | + * Handle a social login request of the none admin to the application. |
|
| 119 | + * |
|
| 120 | + * @param \Illuminate\Http\Request $request |
|
| 121 | + * @return \Illuminate\Http\Response |
|
| 122 | + */ |
|
| 123 | + public function loginSocial(Request $request) |
|
| 124 | + { |
|
| 125 | + $this->validate($request, [ |
|
| 126 | + 'auth_code' => 'required_without:access_token', |
|
| 127 | + 'access_token' => 'required_without:auth_code', |
|
| 128 | + 'type' => 'required|in:facebook,google' |
|
| 129 | + ]); |
|
| 130 | + |
|
| 131 | + return \Response::json(\Core::users()->loginSocial($request->only('auth_code', 'access_token', 'type')), 200); |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + /** |
|
| 135 | + * Handle an assign groups to user request. |
|
| 136 | + * |
|
| 137 | + * @param \Illuminate\Http\Request $request |
|
| 138 | + * @return \Illuminate\Http\Response |
|
| 139 | + */ |
|
| 140 | + public function assigngroups(Request $request) |
|
| 141 | + { |
|
| 142 | + $this->validate($request, [ |
|
| 143 | + 'group_ids' => 'required|exists:groups,id', |
|
| 144 | + 'user_id' => 'required|exists:users,id' |
|
| 145 | + ]); |
|
| 146 | + |
|
| 147 | + return \Response::json(\Core::users()->assignGroups($request->get('user_id'), $request->get('group_ids')), 200); |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * Send a reset link to the given user. |
|
| 152 | + * |
|
| 153 | + * @param \Illuminate\Http\Request $request |
|
| 154 | + * @return \Illuminate\Http\Response |
|
| 155 | + */ |
|
| 156 | + public function sendreset(Request $request) |
|
| 157 | + { |
|
| 158 | + $this->validate($request, ['email' => 'required|email', 'url' => 'required|url']); |
|
| 159 | + |
|
| 160 | + return \Response::json(\Core::users()->sendReset($request->only('email'), $request->get('url')), 200); |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + /** |
|
| 164 | + * Reset the given user's password. |
|
| 165 | + * |
|
| 166 | + * @param \Illuminate\Http\Request $request |
|
| 167 | + * @return \Illuminate\Http\Response |
|
| 168 | + */ |
|
| 169 | + public function resetpassword(Request $request) |
|
| 170 | + { |
|
| 171 | + $this->validate($request, [ |
|
| 172 | + 'token' => 'required', |
|
| 173 | + 'email' => 'required|email', |
|
| 174 | + 'password' => 'required|confirmed|min:6', |
|
| 175 | + 'password_confirmation' => 'required', |
|
| 176 | + ]); |
|
| 177 | + |
|
| 178 | + return \Response::json(\Core::users()->resetPassword($request->only('email', 'password', 'password_confirmation', 'token')), 200); |
|
| 179 | + } |
|
| 180 | + |
|
| 181 | + /** |
|
| 182 | + * Change the logged in user password. |
|
| 183 | + * |
|
| 184 | + * @param \Illuminate\Http\Request $request |
|
| 185 | + * @return \Illuminate\Http\Response |
|
| 186 | + */ |
|
| 187 | + public function changePassword(Request $request) |
|
| 188 | + { |
|
| 189 | + $this->validate($request, [ |
|
| 190 | + 'old_password' => 'required', |
|
| 191 | + 'password' => 'required|confirmed|min:6', |
|
| 192 | + 'password_confirmation' => 'required', |
|
| 193 | + ]); |
|
| 194 | + |
|
| 195 | + return \Response::json(\Core::users()->changePassword($request->only('old_password', 'password', 'password_confirmation')), 200); |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + /** |
|
| 199 | + * Refresh the expired login token. |
|
| 200 | + * |
|
| 201 | + * @return \Illuminate\Http\Response |
|
| 202 | + */ |
|
| 203 | + public function refreshtoken() |
|
| 204 | + { |
|
| 205 | + return \Response::json(\Core::users()->refreshtoken(), 200); |
|
| 206 | + } |
|
| 207 | 207 | } |
@@ -8,53 +8,53 @@ |
||
| 8 | 8 | |
| 9 | 9 | class GroupsController extends BaseApiController |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * The name of the model that is used by the base api controller |
|
| 13 | - * to preform actions like (add, edit ... etc). |
|
| 14 | - * @var string |
|
| 15 | - */ |
|
| 16 | - protected $model = 'groups'; |
|
| 11 | + /** |
|
| 12 | + * The name of the model that is used by the base api controller |
|
| 13 | + * to preform actions like (add, edit ... etc). |
|
| 14 | + * @var string |
|
| 15 | + */ |
|
| 16 | + protected $model = 'groups'; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * The validations rules used by the base api controller |
|
| 20 | - * to check before add. |
|
| 21 | - * @var array |
|
| 22 | - */ |
|
| 23 | - protected $validationRules = [ |
|
| 24 | - 'name' => 'required|string|max:100|unique:groups,name,{id}' |
|
| 25 | - ]; |
|
| 18 | + /** |
|
| 19 | + * The validations rules used by the base api controller |
|
| 20 | + * to check before add. |
|
| 21 | + * @var array |
|
| 22 | + */ |
|
| 23 | + protected $validationRules = [ |
|
| 24 | + 'name' => 'required|string|max:100|unique:groups,name,{id}' |
|
| 25 | + ]; |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * Handle an assign permissions to group request. |
|
| 29 | - * |
|
| 30 | - * @param \Illuminate\Http\Request $request |
|
| 31 | - * @return \Illuminate\Http\Response |
|
| 32 | - */ |
|
| 33 | - public function assignpermissions(Request $request) |
|
| 34 | - { |
|
| 35 | - $this->validate($request, [ |
|
| 36 | - 'permission_ids' => 'required|exists:permissions,id', |
|
| 37 | - 'group_id' => 'required|array|exists:groups,id' |
|
| 38 | - ]); |
|
| 27 | + /** |
|
| 28 | + * Handle an assign permissions to group request. |
|
| 29 | + * |
|
| 30 | + * @param \Illuminate\Http\Request $request |
|
| 31 | + * @return \Illuminate\Http\Response |
|
| 32 | + */ |
|
| 33 | + public function assignpermissions(Request $request) |
|
| 34 | + { |
|
| 35 | + $this->validate($request, [ |
|
| 36 | + 'permission_ids' => 'required|exists:permissions,id', |
|
| 37 | + 'group_id' => 'required|array|exists:groups,id' |
|
| 38 | + ]); |
|
| 39 | 39 | |
| 40 | - return \Response::json(\Core::groups()->assignPermissions($request->get('group_id'), $request->get('permission_ids')), 200); |
|
| 41 | - } |
|
| 40 | + return \Response::json(\Core::groups()->assignPermissions($request->get('group_id'), $request->get('permission_ids')), 200); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Return the users in the given group in pages. |
|
| 45 | - * |
|
| 46 | - * @param integer $groupId |
|
| 47 | - * @param integer $perPage |
|
| 48 | - * @param string $sortBy |
|
| 49 | - * @param boolean $desc |
|
| 50 | - * @return \Illuminate\Http\Response |
|
| 51 | - */ |
|
| 52 | - public function users($groupId, $perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
| 53 | - { |
|
| 54 | - if ($this->model) |
|
| 55 | - { |
|
| 56 | - $relations = $this->relations && $this->relations['users'] ? $this->relations['users'] : []; |
|
| 57 | - return \Response::json(call_user_func_array("\Core::{$this->model}", [])->users($groupId, $perPage, $relations, $sortBy, $desc), 200); |
|
| 58 | - } |
|
| 59 | - } |
|
| 43 | + /** |
|
| 44 | + * Return the users in the given group in pages. |
|
| 45 | + * |
|
| 46 | + * @param integer $groupId |
|
| 47 | + * @param integer $perPage |
|
| 48 | + * @param string $sortBy |
|
| 49 | + * @param boolean $desc |
|
| 50 | + * @return \Illuminate\Http\Response |
|
| 51 | + */ |
|
| 52 | + public function users($groupId, $perPage = 15, $sortBy = 'created_at', $desc = 1) |
|
| 53 | + { |
|
| 54 | + if ($this->model) |
|
| 55 | + { |
|
| 56 | + $relations = $this->relations && $this->relations['users'] ? $this->relations['users'] : []; |
|
| 57 | + return \Response::json(call_user_func_array("\Core::{$this->model}", [])->users($groupId, $perPage, $relations, $sortBy, $desc), 200); |
|
| 58 | + } |
|
| 59 | + } |
|
| 60 | 60 | } |
@@ -2,22 +2,22 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * List of error messages used in core module. |
|
| 7 | - */ |
|
| 8 | - 'unAuthorized' => 'من فضلك قم بتسجيل الدخول', |
|
| 9 | - 'tokenExpired' => 'انتهت صلاحية الدخول', |
|
| 10 | - 'noPermissions' => 'لا توجد صلاحية', |
|
| 11 | - 'loginFailed' => 'خطأ في البريد لاكتروني او كلمة المرور', |
|
| 12 | - 'redisNotRunning' => 'سيرفير الاشعارات لايعمل', |
|
| 13 | - 'dbQueryError' => 'خطا في البيانات', |
|
| 14 | - 'cannotCreateSetting' => 'لا يمكن اضافة اعدادات', |
|
| 15 | - 'cannotUpdateSettingKey' => 'لا يمكن تعديل اعدادات', |
|
| 16 | - 'userIsBlocked' => 'لقد تم حظرك', |
|
| 17 | - 'invalidResetToken' => 'رمز تعديل كلمة المرور خطا', |
|
| 18 | - 'invalidResetPassword' => 'خطا في نعديل كلمة المرور', |
|
| 19 | - 'invalidOldPassword' => 'كلمة السر القديمه خطا', |
|
| 20 | - 'notFound' => 'ال :replace المطلوب غير موجود', |
|
| 21 | - 'generalError' => 'حدث خطا ما', |
|
| 5 | + /** |
|
| 6 | + * List of error messages used in core module. |
|
| 7 | + */ |
|
| 8 | + 'unAuthorized' => 'من فضلك قم بتسجيل الدخول', |
|
| 9 | + 'tokenExpired' => 'انتهت صلاحية الدخول', |
|
| 10 | + 'noPermissions' => 'لا توجد صلاحية', |
|
| 11 | + 'loginFailed' => 'خطأ في البريد لاكتروني او كلمة المرور', |
|
| 12 | + 'redisNotRunning' => 'سيرفير الاشعارات لايعمل', |
|
| 13 | + 'dbQueryError' => 'خطا في البيانات', |
|
| 14 | + 'cannotCreateSetting' => 'لا يمكن اضافة اعدادات', |
|
| 15 | + 'cannotUpdateSettingKey' => 'لا يمكن تعديل اعدادات', |
|
| 16 | + 'userIsBlocked' => 'لقد تم حظرك', |
|
| 17 | + 'invalidResetToken' => 'رمز تعديل كلمة المرور خطا', |
|
| 18 | + 'invalidResetPassword' => 'خطا في نعديل كلمة المرور', |
|
| 19 | + 'invalidOldPassword' => 'كلمة السر القديمه خطا', |
|
| 20 | + 'notFound' => 'ال :replace المطلوب غير موجود', |
|
| 21 | + 'generalError' => 'حدث خطا ما', |
|
| 22 | 22 | |
| 23 | 23 | ]; |
| 24 | 24 | \ No newline at end of file |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /* |
|
| 5 | + /* |
|
| 6 | 6 | |-------------------------------------------------------------------------- |
| 7 | 7 | | Authentication Language Lines |
| 8 | 8 | |-------------------------------------------------------------------------- |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | - 'failed' => 'These credentials do not match our records.', |
|
| 17 | - 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', |
|
| 16 | + 'failed' => 'These credentials do not match our records.', |
|
| 17 | + 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', |
|
| 18 | 18 | |
| 19 | 19 | ]; |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /* |
|
| 5 | + /* |
|
| 6 | 6 | |-------------------------------------------------------------------------- |
| 7 | 7 | | Validation Language Lines |
| 8 | 8 | |-------------------------------------------------------------------------- |
@@ -13,74 +13,74 @@ discard block |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | - 'accepted' => 'The :attribute must be accepted.', |
|
| 17 | - 'active_url' => 'The :attribute is not a valid URL.', |
|
| 18 | - 'after' => 'The :attribute must be a date after :date.', |
|
| 19 | - 'alpha' => 'The :attribute may only contain letters.', |
|
| 20 | - 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', |
|
| 21 | - 'alpha_num' => 'The :attribute may only contain letters and numbers.', |
|
| 22 | - 'array' => 'The :attribute must be an array.', |
|
| 23 | - 'before' => 'The :attribute must be a date before :date.', |
|
| 24 | - 'between' => [ |
|
| 25 | - 'numeric' => 'The :attribute must be between :min and :max.', |
|
| 26 | - 'file' => 'The :attribute must be between :min and :max kilobytes.', |
|
| 27 | - 'string' => 'The :attribute must be between :min and :max characters.', |
|
| 28 | - 'array' => 'The :attribute must have between :min and :max items.', |
|
| 29 | - ], |
|
| 30 | - 'boolean' => 'The :attribute field must be true or false.', |
|
| 31 | - 'confirmed' => 'The :attribute confirmation does not match.', |
|
| 32 | - 'date' => 'The :attribute is not a valid date.', |
|
| 33 | - 'date_format' => 'The :attribute does not match the format :format.', |
|
| 34 | - 'different' => 'The :attribute and :other must be different.', |
|
| 35 | - 'digits' => 'The :attribute must be :digits digits.', |
|
| 36 | - 'digits_between' => 'The :attribute must be between :min and :max digits.', |
|
| 37 | - '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.', |
|
| 16 | + 'accepted' => 'The :attribute must be accepted.', |
|
| 17 | + 'active_url' => 'The :attribute is not a valid URL.', |
|
| 18 | + 'after' => 'The :attribute must be a date after :date.', |
|
| 19 | + 'alpha' => 'The :attribute may only contain letters.', |
|
| 20 | + 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', |
|
| 21 | + 'alpha_num' => 'The :attribute may only contain letters and numbers.', |
|
| 22 | + 'array' => 'The :attribute must be an array.', |
|
| 23 | + 'before' => 'The :attribute must be a date before :date.', |
|
| 24 | + 'between' => [ |
|
| 25 | + 'numeric' => 'The :attribute must be between :min and :max.', |
|
| 26 | + 'file' => 'The :attribute must be between :min and :max kilobytes.', |
|
| 27 | + 'string' => 'The :attribute must be between :min and :max characters.', |
|
| 28 | + 'array' => 'The :attribute must have between :min and :max items.', |
|
| 29 | + ], |
|
| 30 | + 'boolean' => 'The :attribute field must be true or false.', |
|
| 31 | + 'confirmed' => 'The :attribute confirmation does not match.', |
|
| 32 | + 'date' => 'The :attribute is not a valid date.', |
|
| 33 | + 'date_format' => 'The :attribute does not match the format :format.', |
|
| 34 | + 'different' => 'The :attribute and :other must be different.', |
|
| 35 | + 'digits' => 'The :attribute must be :digits digits.', |
|
| 36 | + 'digits_between' => 'The :attribute must be between :min and :max digits.', |
|
| 37 | + '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 | 82 | |
| 83 | - /* |
|
| 83 | + /* |
|
| 84 | 84 | |-------------------------------------------------------------------------- |
| 85 | 85 | | Custom Validation Language Lines |
| 86 | 86 | |-------------------------------------------------------------------------- |
@@ -91,13 +91,13 @@ discard block |
||
| 91 | 91 | | |
| 92 | 92 | */ |
| 93 | 93 | |
| 94 | - 'custom' => [ |
|
| 95 | - 'attribute-name' => [ |
|
| 96 | - 'rule-name' => 'custom-message', |
|
| 97 | - ], |
|
| 98 | - ], |
|
| 94 | + 'custom' => [ |
|
| 95 | + 'attribute-name' => [ |
|
| 96 | + 'rule-name' => 'custom-message', |
|
| 97 | + ], |
|
| 98 | + ], |
|
| 99 | 99 | |
| 100 | - /* |
|
| 100 | + /* |
|
| 101 | 101 | |-------------------------------------------------------------------------- |
| 102 | 102 | | Custom Validation Attributes |
| 103 | 103 | |-------------------------------------------------------------------------- |
@@ -108,6 +108,6 @@ discard block |
||
| 108 | 108 | | |
| 109 | 109 | */ |
| 110 | 110 | |
| 111 | - 'attributes' => [], |
|
| 111 | + 'attributes' => [], |
|
| 112 | 112 | |
| 113 | 113 | ]; |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * Here goes your notification messages. |
|
| 7 | - */ |
|
| 5 | + /** |
|
| 6 | + * Here goes your notification messages. |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | ]; |
| 10 | 10 | \ No newline at end of file |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | 4 | |
| 5 | - /* |
|
| 5 | + /* |
|
| 6 | 6 | |-------------------------------------------------------------------------- |
| 7 | 7 | | Password Reset Language Lines |
| 8 | 8 | |-------------------------------------------------------------------------- |
@@ -13,10 +13,10 @@ discard block |
||
| 13 | 13 | | |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | - 'password' => '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.", |
|
| 16 | + 'password' => '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 | 21 | |
| 22 | 22 | ]; |