-
-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #184 from avored/dev
merging dev to master
- Loading branch information
Showing
79 changed files
with
865 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 AvoRed E commerce | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# AvoRed E commerce Dummy Data | ||
|
||
AvoRed E commerce Dummy Data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name" : "avored/contact", | ||
"type" : "avored-module", | ||
"description" : "AvoRed Laravel 5 E commerce Contact Module", | ||
"keywords" : [ | ||
"framework", | ||
"contact", | ||
"cart", | ||
"laravel", | ||
"e commerce", | ||
"laravel5", | ||
"shop", | ||
"shopping-cart", | ||
"e-commerce", | ||
"shopping cart", | ||
"e commerce" | ||
], | ||
"license" : "MIT", | ||
"authors" : [{ | ||
"name" : "Purvesh ", | ||
"email" : "[email protected]" | ||
} | ||
], | ||
"require" : { | ||
"php" : ">=7.1.3", | ||
"avored/module-installer" : "1.*", | ||
"avored/framework" : "~2.0" | ||
}, | ||
"autoload" : { | ||
"psr-4" : { | ||
"AvoRed\\Contact\\" : "src" | ||
} | ||
}, | ||
"homepage" : "https://www.avored.com/", | ||
"support" : { | ||
"email" : "[email protected]", | ||
"issues" : "https://www.avored.com/dicussion", | ||
"forum" : "https://www.avored.com/discussion", | ||
"wiki" : "https://www.avored.com/docs", | ||
"source" : "https://www.github.com/avored/contact" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: AvoRed Contact Us | ||
identifier: avored-contact | ||
description: AvoRed Contact Module | ||
namespace: AvoRed\Contact\ | ||
status: Enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
<?php | ||
|
||
|
||
return [ | ||
|
||
|
||
|
||
|
||
]; |
39 changes: 39 additions & 0 deletions
39
modules/avored/contact/resources/views/contact/index.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@extends('layouts.app') | ||
|
||
@section('meta_title') | ||
Contact US | ||
@endsection | ||
|
||
@section('content') | ||
<div class="row"> | ||
|
||
<div class="col-md-12"> | ||
|
||
<h1>Contact US</h1> | ||
<div class=""> | ||
<form action="{{ route('contact.send') }}" method="post"> | ||
@csrf | ||
|
||
@include('partials.forms.text',['name' => 'name','label' => 'Name']) | ||
@include('partials.forms.text',['name' => 'email','label' => 'Email']) | ||
@include('partials.forms.text',['name' => 'phone','label' => 'Phone']) | ||
|
||
<div class="form-group"> | ||
<label for="message">Message</label> | ||
<textarea class="form-control{{ $errors->has('message') ? " is-invalid" : "" }}" name="message" id="messge"></textarea> | ||
|
||
@if($errors->has('message')) | ||
<div class="invalid-feedback"> | ||
{{ $errors->first('message') }} | ||
</div> | ||
@endif | ||
</div> | ||
|
||
<button type="submit" class="btn btn-primary" >Send</button> | ||
</form> | ||
|
||
</div> | ||
</div> | ||
|
||
</div> | ||
@endsection |
13 changes: 13 additions & 0 deletions
13
modules/avored/contact/resources/views/mails/contact-acknoledgement.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@component('mail::message') | ||
|
||
|
||
@component('mail::panel') | ||
# Contact Message Received | ||
|
||
You received this email as an acknoledgement because you send an inquiry thorough AvoRed Contact us form. | ||
We are happy to tell you that we have received your email and we will be in touch soon. | ||
@endcomponent | ||
|
||
Thanks, | ||
AvoRed | ||
@endcomponent |
11 changes: 11 additions & 0 deletions
11
modules/avored/contact/resources/views/mails/contact-request.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@component('mail::message') | ||
|
||
# Contact Message Received | ||
|
||
Name: {{ $name }} | ||
Email: {{ $email }} | ||
Phone: {{ $phone }} | ||
Message: {{ $message }} | ||
|
||
Thanks | ||
@endcomponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| AvoRed E commerce Routes | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Here is where you can register all of the routes for an avored user modules. | ||
| It's a breeze. Simply tell avored user module the URI it should respond to | ||
| and give it the controller to call when that URI is requested. | ||
| | ||
*/ | ||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::middleware(['web']) | ||
->namespace('AvoRed\Contact\Http\Controllers') | ||
->group(function () { | ||
Route::get('contact', 'ContactController@index')->name('contact.index'); | ||
|
||
Route::post('contact', 'ContactController@send')->name('contact.send'); | ||
|
||
}); |
31 changes: 31 additions & 0 deletions
31
modules/avored/contact/src/Http/Controllers/ContactController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace AvoRed\Contact\Http\Controllers; | ||
|
||
use AvoRed\Contact\Http\Requests\ContactRequest; | ||
use AvoRed\Framework\Models\Database\Configuration; | ||
use App\Http\Controllers\Controller; | ||
use AvoRed\Contact\Mails\ContactMail; | ||
use AvoRed\Contact\Mails\ContactMailRequest; | ||
use Illuminate\Support\Facades\Mail; | ||
|
||
class ContactController extends Controller | ||
{ | ||
public function index() { | ||
return view('avored-contact::contact.index'); | ||
} | ||
|
||
public function send(ContactRequest $request) { | ||
|
||
$adminEmail = Configuration::getConfiguration('general_administrator_email'); | ||
|
||
// Sent an EMail to AvoRed Administrator | ||
Mail::to($adminEmail)->send(new ContactMailRequest($request)); | ||
|
||
// Sent an EMail to AvoRed Administrator | ||
Mail::to($request->get('email'))->send(new ContactMail()); | ||
|
||
|
||
return redirect()->route('contact.index')->with('successNotification', 'Your Request has been sent!'); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
modules/avored/contact/src/Http/Requests/ContactRequest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace AvoRed\Contact\Http\Requests; | ||
|
||
use Illuminate\Foundation\Http\FormRequest as Request; | ||
|
||
class ContactRequest extends Request | ||
{ | ||
/** | ||
* Determine if the user is authorized to make this request. | ||
* | ||
* @return bool | ||
*/ | ||
public function authorize() | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array | ||
*/ | ||
public function rules() | ||
{ | ||
$validation['name'] = 'required|max:255'; | ||
$validation['email'] = 'required|email|max:255'; | ||
$validation['phone'] = 'required|min:6'; | ||
$validation['message'] = 'required|min:6'; | ||
|
||
return $validation; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace AvoRed\Contact\Mails; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ContactMail extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
|
||
|
||
/** | ||
* Build the message. | ||
* | ||
* @return $this | ||
*/ | ||
public function build() | ||
{ | ||
return $this->markdown('avored-contact::mails.contact-acknoledgement'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace AvoRed\Contact\Mails; | ||
|
||
use AvoRed\Contact\Http\Requests\ContactRequest; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class ContactMailRequest extends Mailable | ||
{ | ||
use Queueable, SerializesModels; | ||
|
||
/** | ||
* @var $name | ||
*/ | ||
public $name; | ||
|
||
/** | ||
* @var $phone | ||
*/ | ||
public $phone; | ||
|
||
/** | ||
* @var $email | ||
*/ | ||
public $email; | ||
|
||
/** | ||
* @var $message | ||
*/ | ||
public $message; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(ContactRequest $request) | ||
{ | ||
$this->name = $request->get('name'); | ||
$this->phone = $request->get('phone'); | ||
$this->email = $request->get('email'); | ||
$this->message = $request->get('message'); | ||
|
||
} | ||
|
||
/** | ||
* Build the message. | ||
* | ||
* @return $this | ||
*/ | ||
public function build() | ||
{ | ||
return $this->replyTo($this->email, $this->name) | ||
->markdown("avored-contact::mails.contact-request"); | ||
|
||
} | ||
} |
Oops, something went wrong.