Commit f5b8838c by Farendi Giotivano R.P

update fakultas mahasiswa

parent 5210cdff
......@@ -2,8 +2,11 @@
namespace App\Http\Controllers;
use App\Models\Auth\Biodata;
use App\Models\Pengumuman;
use App\Models\Sms;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class DashboardController extends Controller
{
......@@ -18,6 +21,18 @@ class DashboardController extends Controller
$title = 'Dashboard PKM';
$pengumuman = $pengumuman = Pengumuman::query()->first();
if(Auth::user()->hasrole(['mahasiswa'])){
$user = Auth::user()->rBiodata->noidentitas;
$dataMhs = GetDataApiController::getAccount($user);
$faks = Sms::where('id_sms', $dataMhs['data_mahasiswa']['id_sms'])->first();
$person['fakultas'] = $faks->parent->nm_lemb;
$biodata = Biodata::where('noidentitas', $user)->first();
$biodata->update($person);
}
$data = [
'title' => $title,
'pengumuman' => $pengumuman,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment