30 lines
		
	
	
		
			563 B
		
	
	
	
		
			PHP
		
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			563 B
		
	
	
	
		
			PHP
		
	
	
| <?php
 | |
| 
 | |
| namespace App\Models\Pelaporan;
 | |
| 
 | |
| use Illuminate\Database\Eloquent\Model;
 | |
| 
 | |
| class IPALmodel extends Model
 | |
| {
 | |
|     protected $table = 'Ipal';
 | |
|     public $timestamps = false;
 | |
| 
 | |
|     protected $fillable = ['PelaporanId'];
 | |
| 
 | |
|      /**
 | |
|      * Get data dari Ipal
 | |
|      */
 | |
|     public static function getData($idmcpelaporan)
 | |
|     {
 | |
|         return self::where('PelaporanId', $idmcpelaporan)->get();
 | |
|     }
 | |
| 
 | |
|     /**
 | |
|      * Get satu record berdasarkan filter
 | |
|      */
 | |
|     public static function getOneBy(array $filter)
 | |
|     {
 | |
|         return self::where($filter)->first();
 | |
|     }
 | |
| }
 |