bozboz/enquiry

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

v1.1.0 2015-10-16 12:00 UTC

This package is auto-updated.

Last update: 2021-06-04 10:22:16 UTC


README

Installation

  1. Add Bozboz\Enquiry\EnquiryServiceProvider to the providers array in app/config/app.php

  2. Add contact_recipient and contact_name to app/config/app.php

  3. Add the following to app/config/app.php

     'enquiry_recipient_address' => $_ENV['ENQUIRY_RECIPIENT_ADDRESS'],
     'enquiry_recipient_name' => $_ENV['ENQUIRY_RECIPIENT_NAME'],
    

Consequently define the environment variables in your .env.dev.php file.

  1. Add 'Enquiry' => 'Bozboz\Enquiry\Facades\Enquiry' to the aliases array in app/config/app.php

  2. Set from and name in app/config/mail.php

  3. Setup a route

     Route::post('contact', array('as' => 'contact-process', function()
     {
         $enquiry = Enquiry::make(Input::get(), array(
             'name' => 'required',
             'email' => 'required|email',
             'message' => 'required|min:20'
         ));
    
         if ($enquiry->fails()) {
             return Redirect::to(URL::previous() . '#form')->withInput()->withErrors($enquiry->getErrors());
         } else {
             return Redirect::to(URL::previous() . '#form')->with('success', true);
         }
     }));
    
  4. Point your contact form to the above route

     {{ Form::open(['route' => 'contact-process', 'role' => 'form', 'id' => 'form']) }}
    
  5. Create the enquiry and enquiry-text files within app/views/emails