adminarchitect / contacts
该包的最新版本(v1.0.1)没有提供许可证信息。
Admin Architect - Contacts
v1.0.1
2016-02-24 08:10 UTC
This package is not auto-updated.
Last update: 2024-09-14 18:36:49 UTC
README
注意:
此包的后端部分只能与 Admin Architect
(terranet/administrator
) 包一起使用。
安装
composer require adminarchitect/contacts
将服务提供者添加到 config/app.php
'providers' => [
...
Terranet\Contacts\ServiceProvider::class
...
]
php artisan vendor:publish --provider="Terranet\\Contacts\\ServiceProvider"
用法
$contacts = new Contacts('Google Inc.');
$contacts
->setDescription('<p>We’ve come a long way from the dorm room and the garage. </p>' .
'<p>We moved into our headquarters in Mountain View, California—better known as the Googleplex—in 2004. </p>' .
'<p>Today Google has more than 70 offices in more than 40 countries around the globe.</p>')
->setEmails(['info@google.com'])
->setPhones(['+1 734-332-6500', '+1 248-593-4000']);
$contacts->setAddress('1600 Amphitheatre Parkway Mountain View, CA 94043');
$contacts->department('Google Ann Arbor', function ($department) {
$department->setDescription('Software development')
->setAddress('201 S. Division St. Suite 500 Ann Arbor, MI 48104')
->setPhones(['+1 734-332-6500'])
->setEmails(['support@google.com']);
});
$contacts->department('Google Detroit', function ($department) {
$department->setDescription('Software development')
->setAddress('114 Willits Street Birmingham, MI 48009')
->setPhones(['+1 248-593-4000'])
->setEmails(['support@google.com']);
});
return $contacts->render();
模板
从预定义的模板中选择一个或创建一个新的:在 config/contacts.php
部分的 template
部分