Last active
December 4, 2020 23:32
-
-
Save aryadiahmad4689/770c868b6f85ae1fb794d9fe0c359d55 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; | |
use Illuminate\Http\Request; | |
use App\Customer; | |
class CustomerController extends Controller | |
{ | |
public function index() | |
{ | |
$customers = Customer::all(); | |
return view('customer.index',compact('customers')); | |
} | |
public function create() | |
{ | |
return view('customer.create'); | |
} | |
public function store(Request $request) | |
{ | |
$customer = new Customer; | |
$customer->name = $request->nama; | |
$customer->email = $request->email; | |
$customer->save(); | |
return redirect()->route('customer.index'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment