本文整理汇总了PHP中app\Language::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Language::create方法的具体用法?PHP Language::create怎么用?PHP Language::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Language
的用法示例。
在下文中一共展示了Language::create方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created resource in storage.
*
* @param StoreLanguageRequest $request
* @return Response
*/
public function store(StoreLanguageRequest $request)
{
// create the language
Language::create($request->all());
// flash message
session()->flash('flash_message', 'Language added successfully.');
return redirect()->route('languages.create');
}
示例2: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
\App\Language::create(['name' => 'english', 'code' => 'en', 'icon' => 'en.png']);
\App\Language::create(['name' => 'bahasa', 'code' => 'id', 'icon' => 'id.png']);
\App\Language::create(['name' => 'french', 'code' => 'fr', 'icon' => 'fr.png']);
\App\Language::create(['name' => 'rusian', 'code' => 'ru', 'icon' => 'ru.png']);
}
示例3: insert
public function insert($data)
{
// Validating data
$validator = Validator::make($data, Language::createrules());
// If there are no errors in data
if (!$validator->fails()) {
// Create Language
$language = Language::create($data);
// Passing data to response service
return $this->responseService->returnMessage($language, 'Language was not Inserted.');
} else {
// Data has errors
// Passing errors to response service
return $this->responseService->errorMessage($validator->errors()->all());
}
}
示例4: store
/**
* Store a newly created language in storage
*
* @param LanguageRequest $request
* @return Response
*/
public function store(LanguageRequest $request)
{
$language = Language::create(ImageService::uploadImage($request, 'flag'));
$language->id ? Flash::success(trans('admin.create.success')) : Flash::error(trans('admin.create.fail'));
return redirect(route('admin.language.index'));
}
示例5: run
public function run()
{
Language::truncate();
Language::create(['name' => 'English', 'iso_code' => 'en', 'language_code' => 'en-en', 'date_format_lite' => 'm/j/Y', 'date_format_full' => 'm/j/Y H:i:s', 'date_format_lite_view' => 'm/j/Y', 'date_format_full_view' => 'm/j/Y H:i:s', 'active' => '1', 'created_at' => \Carbon\Carbon::createFromDate(2015, 04, 01)->toDateTimeString(), 'updated_at' => \Carbon\Carbon::now()->toDateTimeString()]);
Language::create(['name' => 'Español', 'iso_code' => 'es', 'language_code' => 'es-es', 'date_format_lite' => 'd/m/Y', 'date_format_full' => 'd/m/Y H:i:s', 'date_format_lite_view' => 'd/m/Y', 'date_format_full_view' => 'd/m/Y H:i:s', 'active' => '1', 'created_at' => \Carbon\Carbon::createFromDate(2015, 04, 01)->toDateTimeString(), 'updated_at' => \Carbon\Carbon::now()->toDateTimeString()]);
}
示例6: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Language::create(['code' => 'vi', 'name' => 'Tiếng Việt', 'priority' => 0, 'is_default' => 1, 'is_key_language' => 1]);
}
示例7: run
public function run()
{
DB::table('languages')->delete();
Language::create(['title' => 'Türkçe', 'code' => 'tr', 'site_title' => 'Blog', 'site_description' => 'Muhteşem Blogum']);
Language::create(['title' => 'English', 'code' => 'en', 'site_title' => 'Blog', 'site_description' => 'My Awesome Blog']);
}
示例8: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// General
\App\Language::create(['code' => 'es', 'name' => 'Español', 'image' => 'es.png']);
\App\Site::create(['name' => 'Plataforma ', 'domain' => 'http://mimg.dev/', 'root' => '/', 'es' => ['title' => 'PROGRAMA MUNICIPAL DE RECONOCIMIENTO Y FOMENTO A INICIATIVAS SOSTENIBLES', 'description' => 'Nuestro objetivo es programar la plataforma del Programa Municipal de Reconocimiento y Fomento a Iniciativas Sostenibles en formato es php y sql para entorno web, en base a un contenido y diseño previamente definido.', 'keywords' => 'programa, municipal, iniciativas sostenibles, medio ambiente, guayaquil, ecuador'], 'google_verification' => '', 'analytics' => '']);
// Nodos
$node_registry_a = \App\Node::create(['name' => 'registry-a', 'table_name' => 'registry_a', 'type' => 'form']);
\App\NodeExtra::create(['parent_id' => $node_registry_a->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'field', 'value_array' => json_encode(['status', 'company_type', 'guayaquil_zone'])]);
\App\NodeExtra::create(['parent_id' => $node_registry_a->id, 'display' => 'admin', 'type' => 'graph', 'parameter' => 'pie', 'value_array' => json_encode(['status', 'company_type', 'guayaquil_zone'])]);
$node_registry_b = \App\Node::create(['name' => 'registry-b', 'table_name' => 'registry_b', 'type' => 'form']);
\App\NodeExtra::create(['parent_id' => $node_registry_b->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'field', 'value_array' => json_encode(['status', 'clasification', 'guayaquil_belongs'])]);
\App\NodeExtra::create(['parent_id' => $node_registry_b->id, 'display' => 'admin', 'type' => 'graph', 'parameter' => 'pie', 'value_array' => json_encode(['status', 'clasification', 'guayaquil_belongs'])]);
$node_postulation_a = \App\Node::create(['name' => 'postulation-a', 'table_name' => 'postulation_a', 'type' => 'form']);
\App\NodeExtra::create(['parent_id' => $node_postulation_a->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'field', 'value_array' => json_encode(['status'])]);
\App\NodeExtra::create(['parent_id' => $node_postulation_a->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'parent_field', 'value_array' => json_encode([['name' => 'guayaquil_zone', 'parent' => 'registry-a', 'data' => 'registry_a_id'], ['name' => 'company_type', 'parent' => 'registry-a', 'data' => 'registry_a_id']])]);
\App\NodeExtra::create(['parent_id' => $node_postulation_a->id, 'display' => 'admin', 'type' => 'graph', 'parameter' => 'pie', 'value_array' => json_encode(['status'])]);
\App\NodeExtra::create(['parent_id' => $node_postulation_a->id, 'display' => 'admin', 'type' => 'parent_graph', 'parameter' => 'pie', 'value_array' => json_encode([['name' => 'guayaquil_zone', 'parent' => 'registry_a', 'data' => 'registry_a_id'], ['name' => 'company_type', 'parent' => 'registry_a', 'data' => 'registry_a_id']])]);
$node_postulation_b = \App\Node::create(['name' => 'postulation-b', 'table_name' => 'postulation_b', 'type' => 'form']);
\App\NodeExtra::create(['parent_id' => $node_postulation_b->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'field', 'value_array' => json_encode(['status'])]);
\App\NodeExtra::create(['parent_id' => $node_postulation_b->id, 'display' => 'admin', 'type' => 'filter', 'parameter' => 'parent_field', 'value_array' => json_encode([['name' => 'guayaquil_belongs', 'parent' => 'registry-b', 'data' => 'registry_b_id'], ['name' => 'clasification', 'parent' => 'registry-b', 'data' => 'registry_b_id']])]);
\App\NodeExtra::create(['parent_id' => $node_postulation_b->id, 'display' => 'admin', 'type' => 'graph', 'parameter' => 'pie', 'value_array' => json_encode(['status'])]);
\App\NodeExtra::create(['parent_id' => $node_postulation_b->id, 'display' => 'admin', 'type' => 'parent_graph', 'parameter' => 'pie', 'value_array' => json_encode([['name' => 'guayaquil_belongs', 'parent' => 'registry_b', 'data' => 'registry_b_id'], ['name' => 'clasification', 'parent' => 'registry_b', 'data' => 'registry_b_id']])]);
$node_deadlines = \App\Node::create(['name' => 'deadline']);
$node_social_network = \App\Node::create(['name' => 'social-network', 'table_name' => 'social_networks', 'location' => 'app', 'type' => 'global', 'model' => '\\App\\SocialNetwork']);
$node_title = \App\Node::create(['name' => 'title']);
$node_content = \App\Node::create(['name' => 'content']);
$node_banner = \App\Node::create(['name' => 'banner']);
$node_agenda = \App\Node::create(['name' => 'agenda']);
$node_sponsor = \App\Node::create(['name' => 'sponsor']);
$node_contact = \App\Node::create(['name' => 'contact', 'table_name' => 'contact']);
$node_form_contact = \App\Node::create(['name' => 'form-contact', 'type' => 'form', 'table_name' => 'form_contact']);
// Menu: Home
$page_home = \App\Page::create(['type' => 'customized', 'customized_name' => 'home', 'es' => ['name' => 'Inicio']]);
\App\Menu::create(['page_id' => $page_home->id]);
\App\Section::create(['id' => 1, 'page_id' => $page_home->id, 'node_id' => $node_title->id]);
\App\Section::create(['id' => 2, 'page_id' => $page_home->id, 'node_id' => $node_content->id]);
\App\Section::create(['id' => 3, 'page_id' => $page_home->id, 'node_id' => $node_title->id]);
\App\Section::create(['id' => 4, 'page_id' => $page_home->id, 'node_id' => $node_agenda->id]);
\App\Section::create(['id' => 5, 'page_id' => $page_home->id, 'node_id' => $node_title->id]);
\App\Section::create(['id' => 6, 'page_id' => $page_home->id, 'node_id' => $node_sponsor->id]);
// Menu: Sobre el Programa
$page_programa = \App\Page::create(['es' => ['name' => 'Sobre el Programa']]);
\App\Menu::create(['page_id' => $page_programa->id]);
\App\Section::create(['id' => 7, 'page_id' => $page_programa->id, 'node_id' => $node_content->id]);
// Menu: Categorias
$page_categorias = \App\Page::create(['es' => ['name' => 'Categorias']]);
\App\Menu::create(['page_id' => $page_categorias->id]);
\App\Section::create(['id' => 8, 'page_id' => $page_categorias->id, 'node_id' => $node_content->id]);
// Menu: Premios
$page_premios = \App\Page::create(['es' => ['name' => 'Premios']]);
\App\Menu::create(['page_id' => $page_premios->id]);
\App\Section::create(['id' => 9, 'page_id' => $page_premios->id, 'node_id' => $node_content->id]);
// Menu: Cronograma
$page_cronograma = \App\Page::create(['es' => ['name' => 'Cronograma']]);
\App\Menu::create(['page_id' => $page_cronograma->id]);
\App\Section::create(['id' => 10, 'page_id' => $page_cronograma->id, 'node_id' => $node_content->id]);
// Menu: Registro
$menu_registro = \App\Menu::create(['type' => 'blank', 'es' => ['name' => 'Registro']]);
$page_registro_a = \App\Page::create(['es' => ['name' => 'Registro A']]);
\App\Menu::create(['level' => 2, 'parent_id' => $menu_registro->id, 'es' => ['name' => 'A. Distinción a empresas ambientalmente sostenibles', 'link' => 'registro-a']]);
\App\Section::create(['id' => 11, 'page_id' => $page_registro_a->id, 'node_id' => $node_content->id]);
\App\Section::create(['id' => 12, 'page_id' => $page_registro_a->id, 'node_id' => $node_registry_a->id]);
$page_registro_b = \App\Page::create(['es' => ['name' => 'Registro B']]);
\App\Menu::create(['level' => 2, 'parent_id' => $menu_registro->id, 'es' => ['name' => 'B. Capital semilla a iniciativas sostenibles', 'link' => 'registro-b']]);
\App\Section::create(['id' => 13, 'page_id' => $page_registro_b->id, 'node_id' => $node_content->id]);
\App\Section::create(['id' => 14, 'page_id' => $page_registro_b->id, 'node_id' => $node_registry_b->id]);
// Page: Postulación A
$page_postulacion_a = \App\Page::create(['es' => ['name' => 'Postulacion A']]);
\App\Section::create(['id' => 15, 'page_id' => $page_postulacion_a->id, 'node_id' => $node_content->id]);
\App\Section::create(['id' => 16, 'page_id' => $page_postulacion_a->id, 'node_id' => $node_postulation_a->id]);
// Page: Postulación B
$page_postulacion_b = \App\Page::create(['es' => ['name' => 'Postulacion B']]);
\App\Section::create(['id' => 17, 'page_id' => $page_postulacion_b->id, 'node_id' => $node_content->id]);
\App\Section::create(['id' => 18, 'page_id' => $page_postulacion_b->id, 'node_id' => $node_postulation_b->id]);
// Menu: Contacto
$page_contacto = \App\Page::create(['es' => ['name' => 'Contacto']]);
\App\Menu::create(['page_id' => $page_contacto->id]);
\App\Section::create(['id' => 19, 'page_id' => $page_contacto->id, 'node_id' => $node_contact->id]);
\App\Section::create(['id' => 20, 'page_id' => $page_contacto->id, 'node_id' => $node_form_contact->id]);
// Panel: Postulaciones
$page_postulaciones = \App\Page::create(['type' => 'customized', 'customized_name' => 'postulaciones', 'es' => ['name' => 'Postulaciones']]);
\App\Section::create(['id' => 21, 'page_id' => $page_postulaciones->id, 'node_id' => $node_content->id]);
// Home Segunda Parte
\App\Section::create(['id' => 22, 'page_id' => $page_home->id, 'node_id' => $node_banner->id]);
// Crear menu en Admin
/*$m_list = \App\Menu::create(['menu_type'=>'admin', 'icon'=>'th-list', 'es'=>['name'=>'Listas de Correos', 'link'=>'admin/model-list/target-list']]);
$m_email = \App\Menu::create(['menu_type'=>'admin', 'icon'=>'th-list', 'es'=>['name'=>'Enviar Emails', 'link'=>'admin/model-list/email']]);
$m_history = \App\Menu::create(['menu_type'=>'admin', 'icon'=>'th-list', 'es'=>['name'=>'Emails Enviados', 'link'=>'admin/model-list/sent-email']]);*/
// Variables
\App\Variable::create(['name' => 'admin_email', 'type' => 'string', 'es' => ['value' => 'edumejia30@gmail.com']]);
\Solunes\Master\App\Variable::create(['name' => 'footer_name', 'type' => 'string', 'es' => ['value' => 'GAD MUNICIPAL DE GUAYAQUIL - GUAYAQUIL, ECUADOR']]);
\Solunes\Master\App\Variable::create(['name' => 'footer_rights', 'type' => 'string', 'es' => ['value' => 'TODOS LOS DERECHOS RESERVADOS']]);
// Social Networks
\App\SocialNetwork::create(['code' => 'facebook', 'url' => 'https://www.facebook.com/alcaldiaguayaquil/']);
\App\SocialNetwork::create(['code' => 'twitter', 'url' => 'https://twitter.com/alcaldiagye/']);
//.........这里部分代码省略.........
示例9: run
public function run()
{
DB::table('languages')->delete();
Language::create(['title' => 'Spanish', 'code' => 'sp', 'site_title' => 'CMPD Winter Gift Project', 'site_description' => '']);
Language::create(['title' => 'English', 'code' => 'en', 'site_title' => 'CMPD Winter Gift Project', 'site_description' => '']);
}
示例10: store
/**
* Store a newly created language in storage
*
* @param LanguageRequest $request
* @return Response
*/
public function store(LanguageRequest $request)
{
$data = $this->storeImage($request, 'flag');
Language::create($data) == true ? Flash::success(trans('admin.create.success')) : Flash::error(trans('admin.create.fail'));
return redirect(route('admin.language.index'));
}
示例11: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Language::create(['id' => 'kh', 'full_word' => 'Khmer', 'logo' => 'khmer.png', 'status' => 1, 'created_by' => 1, 'updated_by' => 1]);
Language::create(['id' => 'en', 'full_word' => 'English', 'logo' => 'english.png', 'status' => 1, 'created_by' => 1, 'updated_by' => 1, 'is_default' => 1]);
Language::create(['id' => 'ch', 'full_word' => 'Chinese', 'logo' => 'chinese.png', 'status' => 1, 'created_by' => 1, 'updated_by' => 1]);
}
示例12: run
/**
* Run the database seeds.
*/
public function run()
{
Language::create(['id' => 1, 'name' => 'Spanish', 'prefix' => 'ES']);
}
示例13: store
/**
* Store a newly created resource in storage.
*
* @param Request $request
* @return Response
*/
public function store(Request $request)
{
$input = Input::All();
Language::create($input);
return Redirect::route('admin.setup.qualification.languages.index')->withFlashSuccess('Language data was successfully created.');
}
示例14: run
public function run()
{
DB::table('languages')->delete();
Language::create(['name' => 'English']);
Language::create(['name' => 'Vietnamese']);
Language::create(['name' => 'French']);
}