Created
August 3, 2019 13:58
-
-
Save fhulufhelo/429eabb73b04a93b8a522520a50b51fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
class UsersController extends Controller | |
{ | |
/** | |
* Store a newly created resource in storage. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @return \Illuminate\Http\Response | |
*/ | |
public function store(Request $request) | |
{ | |
// $request/$_POST = [ | |
// name => Joe Doe, | |
// email => joe.doe.example.com, | |
// password => secret, | |
// password_confirmation => secret, | |
// role => 'seller', | |
// ]; | |
// | |
if ( $request['role'] == 'seller') { | |
# proceed this way | |
} elseif ( $request['role'] == 'buyer') { | |
# proceed this another | |
} else { | |
# Do this | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment