update
parent
6ca0ded390
commit
bb749e0cc6
|
|
@ -137,7 +137,7 @@ class ProfileController extends Controller
|
|||
'password.regex' => 'Format Kata Sandi harus mengandung minimal Huruf Besar, Huruf Kecil, Angka, Spesial Karakter',
|
||||
])->validate();
|
||||
|
||||
$profile = Profile::where('npsn',auth()->user()->username)->first();
|
||||
$profile = Profile::where('npsn',auth()->user()->profile->npsn)->first();
|
||||
$profile->alamat_sekolah = $request->alamat_sekolah;
|
||||
$profile->kontak_person = $request->kontak_person;
|
||||
$profile->telp = $request->telp;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ use Illuminate\Http\Request;
|
|||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Auth;
|
||||
use App\Models\User;
|
||||
use App\Models\Master\Sekolah;
|
||||
|
||||
class Profile
|
||||
{
|
||||
|
|
@ -18,9 +17,9 @@ class Profile
|
|||
*/
|
||||
public function handle(Request $request, Closure $next): Response
|
||||
{
|
||||
$user = Sekolah::where('npsn',auth()->user()->username)->first();
|
||||
if(!@$user && (auth()->user()->ms_group_id == 2)){
|
||||
return redirect('profile-sekolah/lengkapi/'.encode_id(auth()->user()->username));
|
||||
$user = User::with(['profile'])->where('id',auth()->user()->id)->first();
|
||||
if(!@$user->profile && ($user->ms_group_id == 2)){
|
||||
return redirect('profile-sekolah/lengkapi/'.encode_id($user->username));
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue