@@ -50,7 +50,7 @@ |
||
| 50 | 50 | * |
| 51 | 51 | * @param \Illuminate\Http\Request $request |
| 52 | 52 | * |
| 53 | - * @return \Illuminate\Http\Response |
|
| 53 | + * @return \Illuminate\Http\RedirectResponse |
|
| 54 | 54 | */ |
| 55 | 55 | public function register(Request $request, Users $users) |
| 56 | 56 | { |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | protected $data = []; // the information we send to the view |
| 17 | 17 | |
| 18 | - use RegistersUsers; |
|
| 18 | + use RegistersUsers; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Create a new controller instance. |
@@ -77,24 +77,24 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function validator(array $data) |
| 79 | 79 | { |
| 80 | - $user_model = config('back-project.user_model'); |
|
| 81 | - $user = new $user_model; |
|
| 82 | - $users_table = $user->getTable(); |
|
| 80 | + $user_model = config('back-project.user_model'); |
|
| 81 | + $user = new $user_model; |
|
| 82 | + $users_table = $user->getTable(); |
|
| 83 | 83 | |
| 84 | - return Validator::make($data, [ |
|
| 84 | + return Validator::make($data, [ |
|
| 85 | 85 | 'username' => 'required|max:255|unique:'.$users_table, |
| 86 | 86 | 'email' => 'required|email|max:255|unique:'.$users_table, |
| 87 | 87 | 'password' => 'required|min:6|confirmed' |
| 88 | - ]); |
|
| 88 | + ]); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | public function confirm(Users $users, $code, $username) { |
| 92 | - if ($users->findBy('username', $username)->confirm($code)) { |
|
| 93 | - Alert::add('success', trans('back-project::base.user_confirmed'))->flash(); |
|
| 94 | - } else { |
|
| 95 | - Alert::add('error', trans('back-project::base.user_not_confirmed'))->flash(); |
|
| 96 | - } |
|
| 92 | + if ($users->findBy('username', $username)->confirm($code)) { |
|
| 93 | + Alert::add('success', trans('back-project::base.user_confirmed'))->flash(); |
|
| 94 | + } else { |
|
| 95 | + Alert::add('error', trans('back-project::base.user_not_confirmed'))->flash(); |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | - return redirect(route('login')); |
|
| 98 | + return redirect(route('login')); |
|
| 99 | 99 | } |
| 100 | 100 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | /** |
| 17 | 17 | * Custom authorization method. Use only if you are managing a model with "user_id" field |
| 18 | 18 | * |
| 19 | - * @param $ability |
|
| 19 | + * @param string $ability |
|
| 20 | 20 | * @param array $record |
| 21 | 21 | */ |
| 22 | 22 | public function bCAuthorize($ability, $record = []) |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | * Get the notification's delivery channels. |
| 28 | 28 | * |
| 29 | 29 | * @param mixed $notifiable |
| 30 | - * @return array |
|
| 30 | + * @return string[] |
|
| 31 | 31 | */ |
| 32 | 32 | public function via($notifiable) |
| 33 | 33 | { |
@@ -96,6 +96,9 @@ |
||
| 96 | 96 | return $this->model->findOrCreate($data); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | + /** |
|
| 100 | + * @param string $attribute |
|
| 101 | + */ |
|
| 99 | 102 | public function findBy($attribute, $value, $columns = array('*')) |
| 100 | 103 | { |
| 101 | 104 | $this->applyCriteria(); |
@@ -26,6 +26,9 @@ |
||
| 26 | 26 | return $this->model->withDepth()->find($id, $columns); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | + /** |
|
| 30 | + * @param string $name |
|
| 31 | + */ |
|
| 29 | 32 | public function tree($name) |
| 30 | 33 | { |
| 31 | 34 | $root = $this->findBy('name', $name); |
@@ -97,6 +97,9 @@ |
||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | + /** |
|
| 101 | + * @param string $name |
|
| 102 | + */ |
|
| 100 | 103 | public function getUniqueUsername($name) |
| 101 | 104 | { |
| 102 | 105 | $nrRand = rand(0,100); |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | public function __construct() |
| 13 | 13 | { |
| 14 | - $this->table_menus = config('back-project.menus.table'); |
|
| 14 | + $this->table_menus = config('back-project.menus.table'); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -22,17 +22,17 @@ discard block |
||
| 22 | 22 | public function up() |
| 23 | 23 | { |
| 24 | 24 | Schema::create($this->table_menus, function (Blueprint $table) { |
| 25 | - $table->increments('id'); |
|
| 26 | - $table->string('name')->index(); |
|
| 27 | - $table->string('permission')->nullable()->index(); |
|
| 28 | - $table->string('title'); |
|
| 29 | - $table->string('description')->nullable(); |
|
| 30 | - $table->string('route')->nullable(); |
|
| 31 | - $table->string('icon')->nullable(); |
|
| 32 | - $table->boolean('is_active')->default(1); |
|
| 25 | + $table->increments('id'); |
|
| 26 | + $table->string('name')->index(); |
|
| 27 | + $table->string('permission')->nullable()->index(); |
|
| 28 | + $table->string('title'); |
|
| 29 | + $table->string('description')->nullable(); |
|
| 30 | + $table->string('route')->nullable(); |
|
| 31 | + $table->string('icon')->nullable(); |
|
| 32 | + $table->boolean('is_active')->default(1); |
|
| 33 | 33 | $table->boolean('is_protected')->default(0); |
| 34 | - NestedSet::columns($table); |
|
| 35 | - $table->timestamps(); |
|
| 34 | + NestedSet::columns($table); |
|
| 35 | + $table->timestamps(); |
|
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | }); |
@@ -8,16 +8,16 @@ |
||
| 8 | 8 | public function up() |
| 9 | 9 | { |
| 10 | 10 | Schema::table('users', function(Blueprint $table) { |
| 11 | - $table->string('email')->nullable()->change(); |
|
| 12 | - $table->boolean('is_social')->nullable()->default(0); |
|
| 11 | + $table->string('email')->nullable()->change(); |
|
| 12 | + $table->boolean('is_social')->nullable()->default(0); |
|
| 13 | 13 | }); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function down() |
| 17 | 17 | { |
| 18 | 18 | Schema::table('users', function(Blueprint $table) { |
| 19 | - $table->dropColumn('is_social'); |
|
| 20 | - $table->string('email')->change(); |
|
| 19 | + $table->dropColumn('is_social'); |
|
| 20 | + $table->string('email')->change(); |
|
| 21 | 21 | }); |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | \ No newline at end of file |
@@ -33,8 +33,8 @@ |
||
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | 35 | Schema::create('attachables', function(Blueprint $table) { |
| 36 | - $table->integer('attachment_id')->unsigned(); |
|
| 37 | - $table->morphs('attachable'); |
|
| 36 | + $table->integer('attachment_id')->unsigned(); |
|
| 37 | + $table->morphs('attachable'); |
|
| 38 | 38 | }); |
| 39 | 39 | } |
| 40 | 40 | |