Skip to content

Instantly share code, notes, and snippets.

@fhulufhelo
Created August 3, 2019 13:58
<?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