Skip to content
This repository was archived by the owner on Aug 24, 2022. It is now read-only.
Marcelo de Souza Lima edited this page Mar 26, 2019 · 1 revision

Laravel Boilerplate - Hints

Hooks

Admin

Index

Field

public function hooks_index($table_name)
{
	Hook::add_filter
	(
		sprintf('admin_index_%s_name', $table_name),
		function($display_value, $register)
		{
			return sprintf('<i>%s</i>', $display_value);
		},
		10, 2
	);
}

Image

public function hooks_index($table_name)
{
	Hook::add_filter
	(
		sprintf('admin_index_%s_image', $table_name),
		function($display_value, $register)
		{
			return $this->getUploadedFile($display_value, 100);
		},
		10, 2
	);
}

Show

Field

public function hooks_show($table_name)
{
	Hook::add_filter
	(
		sprintf('admin_show_%s_name', $table_name),
		function($display_value, $register)
		{
			return sprintf('<i>%s</i>', $display_value);
		},
		10, 2
	);
}

Image

public function hooks_show($table_name)
{
	Hook::add_filter
	(
		sprintf('admin_show_%s_image', $table_name),
		function($display_value, $register)
		{
			return $this->getUploadedFile($display_value, 100);
		},
		10, 2
	);
}

Clone this wiki locally