Created
March 18, 2020 02:39
-
-
Save DianSano/d91ade51b30ff732a5cd27e1b3d0f5fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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\Perusahaan; | |
| class ControllerPerusahaan extends Controller | |
| { | |
| function update(Request $req) | |
| { | |
| $updateperusahaan = Perusahaan::find($req->id); | |
| $updateperusahaan->nama = $req->nama; | |
| $updateperusahaan->alamat = $req->alamat; | |
| $updateperusahaan->save(); | |
| echo "Update berhasil"; | |
| } | |
| function delete(Request $req) | |
| { | |
| //$deletePerusahaan = Perusahaan::find($req->id); | |
| //echo $deletePerusahaan->delete() . " baris sukses di delete"; | |
| echo Perusahaan::destroy([4,5,6,8]); | |
| } | |
| function save(Request $req) | |
| { | |
| $perusahaan = new Perusahaan; | |
| $perusahaan->nama = $req->nama; | |
| $perusahaan->alamat = $req->alamat; | |
| echo $perusahaan->save() . " berhasil disimpan"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment