2017 © Pedro Peláez
 

project slimo

A skelton for your slim app

image

the94air/slimo

A skelton for your slim app

  • Monday, February 19, 2018
  • by the94air
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

slimo

A skelton for your slim app, (*1)

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., (*2)

How to send mail

For that you will be able to add your configurations to the .env file., (*3)

# 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., (*4)

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)., (*5)

This software does not have a license. All used packages has it's own license. And BTW... Laravel is a trademark of Taylor Otwell., (*6)

The Versions