fadlyshafa

Untitled

Feb 22nd, 2020
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Http\Controllers\Dashboard;
  4.  
  5. use Illuminate\Http\Request;
  6. use App\Http\Controllers\Controller;
  7.  
  8. use App\Models\Biodata;
  9. use App\User;
  10.  
  11. class Beranda_controller extends Controller
  12. {
  13.     public function index(){
  14.         $title = 'Halaman Dashboard';
  15.  
  16.         $user_id = \Auth::user()->id;
  17.  
  18.         $cek = Biodata::where('users',$user_id)->count();
  19.         if($cek < 1){
  20.             $pesan = 'Harap Melengkapi Biodata Terlebih Dahulu';
  21.         }else{
  22.             $pesan = 'Biodata Anda Sudah Dilengkapi.. Terima Kasih';
  23.         }
  24.  
  25.         $cek_verifikasi = User::find($user_id);
  26.  
  27.         if($cek_verifikasi->is_verifikasi == 1){
  28.             $status = 'Status Sudah Di verifikasi';
  29.         }else{
  30.             $status = 'Belum Diverifikasi';
  31.         }
  32.  
  33.         $cek_lulus = User::find($user_id);
  34.         if($cek_lulus->is_lulus == 1){
  35.             $pesan_lulus = 'Selamat Anda Sudah lulus';
  36.         }else{
  37.             $pesan_lulus = 'Mohon Maaf status anda masih dalam peninjauan';
  38.         }
  39.  
  40.         return view('dashboard.beranda.index',compact('title','pesan','cek','status','pesan_lulus'));
  41.     }
  42. }
Add Comment
Please, Sign In to add comment