@@ -32,10 +32,10 @@ |
||
32 | 32 | */ |
33 | 33 | public function store(Request $request, RegisterForm $form) |
34 | 34 | { |
35 | - $user = \TaskManager\User::create($request->only('email','name','password')); |
|
36 | - auth()->login($user); |
|
37 | - \Mail::to($user)->send(new WelcomeNewUser($user)); |
|
38 | - return redirect()->home(); |
|
35 | + $user = \TaskManager\User::create($request->only('email','name','password')); |
|
36 | + auth()->login($user); |
|
37 | + \Mail::to($user)->send(new WelcomeNewUser($user)); |
|
38 | + return redirect()->home(); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function store(Request $request, RegisterForm $form) |
34 | 34 | { |
35 | - $user = \TaskManager\User::create($request->only('email','name','password')); |
|
35 | + $user = \TaskManager\User::create($request->only('email', 'name', 'password')); |
|
36 | 36 | auth()->login($user); |
37 | 37 | \Mail::to($user)->send(new WelcomeNewUser($user)); |
38 | 38 | return redirect()->home(); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function store(Request $request, LoginForm $form) |
37 | 37 | { |
38 | - if (auth()->attempt(['email' => $request->get('email'), 'password' => $request->get('password')])) { |
|
38 | + if (auth()->attempt([ 'email' => $request->get('email'), 'password' => $request->get('password') ])) { |
|
39 | 39 | return redirect()->home(); |
40 | 40 | } else { |
41 | 41 | return redirect()->back()->withErrors('Invalid email or password'); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | */ |
20 | 20 | public function store() |
21 | 21 | { |
22 | - if(!$this->api->exists()) { |
|
22 | + if (!$this->api->exists()) { |
|
23 | 23 | $this->api->generateKey(); |
24 | 24 | session()->flash('suc_key', 'API key added successfully'); |
25 | 25 | return redirect()->back(); |
@@ -26,17 +26,17 @@ |
||
26 | 26 | /** |
27 | 27 | * @return mixed |
28 | 28 | */ |
29 | - public function allTask(){ |
|
30 | - return $this->task->where('user_id', auth()->id())->orderBy('created_at', 'desc')->get()->groupBy(function($data){ |
|
29 | + public function allTask() { |
|
30 | + return $this->task->where('user_id', auth()->id())->orderBy('created_at', 'desc')->get()->groupBy(function($data) { |
|
31 | 31 | return Carbon::parse($data->created_at)->format('d.m.Y'); |
32 | 32 | }); |
33 | 33 | } |
34 | 34 | /** |
35 | 35 | * @param Tasks $c_task |
36 | 36 | */ |
37 | - public function mark(Tasks $c_task){ |
|
38 | - $c_task = $this->task->where('id', $c_task->id)->first(); |
|
39 | - $c_task->complete=true; |
|
37 | + public function mark(Tasks $c_task) { |
|
38 | + $c_task = $this->task->where('id', $c_task->id)->first(); |
|
39 | + $c_task->complete = true; |
|
40 | 40 | $c_task->save(); |
41 | 41 | } |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | protected $fillable = [ |
18 | 18 | 'name', 'email', 'password', |
19 | 19 | ]; |
20 | - protected $guarded = ['token']; |
|
20 | + protected $guarded = [ 'token' ]; |
|
21 | 21 | /** |
22 | 22 | * The attributes that should be hidden for arrays. |
23 | 23 | * |
@@ -27,13 +27,13 @@ discard block |
||
27 | 27 | 'password', 'remember_token', |
28 | 28 | ]; |
29 | 29 | |
30 | - public function setPasswordAttribute($value){ |
|
31 | - $this->attributes['password'] = bcrypt($value); |
|
30 | + public function setPasswordAttribute($value) { |
|
31 | + $this->attributes[ 'password' ] = bcrypt($value); |
|
32 | 32 | } |
33 | - public function apikeys(){ |
|
33 | + public function apikeys() { |
|
34 | 34 | return $this->hasOne('\App\ApiKeys'); |
35 | 35 | } |
36 | - public function tasks(){ |
|
36 | + public function tasks() { |
|
37 | 37 | return $this->hasMany('\TaskManager\Tasks'); |
38 | 38 | } |
39 | 39 |