Browse Source

cancel create notice collenction

master
Siti Rahayu 5 years ago
parent
commit
dafed6e25e

+ 1
- 1
app/Http/Controllers/Api/CompoundResourceController.php View File

@@ -937,7 +937,7 @@ class CompoundResourceController extends BaseController
// }
$this->dispatch(new StoreNotice($request->all(), $non, $staff->_id, $no_siri));

//mobile already accept 'kpd' string, so no need to change string name to 'notis'.
//mobile already accept 'kpd' string, so no need to change string name to 'notis'.
array_push($data, array(
'kpd' => $kpd,
'non' => $non

+ 1
- 1
app/Jobs/StoreNotice.php View File

@@ -58,7 +58,7 @@ class StoreNotice implements ShouldQueue
*/
public function handle(ConfidentialFile $file)
{
// $success_save_data = false;
// $success_save_data = false;
// $faulty = Faulty::where('_id', $this->request['seksyen'])->first();
// if($success_save_data == false){
// $count = $file->count();

+ 43
- 39
app/Model/Module/ConfidentialFile.php View File

@@ -1,39 +1,43 @@
<?php
namespace App\Model\Module;
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
class ConfidentialFile extends Eloquent
{
//
protected $connection = 'mongodb';
protected $collection = 'confidential_file';
protected $guarded = ['_id'];
public function staff(){
return $this->belongsTo('App\Model\Staff', 'no_badan', 'penguatkuasa');
}
public function compound(){
return $this->hasOne('App\Model\Module\Compound');
}
public function memo()
{
return $this->belongsToMany('App\Model\Module\Memo');
}
public function history(){
return $this->belongsToMany('App\Model\Module\History');
}
public function investigation(){
return $this->hasMany('App\Model\Module\Investigation');
}
public function iteminventory(){
return $this->hasMany('App\Model\Module\ItemInventory');
}
}
<?php

namespace App\Model\Module;

use Jenssegers\Mongodb\Eloquent\Model as Eloquent;

class ConfidentialFile extends Eloquent
{
//
protected $connection = 'mongodb';
protected $collection = 'confidential_file';

protected $guarded = ['_id'];

public function staff(){
return $this->belongsTo('App\Model\Staff', 'no_badan', 'penguatkuasa');
}

public function compound(){
return $this->hasOne('App\Model\Module\Compound');
}

public function notice(){
return $this->hasOne('App\Model\Module\Notice');
}

public function memo()
{
return $this->belongsToMany('App\Model\Module\Memo');
}

public function history(){
return $this->belongsToMany('App\Model\Module\History');
}

public function investigation(){
return $this->hasMany('App\Model\Module\Investigation');
}

public function iteminventory(){
return $this->hasMany('App\Model\Module\ItemInventory');
}
}

+ 5
- 0
app/Model/Module/Notice.php View File

@@ -33,6 +33,11 @@ class Notice extends Eloquent
return $this->belongsTo('App\Model\StaffDetail','dikeluarkan','_id');
}

public function confidentialfile()
{
return $this->belongsTo('App\Model\Module\ConfidentialFile', 'confidential_file_id', '_id');
}

public function updateby(){
return $this->belongsTo('App\Model\StaffDetail','update_by','_id');
}

Loading…
Cancel
Save