Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Rowaina committed Apr 26, 2018
1 parent 86f62dc commit 61ae5f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ Homestead.yaml
npm-debug.log
yarn-error.log
.env
composer.lock

composer.lock
6 changes: 3 additions & 3 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function __construct()
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
'name' => 'required|string|max:255',
'email' => 'required|string|email|max:255|unique:users',
'password' => 'required|string|min:6|confirmed',
]);
}

Expand Down
15 changes: 6 additions & 9 deletions app/Http/Controllers/ManagerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
use App\Manager;
use App\User;
use App\Createdby;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;
use App\Http\Requests\EditManagerRequest;
use App\Http\Requests\StoreManagerRequest;
use Image;

class ManagerController extends Controller
{
Expand All @@ -19,9 +19,8 @@ class ManagerController extends Controller
*/
public function index()
{

$manager=Manager::all();
return view("Manager.index",[
return view("manager.index",[
"managers"=> $manager
]);
}
Expand All @@ -32,8 +31,8 @@ public function index()
* @return \Illuminate\Http\Response
*/
public function create()
{
return view ("Manager.create");
{
return view ("manager.create");
}

/**
Expand All @@ -44,7 +43,6 @@ public function create()
*/
public function store(StoreManagerRequest $request)
{

$data = $request->all();
if($request->hasFile('photo')){
$photo = $request->file('photo');
Expand All @@ -57,9 +55,8 @@ public function store(StoreManagerRequest $request)
}
$user = User::create($data);
$data['user_id'] = $user->id ;

$manager = Manager::create($data);
// Createdby::create(['creator' => Auth::id() , 'created_by' => $manager->id]);
Createdby::create(['creator' => Auth::id() , 'created_by' => $manager->id]);
// $manager->assignRole('Manager');
return redirect(route('managers.index'));
}
Expand All @@ -83,7 +80,7 @@ public function show(Manager $manager)
*/
public function edit(Manager $manager)
{
return view("Manager.edit",["managers"=>$manager]);
return view("manager.edit",["managers"=>$manager]);
}

/**
Expand Down

0 comments on commit 61ae5f7

Please sign in to comment.