本文整理汇总了PHP中CustomField::all方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomField::all方法的具体用法?PHP CustomField::all怎么用?PHP CustomField::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomField
的用法示例。
在下文中一共展示了CustomField::all方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(CustomFields $customFieldsMangaer)
{
$this->customFieldsMangaer = $customFieldsMangaer;
if (Request::ajax()) {
$this->layout = 'backend.ajax_layout';
}
View::composer('backend.camposextra.layout', function ($view) {
$data['camposextra'] = CustomField::all();
$view->nest('sidebar', 'backend.camposextra.list', $data);
});
}
示例2: getMetadatos
public function getMetadatos($id_encabezado)
{
$encabezado = EstructuraEncabezado::find($id_encabezado);
$customFields = CustomField::all();
$data['encabezado'] = $encabezado;
$data['custom_fields'] = $customFields;
$this->layout->content = View::make('backend.estructuras.metadatos', $data);
}
示例3: scopeTextSearch
/**
* Query builder scope to search on text for complex Bootstrap Tables API
*
* @param Illuminate\Database\Query\Builder $query Query builder instance
* @param text $search Search term
*
* @return Illuminate\Database\Query\Builder Modified query builder
*/
public function scopeTextSearch($query, $search)
{
$search = explode(' ', $search);
return $query->where(function ($query) use($search) {
foreach ($search as $search) {
$query->whereHas('model', function ($query) use($search) {
$query->whereHas('category', function ($query) use($search) {
$query->where(function ($query) use($search) {
$query->where('categories.name', 'LIKE', '%' . $search . '%')->orWhere('models.name', 'LIKE', '%' . $search . '%');
});
});
})->orWhere(function ($query) use($search) {
$query->whereHas('assetstatus', function ($query) use($search) {
$query->where('status_labels.name', 'LIKE', '%' . $search . '%');
});
})->orWhere(function ($query) use($search) {
$query->whereHas('company', function ($query) use($search) {
$query->where('companies.name', 'LIKE', '%' . $search . '%');
});
})->orWhere(function ($query) use($search) {
$query->whereHas('defaultLoc', function ($query) use($search) {
$query->where('locations.name', 'LIKE', '%' . $search . '%');
});
})->orWhere(function ($query) use($search) {
$query->whereHas('assigneduser', function ($query) use($search) {
$query->where(function ($query) use($search) {
$query->where('users.first_name', 'LIKE', '%' . $search . '%')->orWhere('users.last_name', 'LIKE', '%' . $search . '%')->orWhere(function ($query) use($search) {
$query->whereHas('userloc', function ($query) use($search) {
$query->where('locations.name', 'LIKE', '%' . $search . '%');
});
});
});
});
})->orWhere('assets.name', 'LIKE', '%' . $search . '%')->orWhere('asset_tag', 'LIKE', '%' . $search . '%')->orWhere('serial', 'LIKE', '%' . $search . '%')->orWhere('order_number', 'LIKE', '%' . $search . '%')->orWhere('notes', 'LIKE', '%' . $search . '');
}
foreach (CustomField::all() as $field) {
$query->orWhere($field->db_column_name(), 'LIKE', "%{$search}%");
}
});
}
示例4: getAddcampoextra
public function getAddcampoextra()
{
$data['camposextra'] = CustomField::all();
return View::make('backend/customfields/selecttype', $data);
}