fadlyshafa

Untitled

Feb 17th, 2020
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 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.         return view('dashboard.beranda.index',compact('title','pesan','cek','status'));
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment