the94air/slimo

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (v0.0.2) of this package.

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

v0.0.2 2018-02-18 14:51 UTC

This package is not auto-updated.

Last update: 2020-01-24 17:33:13 UTC


README

A skelton for your slim app

Installation

  1. install with composer. Your PHP package manager.
composer create-project the94air/slimo [Project Name]
  1. And for using webpack (laravel-mix) just run
npm install
  1. Have fun!

Learn how to use

You can browse these links to find out more about each part of this skeleton

  1. Slim framework
  2. Laravel ORM (Eloquent) for communicating with the database.
  3. Dotenv for loading environment variables (.env).
  4. Twig for PHP template engine.
  5. Slim-Csrf for CSRF protection.
  6. SlimValidation & Respect\Validation for forms validation.
  7. Laravel Mix for assets compiling with wepack.
  8. 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.