-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
733 additions
and
540 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\ProfilKampus; | ||
use Illuminate\Http\Request; | ||
use Inertia\Inertia; | ||
|
||
class ProfilKampusController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
*/ | ||
private $data = [ | ||
'baseUrl'=>'/profilKampus', | ||
'title'=>'Profil Kampus' | ||
]; | ||
|
||
public function index() | ||
{ | ||
$this->data['data'] = ProfilKampus::first(); | ||
return Inertia('ProfilKampus/Index',$this->data); | ||
} | ||
|
||
/** | ||
* Store a newly created resource in storage. | ||
*/ | ||
public function store(Request $request) | ||
{ | ||
$request->validate([ | ||
'nama_kampus'=>'required', | ||
'singkatan'=>'required', | ||
'email'=>'email|required', | ||
'logo'=>'mimes:png', | ||
'alamat'=>'required' | ||
]); | ||
|
||
ProfilKampus::where('id_kampus','1')->update($request->all()); | ||
|
||
return redirect()->route('profilkampus')->with('success','berhasil memperbarui profil kampus'); | ||
} | ||
|
||
/** | ||
* Display the specified resource. | ||
*/ | ||
public function show(ProfilKampus $profilKampus) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Show the form for editing the specified resource. | ||
*/ | ||
public function edit(ProfilKampus $profilKampus) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Update the specified resource in storage. | ||
*/ | ||
public function update(Request $request, ProfilKampus $profilKampus) | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Remove the specified resource from storage. | ||
*/ | ||
public function destroy(ProfilKampus $profilKampus) | ||
{ | ||
// | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class ProfilKampus extends Model | ||
{ | ||
use HasFactory; | ||
protected $primaryKey = 'id_kampus'; | ||
} |
Oops, something went wrong.