the94air / slimo
A skelton for your slim app
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=7.0.0
- awurth/slim-validation: ^3.0
- illuminate/database: 5.6.*
- slim/csrf: ^0.8.2
- slim/flash: ^0.4.0
- slim/slim: ^3.8
- slim/twig-view: ^2.2
- swiftmailer/swiftmailer: ^6.0
- symfony/var-dumper: ^3.2
- vlucas/phpdotenv: ^2.4
This package is not auto-updated.
Last update: 2020-01-24 17:33:13 UTC
README
A skelton for your slim app
Installation
- install with composer. Your PHP package manager.
composer create-project the94air/slimo [Project Name]
- And for using webpack (laravel-mix) just run
npm install
- Have fun!
Learn how to use
You can browse these links to find out more about each part of this skeleton
- Slim framework
- Laravel ORM (Eloquent) for communicating with the database.
- Dotenv for loading environment variables (.env).
- Twig for PHP template engine.
- Slim-Csrf for CSRF protection.
- SlimValidation & Respect\Validation for forms validation.
- Laravel Mix for assets compiling with wepack.
- swiftmailer for sending emails.
How to send mail
For that you will be able to add your configurations to the .env
file.
# Using SMTP
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=example@gmail.com
MAIL_PASSWORD=secret
MAIL_ENCRYPTION=tls
# Or using Sendmail server
MAIL_DRIVER=sendmail
MAIL_SENDMAIL_PATH='/usr/sbin/sendmail -bs'
And after that you will be able to access the $mailer
from your Routers and Controllers.
class MailController extends Controller { public function index(Request $request, Response $response, $args) { $mailer = $this->mailer; // Create a message $message = (new \Swift_Message('Wonderful Subject')) ->setFrom(['john@doe.com' => 'John Doe']) ->setTo(['receiver@domain.org', 'other@domain.org' => 'A name']) ->setBody('Here is the message itself'); // Send the message $result = $mailer->send($message); // returns `int(2)` on success var_dump($result); } }
Attention
This package is forked from slender package thanks to Alex Garrett with more additional and useful packages. Feel free to add your own feature from the open source universe (Make a pull request).
This software does not have a license. All used packages has it's own license. And BTW... Laravel is a trademark of Taylor Otwell.