Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Controller:
- <?php namespace App\Http\Controllers;
- use App\Http\Requests;
- use App\Http\Controllers\Controller;
- use Illuminate\Validation\Factory;
- use Illuminate\Validation\Validator;
- use Illuminate\Http\Request;
- class UsersController extends Controller {
- /**
- * Display a listing of the resource.
- *
- * @return Response
- */
- public function index()
- {
- return view('home');
- }
- /**
- * Display login page.
- *
- * @return Response
- */
- public function login()
- {
- return view('auth.login');
- }
- /**
- * Show the form for registering new member.
- *
- * @return Response
- */
- public function getCreate()
- {
- return view('auth.register');
- }
- /**
- * Show the form for creating a new resource.
- *
- * @return Response
- */
- public function postCreate()
- {
- //$input = Request::all();
- $validator = Validator::make($request::all(),
- array(
- 'email' => 'required|max:150|email|unique:users',
- 'username' => 'required|max:60|min:3|unique:users',
- 'password' => 'required|min:6',
- 'password_again' => 'required|same:password'
- )
- );
- /*
- $validator = Validator::make($request->all(), [
- 'title' => 'required|unique|max:255',
- 'body' => 'required',
- ]);
- */
- if($validator->fails()) {
- return 'Something wrong!';
- } else {
- return 'Validation no error.';
- }
- }
- /**
- * Store a newly created resource in storage.
- *
- * @return Response
- */
- public function store()
- {
- //
- }
- /**
- * Display the specified resource.
- *
- * @param int $id
- * @return Response
- */
- public function show($id)
- {
- //
- }
- /**
- * Show the form for editing the specified resource.
- *
- * @param int $id
- * @return Response
- */
- public function edit($id)
- {
- //
- }
- /**
- * Update the specified resource in storage.
- *
- * @param int $id
- * @return Response
- */
- public function update($id)
- {
- //
- }
- /**
- * Remove the specified resource from storage.
- *
- * @param int $id
- * @return Response
- */
- public function destroy($id)
- {
- //
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement