本文整理汇总了PHP中app\File::with方法的典型用法代码示例。如果您正苦于以下问题:PHP File::with方法的具体用法?PHP File::with怎么用?PHP File::with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\File
的用法示例。
在下文中一共展示了File::with方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postDataUploaded
/**
*
*/
public function postDataUploaded(Request $req, $db)
{
$page = 1;
if ($req->get('page')) {
$page = $req->get('page');
}
$rows = 10;
if ($req->get('rows')) {
$rows = $req->get('rows');
}
$Files = File::with('user', 'import')->skip($page)->where('db_table', $db)->take($rows)->paginate();
$rows = [];
$i = 0;
foreach ($Files as $file) {
$rows[$i] = $file;
// $rows[$i]['oleh']=$file['user']['email']; $i++;
$rows[$i]['user.email'] = !empty($file->user) ? $file->user->email : 'tidak diketahui ';
$rows[$i]['import.status_import'] = !empty($file->import) ? $file->import->status_import : 'Belum';
// dd($file->import->user->email);
$rows[$i]['import.user.email'] = !empty($file->import->user->email) ? $file->import->user->email : 'Belum';
$i++;
// $rows[$i]['import.users.email']=(!empty($file['import']) && !empty($file['import']['users_id']) )? $file['import']['status_import']: '----'; $i++;
}
$result['total'] = $Files->toArray()['total'];
// $result['rows']=$entries->toArray()['data'];
$result['rows'] = $rows;
return json_encode($result);
}
示例2: postDataImported
/**
*
*/
public function postDataImported(Request $req, $db)
{
$page = 1;
if ($req->get('page')) {
$page = $req->get('page');
}
$rows = 10;
if ($req->get('rows')) {
$rows = $req->get('rows');
}
$entries = File::with('user', 'import', 'eksport')->skip($page)->where('db_table', $db)->take($rows)->paginate();
// dd($rows);
// dd($entries->toArray());
$newEntry = [];
$i = 0;
// foreach ($entries->toArray()['data'] as $entry) {
foreach ($entries as $entry) {
// dd($entry);
$newEntry[$i] = $entry;
// $newEntry[$i]['oleh']=$entry['user']['email']; $i++;
$newEntry[$i]['email'] = !empty($entry->user) ? $entry->user->email : 'tidak diketahui ';
$newEntry[$i]['import.status_import'] = !empty($entry->import) ? $entry->import->status_import : 'Belum';
// dd($entry->import->user->email);
$newEntry[$i]['import.user.email'] = !empty($entry->import->user->email) ? $entry->import->user->email : 'Belum';
$newEntry[$i]['eksport.status_eksport'] = !empty($entry->eksport) ? $entry->eksport->status_eksport : 'Belum';
$newEntry[$i]['eksport.user.email'] = !empty($entry->eksport->user->email) ? $entry->eksport->user->email : 'Belum';
$newEntry[$i]['eksport.link_file'] = !empty($entry->eksport->link_file) ? '<a href="' . $entry->eksport->link_file . '">' . $entry->eksport->nama_file . '</a>' : 'Belum';
$i++;
// $newEntry[$i]['import.users.email']=(!empty($entry['import']) && !empty($entry['import']['users_id']) )? $entry['import']['status_import']: '----'; $i++;
}
$result['total'] = $entries->toArray()['total'];
// $result['rows']=$entries->toArray()['data'];
$result['rows'] = $newEntry;
return json_encode($result);
}
示例3: showDashboard
public function showDashboard(Request $req)
{
$leftmenu['dashboard'] = 'active';
$files = File::with('client', 'technicien', 'laststatus.code.group', 'laststatus.technicien')->get();
$files = CodeStatus::getThemAllLastStatus($files->toArray());
return view('dashboard', ['leftmenu' => $leftmenu, 'files' => $files]);
}
示例4: dumpFile
public static function dumpFile()
{
$result['reparation'] = '';
$result['commande'] = '';
$response = File::with('client', 'technicien')->get();
foreach ($response as $file) {
$result['reparation'][] = ['id' => $file->id, 'intern_report' => $file->intern_report, 'client' => $file->intern_report];
}
return $result;
}
示例5: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
clearstatcache();
$records = 0;
$deleted = 0;
foreach (File::with('item')->get() as $fileOb) {
$file = $fileOb->getFilepath();
if ($this->checkExistance($file) || fileinode($file) !== $fileOb->inode) {
$fileOb->delete();
$deleted++;
}
$records++;
}
foreach (Item::doesntHave('files')->get() as $item) {
$file = $item->path;
if ($this->checkExistance($file)) {
$item->delete();
$deleted++;
}
$records++;
}
$this->line("{$records} processed");
$this->line("{$deleted} deleted");
}
示例6: index
public function index()
{
$files = File::with('client', 'technicien', 'laststatus.code')->get();
$repairs = Repair::with('device')->get();
$orders = Order::all();
$leftmenu['files'] = 'active';
return view('/files/index', ['leftmenu' => $leftmenu, 'files' => $files, 'repairs' => $repairs, 'orders' => $orders]);
}