Skip to content

Instantly share code, notes, and snippets.

@fhulufhelo
Created August 3, 2019 13:58
Show Gist options
  • Save fhulufhelo/429eabb73b04a93b8a522520a50b51fb to your computer and use it in GitHub Desktop.
Save fhulufhelo/429eabb73b04a93b8a522520a50b51fb to your computer and use it in GitHub Desktop.
<?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