示例#1
0
 public function show($id)
 {
     $dept = $this->dept->findOrFail($id);
     return Response::json(['success' => true, 'error' => false, 'results' => $dept->toArray()]);
 }
示例#2
0
文件: Eloquent.php 项目: emayk/ics
 /**
  * @return Model|static
  * @throws \Exception
  */
 public static function generateUserAdmin()
 {
     $username = static::$defaultUserAdmin['username'];
     $useradmin = self::Username($username);
     if ($useradmin->count()) {
         $msg = '[Error] User Admin Sudah Dibuat sebelumnya';
     } else {
         $posId = Positions::getIdDefaultPositionOrCreate();
         $deptId = Dept::getIdDefaultDepartementOrCreate();
         $warehouseId = Warehouse::getDefaultWarehouseIdOrCreate();
         $statusId = Status::getIdDefaultStatusOrCreate();
         $user = self::create(array_merge(array('username' => static::$defaultUserAdmin['username'], 'fullname' => lcfirst(static::$defaultUserAdmin['username']), 'email' => static::getFake()->getFake()->companyEmail, 'pos_id' => $posId, 'dept_id' => $deptId, 'warehouse_id' => $warehouseId, 'status_id' => $statusId, 'password' => static::$defaultUserAdmin['password']), static::getFake()->othersAttributesArray()));
         $msg = "Generate User Admin {$user->username} Successfully";
     }
     return $msg;
 }
示例#3
0
 /**
  * Generate Data Massive Contact Person
  *
  * @param bool $resultIds
  *
  * @param int  $count
  *
  * @return array|string
  */
 public static function generateMassive($resultIds = false, $count = 100)
 {
     $posIds = Positions::getIdsPositionOrCreateMassiveDummy();
     $deptIds = Dept::getIdsOrCreateMassiveDummy();
     $supplierIds = Suppliers::getRecordIdsOrCreate(200);
     $buyerIds = Buyers::getRecordIdsOrCreate(200);
     $records = static::getFake()->getContacts()->generateContacts($count, $posIds, $deptIds, $supplierIds, $buyerIds);
     $contacts = array();
     foreach ($records as $record) {
         $newrecord = static::create($record);
         $contacts[] = $newrecord->id;
     }
     return $resultIds ? $contacts : 'Generate Contact Person with ' . count($contacts) . ' records';
 }
示例#4
0
文件: test.php 项目: emayk/ics
     return 'generate Phones';
 });
 Route::get('contacts', function () use($fake) {
     return \Emayk\Ics\Repo\Contactperson\Contactperson::generateMassive(false, 100);
 });
 /**
  * Membuat Currency
  */
 Route::get('currency', function () use($fake) {
     return \Emayk\Ics\Repo\Currencies\Currencies::generateMassive(true);
 });
 /**
  * Generate Departement
  */
 Route::get('dept', function () use($fake) {
     return \Emayk\Ics\Repo\Dept\Dept::generateMassive(true);
 });
 Route::get('supplier_bank_account', function () use($fake) {
     $ba = new \Emayk\Ics\Repo\Bankaccount\Bankaccount();
     $json = $ba->getSupplier(1)->get()->toJson();
     //            $json = $ba->getBuyer(1)->get()->toJson();
     return $json;
     //            $supplier = \Emayk\Ics\Repo\Suppliers\Suppliers::find(1);
     //            $accountbank =$supplier->accountbank;
     //
     //                accountbank
     //            get accountbank supplier
     //            \Emayk\Ics\Repo\Bankaccount\Bankaccount::scopeSuppliers
     //generate
     //            return \Emayk\Ics\Repo\Suppliers\Suppliers::generateMassiveDummy(false,50);
 });