Applied fixes from StyleCI
This commit is contained in:
parent
9167653114
commit
b3f33a38e8
|
|
@ -1,9 +1,9 @@
|
|||
<?php namespace App\Attendize;
|
||||
<?php
|
||||
|
||||
namespace App\Attendize;
|
||||
|
||||
class Utils
|
||||
{
|
||||
|
||||
public static function isRegistered()
|
||||
{
|
||||
return Auth::check() && Auth::user()->is_registered;
|
||||
|
|
@ -30,7 +30,8 @@ class Utils
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isAttendize() {
|
||||
public static function isAttendize()
|
||||
{
|
||||
return self::isAttendizeCloud() || self::isAttendizeDev();
|
||||
}
|
||||
|
||||
|
|
@ -56,11 +57,11 @@ class Utils
|
|||
|
||||
public static function isDownForMaintenance()
|
||||
{
|
||||
return file_exists(storage_path() . '/framework/down');
|
||||
return file_exists(storage_path().'/framework/down');
|
||||
}
|
||||
|
||||
|
||||
public static function file_upload_max_size() {
|
||||
public static function file_upload_max_size()
|
||||
{
|
||||
static $max_size = -1;
|
||||
|
||||
if ($max_size < 0) {
|
||||
|
|
@ -74,18 +75,19 @@ class Utils
|
|||
$max_size = $upload_max;
|
||||
}
|
||||
}
|
||||
|
||||
return $max_size;
|
||||
}
|
||||
|
||||
public static function parse_size($size) {
|
||||
public static function parse_size($size)
|
||||
{
|
||||
$unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.
|
||||
$size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size.
|
||||
if ($unit) {
|
||||
// Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by.
|
||||
return round($size * pow(1024, stripos('bkmgtpezy', $unit[0])));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return round($size);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,60 +1,62 @@
|
|||
<?php namespace App\Attendize\handlers;
|
||||
<?php
|
||||
|
||||
namespace App\Attendize\handlers;
|
||||
|
||||
use App\Attendize\mailers\OrderMailer;
|
||||
use Order;
|
||||
use Attendee;
|
||||
use Order;
|
||||
|
||||
//use PDF;
|
||||
|
||||
class QueueHandler {
|
||||
|
||||
class QueueHandler
|
||||
{
|
||||
protected $orderMailer;
|
||||
|
||||
public function __construct(OrderMailer $orderMailer) {
|
||||
|
||||
public function __construct(OrderMailer $orderMailer)
|
||||
{
|
||||
$this->orderMailer = $orderMailer;
|
||||
}
|
||||
|
||||
|
||||
public function handleOrder($job, $data) {
|
||||
|
||||
public function handleOrder($job, $data)
|
||||
{
|
||||
echo "Starting Job {$job->getJobId()}\n";
|
||||
|
||||
|
||||
$order = Order::findOrfail($data['order_id']);
|
||||
|
||||
|
||||
/*
|
||||
* Steps :
|
||||
* 1 Notify event organiser
|
||||
* 2 Order Confirmation email to buyer
|
||||
* 3 Generate / Send Tickets
|
||||
*/
|
||||
|
||||
|
||||
$data = [
|
||||
'order' => $order,
|
||||
'event' => $order->event,
|
||||
'tickets' => $order->event->tickets,
|
||||
'attendees' => $order->attendees
|
||||
'order' => $order,
|
||||
'event' => $order->event,
|
||||
'tickets' => $order->event->tickets,
|
||||
'attendees' => $order->attendees,
|
||||
];
|
||||
|
||||
$pdf_file = storage_path().'/'.$order->order_reference;
|
||||
exit($pdf_file);
|
||||
|
||||
|
||||
exit($pdf_file);
|
||||
|
||||
PDF::setOutputMode('F'); // force to file
|
||||
PDF::html('Public.ViewEvent.Partials.PDFTicket', $data, $pdf_file);
|
||||
|
||||
|
||||
PDF::html('Public.ViewEvent.Partials.PDFTicket', $data, $pdf_file);
|
||||
|
||||
//1
|
||||
$this->orderMailer->sendOrderNotification($order);
|
||||
//2
|
||||
$this->orderMailer->sendOrderConfirmation($order);
|
||||
//3
|
||||
|
||||
|
||||
$this->orderMailer->sendTickets($order);
|
||||
|
||||
|
||||
$job->delete();
|
||||
}
|
||||
|
||||
public function messageAttendees($job, $data) {
|
||||
|
||||
echo "Starting Job {$job->getJobId()}\n";
|
||||
public function messageAttendees($job, $data)
|
||||
{
|
||||
echo "Starting Job {$job->getJobId()}\n";
|
||||
|
||||
$message_object = Message::find($data['message_id']);
|
||||
$event = $message_object->event;
|
||||
|
|
@ -67,25 +69,22 @@ class QueueHandler {
|
|||
}
|
||||
|
||||
$data = [
|
||||
'event' => $event,
|
||||
'event' => $event,
|
||||
'message_content' => $message_object->message,
|
||||
'subject' => $message_object->subject
|
||||
'subject' => $message_object->subject,
|
||||
];
|
||||
|
||||
Mail::send('Emails.messageAttendees', $data, function($message) use ($toFields, $event, $message_object) {
|
||||
Mail::send('Emails.messageAttendees', $data, function ($message) use ($toFields, $event, $message_object) {
|
||||
$message->to($toFields)
|
||||
->from(config('attendize.outgoing_email_noreply'), $event->organiser->name)
|
||||
->replyTo($event->organiser->email, $event->organiser->name)
|
||||
->subject($message_object->subject);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$message_object->is_sent = 1;
|
||||
$message_object->save();
|
||||
//$message->sent
|
||||
|
||||
$job->delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@
|
|||
|
||||
namespace App\Attendize\mailers;
|
||||
|
||||
use Mail;
|
||||
use App\Models\Attendee;
|
||||
use App\Models\Message;
|
||||
use Carbon\Carbon;
|
||||
use Mail;
|
||||
|
||||
class AttendeeMailer extends Mailer {
|
||||
|
||||
public function sendMessageToAttendees(Message $message_object) {
|
||||
|
||||
class AttendeeMailer extends Mailer
|
||||
{
|
||||
public function sendMessageToAttendees(Message $message_object)
|
||||
{
|
||||
$event = $message_object->event;
|
||||
|
||||
$attendees = ($message_object->recipients == 0)
|
||||
|
|
@ -23,26 +23,23 @@ class AttendeeMailer extends Mailer {
|
|||
}
|
||||
|
||||
$data = [
|
||||
'event' => $event,
|
||||
'event' => $event,
|
||||
'message_content' => $message_object->message,
|
||||
'subject' => $message_object->subject
|
||||
'subject' => $message_object->subject,
|
||||
];
|
||||
|
||||
/*
|
||||
* Mandril lets us send the email to multiple people at once.
|
||||
*/
|
||||
Mail::send('Emails.messageAttendees', $data, function($message) use ($toFields, $event, $message_object) {
|
||||
Mail::send('Emails.messageAttendees', $data, function ($message) use ($toFields, $event, $message_object) {
|
||||
$message->to($toFields)
|
||||
->from(config('attendize.outgoing_email_noreply'), $event->organiser->name)
|
||||
->replyTo($event->organiser->email, $event->organiser->name)
|
||||
->subject($message_object->subject);
|
||||
});
|
||||
|
||||
|
||||
|
||||
$message_object->is_sent = 1;
|
||||
$message_object->sent_at = Carbon::now();
|
||||
$message_object->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
<?php namespace App\Attendize\mailers;
|
||||
<?php
|
||||
|
||||
namespace App\Attendize\mailers;
|
||||
|
||||
use Mail;
|
||||
|
||||
class Mailer
|
||||
{
|
||||
|
||||
public function sendTo($toEmail, $fromEmail, $fromName, $subject, $view, $data = [], $attachment = FALSE)
|
||||
public function sendTo($toEmail, $fromEmail, $fromName, $subject, $view, $data = [], $attachment = false)
|
||||
{
|
||||
Mail::send($view, $data, function ($message) use ($toEmail, $fromEmail, $fromName, $subject, $attachment) {
|
||||
$replyEmail = $fromEmail;
|
||||
|
|
@ -22,4 +23,4 @@ class Mailer
|
|||
->subject($subject);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,36 @@
|
|||
<?php namespace App\Attendize\mailers;
|
||||
<?php
|
||||
|
||||
namespace App\Attendize\mailers;
|
||||
|
||||
use App\Models\Order;
|
||||
|
||||
class OrderMailer extends Mailer {
|
||||
|
||||
|
||||
public function sendOrderNotification(Order $order) {
|
||||
$this->sendTo($order->account->email, config('attendize.outgoing_email'), config('attendize.outgoing_email_name'), 'New order received on the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderNotification', [
|
||||
'order' => $order
|
||||
class OrderMailer extends Mailer
|
||||
{
|
||||
public function sendOrderNotification(Order $order)
|
||||
{
|
||||
$this->sendTo($order->account->email, config('attendize.outgoing_email'), config('attendize.outgoing_email_name'), 'New order received on the event '.$order->event->title.' ['.$order->order_reference.']', 'Emails.OrderNotification', [
|
||||
'order' => $order,
|
||||
]);
|
||||
}
|
||||
|
||||
public function sendOrderConfirmation(Order $order) {
|
||||
|
||||
|
||||
public function sendOrderConfirmation(Order $order)
|
||||
{
|
||||
$ticket_pdf = public_path($order->ticket_pdf_path);
|
||||
|
||||
if(!file_exists($ticket_pdf)){
|
||||
$ticket_pdf = FALSE;
|
||||
|
||||
if (!file_exists($ticket_pdf)) {
|
||||
$ticket_pdf = false;
|
||||
}
|
||||
|
||||
$this->sendTo($order->email, config('attendize.outgoing_email'), $order->event->organiser->name, 'Your tickets & order confirmation for the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderConfirmation', [
|
||||
'order' => $order,
|
||||
'email_logo' => $order->event->organiser->full_logo_path
|
||||
|
||||
$this->sendTo($order->email, config('attendize.outgoing_email'), $order->event->organiser->name, 'Your tickets & order confirmation for the event '.$order->event->title.' ['.$order->order_reference.']', 'Emails.OrderConfirmation', [
|
||||
'order' => $order,
|
||||
'email_logo' => $order->event->organiser->full_logo_path,
|
||||
], $ticket_pdf);
|
||||
}
|
||||
|
||||
public function sendTickets(Order $order) {
|
||||
// $this->sendTo($order->account->email, config('attendize.outgoing_email'), config('attendize.outgoing_email_name'), 'New order received on the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderNotification', [
|
||||
|
||||
public function sendTickets(Order $order)
|
||||
{
|
||||
// $this->sendTo($order->account->email, config('attendize.outgoing_email'), config('attendize.outgoing_email_name'), 'New order received on the event '. $order->event->title .' ['. $order->order_reference .']', 'Emails.OrderNotification', [
|
||||
// 'order' => $order
|
||||
// ]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,10 +5,11 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Description of UserMailer
|
||||
* Description of UserMailer.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class UserMailer {
|
||||
class UserMailer
|
||||
{
|
||||
//put your code here
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<?php namespace App\Commands;
|
||||
<?php
|
||||
|
||||
abstract class Command {
|
||||
|
||||
//
|
||||
namespace App\Commands;
|
||||
|
||||
abstract class Command
|
||||
{
|
||||
//
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,34 +2,33 @@
|
|||
|
||||
namespace App\Commands;
|
||||
|
||||
use Log;
|
||||
use App\Commands\Command;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldBeQueued;
|
||||
use App\Attendize\mailers\AttendeeMailer;
|
||||
use Illuminate\Contracts\Bus\SelfHandling;
|
||||
use Illuminate\Contracts\Queue\ShouldBeQueued;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Log;
|
||||
|
||||
class MessageAttendeesCommand extends Command implements ShouldBeQueued, SelfHandling {
|
||||
|
||||
class MessageAttendeesCommand extends Command implements ShouldBeQueued, SelfHandling
|
||||
{
|
||||
use InteractsWithQueue,
|
||||
SerializesModels;
|
||||
|
||||
public $attendeeMessage;
|
||||
|
||||
|
||||
public function __construct(\App\Models\Message $attendeeMessage) {
|
||||
public function __construct(\App\Models\Message $attendeeMessage)
|
||||
{
|
||||
$this->attendeeMessage = $attendeeMessage;
|
||||
}
|
||||
|
||||
function handle(AttendeeMailer $mailer) {
|
||||
Log::info(date('d m y H:i') . " - Starting Job {$this->job->getJobId()} ".__CLASS__);
|
||||
|
||||
public function handle(AttendeeMailer $mailer)
|
||||
{
|
||||
Log::info(date('d m y H:i')." - Starting Job {$this->job->getJobId()} ".__CLASS__);
|
||||
|
||||
$mailer->sendMessageToAttendees($this->attendeeMessage);
|
||||
|
||||
Log::info( date('d m y H:i') . " - Finished Job {$this->job->getJobId()} ".__CLASS__);
|
||||
Log::info(date('d m y H:i')." - Finished Job {$this->job->getJobId()} ".__CLASS__);
|
||||
|
||||
$this->delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,16 +2,15 @@
|
|||
|
||||
namespace App\Commands;
|
||||
|
||||
use Log;
|
||||
use App\Commands\Command;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Contracts\Queue\ShouldBeQueued;
|
||||
use App\Attendize\mailers\OrderMailer;
|
||||
use Illuminate\Contracts\Bus\SelfHandling;
|
||||
use Illuminate\Contracts\Queue\ShouldBeQueued;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Log;
|
||||
|
||||
class OrderTicketsCommand extends Command implements ShouldBeQueued, SelfHandling {
|
||||
|
||||
class OrderTicketsCommand extends Command implements ShouldBeQueued, SelfHandling
|
||||
{
|
||||
use InteractsWithQueue,
|
||||
SerializesModels;
|
||||
|
||||
|
|
@ -20,10 +19,12 @@ class OrderTicketsCommand extends Command implements ShouldBeQueued, SelfHandlin
|
|||
|
||||
/**
|
||||
* OrderTicketsCommand constructor.
|
||||
*
|
||||
* @param \App\Models\Order $ticketOrder
|
||||
* @param bool|TRUE $sendOrderConfirmation
|
||||
* @param bool|true $sendOrderConfirmation
|
||||
*/
|
||||
public function __construct(\App\Models\Order $ticketOrder, $sendOrderConfirmation = TRUE) {
|
||||
public function __construct(\App\Models\Order $ticketOrder, $sendOrderConfirmation = true)
|
||||
{
|
||||
$this->ticketOrder = $ticketOrder;
|
||||
$this->sendOrderConfirmation = $sendOrderConfirmation;
|
||||
}
|
||||
|
|
@ -31,24 +32,23 @@ class OrderTicketsCommand extends Command implements ShouldBeQueued, SelfHandlin
|
|||
/**
|
||||
* @param OrderMailer $mailer
|
||||
*/
|
||||
function handle(OrderMailer $mailer) {
|
||||
|
||||
Log::info(date('d m y H:i') . " - Starting Job {$this->job->getJobId()} ".__CLASS__);
|
||||
public function handle(OrderMailer $mailer)
|
||||
{
|
||||
Log::info(date('d m y H:i')." - Starting Job {$this->job->getJobId()} ".__CLASS__);
|
||||
|
||||
//1 - Notify event organiser
|
||||
if($this->sendOrderConfirmation) {
|
||||
$mailer->sendOrderNotification($this->ticketOrder);
|
||||
if ($this->sendOrderConfirmation) {
|
||||
$mailer->sendOrderNotification($this->ticketOrder);
|
||||
}
|
||||
|
||||
|
||||
//2 - Generate PDF Tickets
|
||||
$this->ticketOrder->generatePdfTickets();
|
||||
|
||||
|
||||
//3 - Send Tickets / Order confirmation
|
||||
$mailer->sendOrderConfirmation($this->ticketOrder);
|
||||
|
||||
Log::info(date('d m y H:i') . " - Finished Job {$this->job->getJobId()} ".__CLASS__);
|
||||
Log::info(date('d m y H:i')." - Finished Job {$this->job->getJobId()} ".__CLASS__);
|
||||
|
||||
$this->delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<?php namespace App\Console\Commands;
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Timezone;
|
||||
use DB;
|
||||
|
|
@ -7,60 +9,59 @@ use Illuminate\Support\Facades\Artisan;
|
|||
|
||||
class Install extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'attendize:install';
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'attendize:install';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Install of Attendize';
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Install of Attendize';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$version = file_get_contents(base_path('VERSION'));
|
||||
try {
|
||||
DB::connection();
|
||||
} catch (\Exception $e) {
|
||||
$this->error('Unable to connect to database.');
|
||||
$this->error('Please fill valid database credentials into .env and rerun this command.');
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$version = file_get_contents(base_path('VERSION'));
|
||||
try {
|
||||
DB::connection();
|
||||
} catch (\Exception $e) {
|
||||
$this->error('Unable to connect to database.');
|
||||
$this->error('Please fill valid database credentials into .env and rerun this command.');
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
$this->comment('Attempting to install Attendize v'.$version);
|
||||
$this->comment('Attempting to install Attendize v'.$version);
|
||||
|
||||
if (!env('APP_KEY')) {
|
||||
$this->info('Generating app key');
|
||||
Artisan::call('key:generate');
|
||||
} else {
|
||||
$this->comment('App key exists -- skipping');
|
||||
}
|
||||
if (!env('APP_KEY')) {
|
||||
$this->info('Generating app key');
|
||||
Artisan::call('key:generate');
|
||||
} else {
|
||||
$this->comment('App key exists -- skipping');
|
||||
}
|
||||
|
||||
$this->info('Migrating database');
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
|
||||
$this->info('Migrating database');
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
if (!Timezone::count()) {
|
||||
$this->info('Seeding DB data');
|
||||
Artisan::call('db:seed', ['--force' => true]);
|
||||
} else {
|
||||
$this->comment('Data already seeded -- skipping');
|
||||
}
|
||||
|
||||
if (!Timezone::count()) {
|
||||
$this->info('Seeding DB data');
|
||||
Artisan::call('db:seed', ['--force' => true]);
|
||||
} else {
|
||||
$this->comment('Data already seeded -- skipping');
|
||||
}
|
||||
file_put_contents(base_path('installed'), $version);
|
||||
|
||||
file_put_contents(base_path('installed'), $version);
|
||||
|
||||
$this->comment('Success! You can now run Attendize');
|
||||
$this->comment('Navigate to /signup to create your account.');
|
||||
}
|
||||
}
|
||||
$this->comment('Success! You can now run Attendize');
|
||||
$this->comment('Navigate to /signup to create your account.');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,29 @@
|
|||
<?php namespace App\Console;
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel {
|
||||
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
Commands\Install::class
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
}
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
Commands\Install::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
<?php namespace App\Events;
|
||||
<?php
|
||||
|
||||
abstract class Event {
|
||||
|
||||
//
|
||||
namespace App\Events;
|
||||
|
||||
abstract class Event
|
||||
{
|
||||
//
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,47 +2,51 @@
|
|||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception, Request;
|
||||
use Exception;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Request;
|
||||
|
||||
//use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
|
||||
|
||||
class Handler extends ExceptionHandler {
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* A list of the exception types that should not be reported.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
'Symfony\Component\HttpKernel\Exception\HttpException'
|
||||
'Symfony\Component\HttpKernel\Exception\HttpException',
|
||||
];
|
||||
|
||||
/**
|
||||
*
|
||||
* Report or log an exception.
|
||||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @param \Exception $e
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function report(Exception $e) {
|
||||
public function report(Exception $e)
|
||||
{
|
||||
return parent::report($e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $e
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $e
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request, Exception $e) {
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
if ($this->isHttpException($e)) {
|
||||
return $this->renderHttpException($e);
|
||||
}
|
||||
|
||||
|
||||
if (config('app.debug')) {
|
||||
return $this->renderExceptionWithWhoops($e);
|
||||
}
|
||||
|
|
@ -52,22 +56,23 @@ class Handler extends ExceptionHandler {
|
|||
|
||||
/**
|
||||
* Render an exception using Whoops.
|
||||
*
|
||||
* @param \Exception $e
|
||||
*
|
||||
* @param \Exception $e
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected function renderExceptionWithWhoops(Exception $e) {
|
||||
$whoops = new \Whoops\Run;
|
||||
|
||||
if(Request::ajax()) {
|
||||
$whoops->pushHandler(new \Whoops\Handler\JsonResponseHandler);
|
||||
protected function renderExceptionWithWhoops(Exception $e)
|
||||
{
|
||||
$whoops = new \Whoops\Run();
|
||||
|
||||
if (Request::ajax()) {
|
||||
$whoops->pushHandler(new \Whoops\Handler\JsonResponseHandler());
|
||||
} else {
|
||||
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
||||
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
|
||||
}
|
||||
|
||||
|
||||
return new \Illuminate\Http\Response(
|
||||
$whoops->handleException($e), $e->getStatusCode(), $e->getHeaders()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,33 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* @param int $amount
|
||||
* @param int $amount
|
||||
* @param string $currency_code
|
||||
* @param int $decimals
|
||||
* @param int $decimals
|
||||
* @param string $dec_point
|
||||
* @param string $thousands_sep
|
||||
*
|
||||
* @return decimal
|
||||
*/
|
||||
function money($amount, $currency_code='', $decimals = 2 ,$dec_point = "." , $thousands_sep = "," ) {
|
||||
|
||||
switch($currency_code) {
|
||||
case 'USD' :
|
||||
case 'AUD' :
|
||||
case 'CAD' :
|
||||
function money($amount, $currency_code = '', $decimals = 2, $dec_point = '.', $thousands_sep = ',')
|
||||
{
|
||||
switch ($currency_code) {
|
||||
case 'USD':
|
||||
case 'AUD':
|
||||
case 'CAD':
|
||||
$currency_symbol = '$';
|
||||
break;
|
||||
case 'EUR' :
|
||||
case 'EUR':
|
||||
$currency_symbol = '€';
|
||||
break;
|
||||
case 'GBP' :
|
||||
case 'GBP':
|
||||
$currency_symbol = '£';
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
default:
|
||||
$currency_symbol = '';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return $currency_symbol.number_format($amount, $decimals, $dec_point, $thousands_sep);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
|
||||
|
||||
Validator::extend('passcheck', function ($attribute, $value, $parameters)
|
||||
{
|
||||
Validator::extend('passcheck', function ($attribute, $value, $parameters) {
|
||||
return \Hash::check($value, \Auth::user()->getAuthPassword());
|
||||
});
|
||||
|
||||
|
|
@ -10,36 +9,35 @@ Validator::extend('passcheck', function ($attribute, $value, $parameters)
|
|||
* Some macros and blade extensions
|
||||
*/
|
||||
|
||||
Form::macro('rawLabel', function($name, $value = null, $options = array()) {
|
||||
Form::macro('rawLabel', function ($name, $value = null, $options = []) {
|
||||
$label = Form::label($name, '%s', $options);
|
||||
|
||||
return sprintf($label, $value);
|
||||
});
|
||||
|
||||
Form::macro('labelWithHelp', function($name, $value = null, $options = array(), $help_text) {
|
||||
Form::macro('labelWithHelp', function ($name, $value, $options, $help_text) {
|
||||
$label = Form::label($name, '%s', $options);
|
||||
|
||||
return sprintf($label, $value)
|
||||
.'<a style="margin-left: 4px;font-size: 11px;" href="javascript:showHelp('."'".$help_text."'".');" >'
|
||||
. '<i class="ico ico-question "></i>'
|
||||
. '</a>';
|
||||
.'<i class="ico ico-question "></i>'
|
||||
.'</a>';
|
||||
});
|
||||
|
||||
Form::macro('customCheckbox', function ($name, $value, $checked = false, $label = false, $options = []) {
|
||||
|
||||
Form::macro('customCheckbox', function($name, $value, $checked=FALSE, $label = FALSE, $options= []) {
|
||||
|
||||
// $checkbox = Form::checkbox($name, $value = null, $checked, $options);
|
||||
// $label = Form::rawLabel();
|
||||
//
|
||||
// $out = '<div class="checkbox custom-checkbox">
|
||||
// <input type="checkbox" name="send_copy" id="send_copy" value="1">
|
||||
// <label for="send_copy"> Send a copy to <b>{{$attendee->event->organiser->email}}</b></label>
|
||||
//
|
||||
// $out = '<div class="checkbox custom-checkbox">
|
||||
// <input type="checkbox" name="send_copy" id="send_copy" value="1">
|
||||
// <label for="send_copy"> Send a copy to <b>{{$attendee->event->organiser->email}}</b></label>
|
||||
// </div>';
|
||||
//
|
||||
//
|
||||
// return $out;
|
||||
});
|
||||
|
||||
Form::macro('styledFile', function($name, $multiple = FALSE) {
|
||||
Form::macro('styledFile', function ($name, $multiple = false) {
|
||||
$out = '<div class="styledFile" id="input-'.$name.'">
|
||||
<div class="input-group">
|
||||
<span class="input-group-btn">
|
||||
|
|
@ -55,17 +53,17 @@ Form::macro('styledFile', function($name, $multiple = FALSE) {
|
|||
</span>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
||||
return $out;
|
||||
});
|
||||
|
||||
HTML::macro('sortable_link', function($title, $active_sort, $sort_by, $sort_order, $url_params = [], $class = '', $extra = '') {
|
||||
HTML::macro('sortable_link', function ($title, $active_sort, $sort_by, $sort_order, $url_params = [], $class = '', $extra = '') {
|
||||
|
||||
$sort_order = $sort_order == 'asc' ? 'desc' : 'asc';
|
||||
|
||||
$url_params = http_build_query([
|
||||
'sort_by' => $sort_by,
|
||||
'sort_order' => $sort_order
|
||||
'sort_by' => $sort_by,
|
||||
'sort_order' => $sort_order,
|
||||
] + $url_params);
|
||||
|
||||
$html = "<a href='?$url_params' class='col-sort $class' $extra>";
|
||||
|
|
@ -79,10 +77,6 @@ HTML::macro('sortable_link', function($title, $active_sort, $sort_by, $sort_orde
|
|||
return $html;
|
||||
});
|
||||
|
||||
|
||||
|
||||
Blade::directive('money', function($expression) {
|
||||
Blade::directive('money', function ($expression) {
|
||||
return "<?php echo number_format($expression, 2); ?>";
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +1,40 @@
|
|||
<?php namespace App\Http\Controllers\Auth;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\Registrar;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||
|
||||
class AuthController extends Controller {
|
||||
class AuthController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Registration & Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users, as well as the
|
||||
| authentication of existing users. By default, this controller uses
|
||||
| a simple trait to add these behaviors. Why don't you explore it?
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Registration & Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users, as well as the
|
||||
| authentication of existing users. By default, this controller uses
|
||||
| a simple trait to add these behaviors. Why don't you explore it?
|
||||
|
|
||||
*/
|
||||
use AuthenticatesAndRegistersUsers;
|
||||
|
||||
use AuthenticatesAndRegistersUsers;
|
||||
|
||||
/**
|
||||
* Create a new authentication controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, Registrar $registrar)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->registrar = $registrar;
|
||||
|
||||
$this->middleware('guest', ['except' => 'getLogout']);
|
||||
}
|
||||
/**
|
||||
* Create a new authentication controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \Illuminate\Contracts\Auth\Registrar $registrar
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth, Registrar $registrar)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->registrar = $registrar;
|
||||
|
||||
$this->middleware('guest', ['except' => 'getLogout']);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,38 +1,38 @@
|
|||
<?php namespace App\Http\Controllers\Auth;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class PasswordController extends Controller {
|
||||
class PasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
use ResetsPasswords;
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Create a new password controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->passwords = $passwords;
|
||||
|
||||
$this->middleware('guest');
|
||||
}
|
||||
/**
|
||||
* Create a new password controller instance.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\Guard $auth
|
||||
* @param \Illuminate\Contracts\Auth\PasswordBroker $passwords
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->passwords = $passwords;
|
||||
|
||||
$this->middleware('guest');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesCommands;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
|
||||
abstract class Controller extends BaseController {
|
||||
|
||||
use DispatchesCommands, ValidatesRequests;
|
||||
|
||||
abstract class Controller extends BaseController
|
||||
{
|
||||
use DispatchesCommands, ValidatesRequests;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,116 +2,110 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Input,
|
||||
DB,
|
||||
Auth,
|
||||
Mail,
|
||||
Response,
|
||||
View,
|
||||
Excel,
|
||||
Session,
|
||||
Validator;
|
||||
use App\Commands\OrderTicketsCommand;
|
||||
use App\Models\Attendee;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventStats;
|
||||
use App\Models\Order;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\Attendee;
|
||||
use App\Models\OrderItem;
|
||||
use App\Models\Message;
|
||||
use App\Commands\MessageAttendeesCommand;
|
||||
use App\Commands\OrderTicketsCommand;
|
||||
|
||||
class EventAttendeesController extends MyBaseController {
|
||||
|
||||
public function showAttendees($event_id) {
|
||||
use App\Models\Order;
|
||||
use App\Models\OrderItem;
|
||||
use App\Models\Ticket;
|
||||
use Auth;
|
||||
use DB;
|
||||
use Excel;
|
||||
use Input;
|
||||
use Mail;
|
||||
use Response;
|
||||
use Session;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class EventAttendeesController extends MyBaseController
|
||||
{
|
||||
public function showAttendees($event_id)
|
||||
{
|
||||
$allowed_sorts = ['first_name', 'email', 'ticket_id', 'order_reference'];
|
||||
|
||||
$searchQuery = Input::get('q');
|
||||
$sort_order = Input::get('sort_order') == 'asc' ? 'asc' : 'desc';
|
||||
$sort_by = (in_array(Input::get('sort_by'), $allowed_sorts) ? Input::get('sort_by') : 'created_at');
|
||||
|
||||
|
||||
|
||||
$event = Event::scope()->find($event_id);
|
||||
//$event = Event::scope()->join('orders', 'orders.event_id', '=', 'attendees.id')->find($event_id);
|
||||
|
||||
if ($searchQuery) {
|
||||
|
||||
$attendees = $event->attendees()
|
||||
->withoutCancelled()
|
||||
->join('orders', 'orders.id', '=', 'attendees.order_id')
|
||||
->where(function($query) use ($searchQuery) {
|
||||
$query->where('orders.order_reference', 'like', $searchQuery . '%')
|
||||
->orWhere('attendees.first_name', 'like', $searchQuery . '%')
|
||||
->orWhere('attendees.email', 'like', $searchQuery . '%')
|
||||
->orWhere('attendees.last_name', 'like', $searchQuery . '%');
|
||||
->where(function ($query) use ($searchQuery) {
|
||||
$query->where('orders.order_reference', 'like', $searchQuery.'%')
|
||||
->orWhere('attendees.first_name', 'like', $searchQuery.'%')
|
||||
->orWhere('attendees.email', 'like', $searchQuery.'%')
|
||||
->orWhere('attendees.last_name', 'like', $searchQuery.'%');
|
||||
})
|
||||
->orderBy(($sort_by == 'order_reference' ? 'orders.' : 'attendees.') . $sort_by, $sort_order)
|
||||
->orderBy(($sort_by == 'order_reference' ? 'orders.' : 'attendees.').$sort_by, $sort_order)
|
||||
->select('attendees.*', 'orders.order_reference')
|
||||
->paginate();
|
||||
} else {
|
||||
$attendees = $event->attendees()
|
||||
->join('orders', 'orders.id', '=', 'attendees.order_id')
|
||||
->withoutCancelled()
|
||||
->orderBy(($sort_by == 'order_reference' ? 'orders.' : 'attendees.') . $sort_by, $sort_order)
|
||||
->orderBy(($sort_by == 'order_reference' ? 'orders.' : 'attendees.').$sort_by, $sort_order)
|
||||
->select('attendees.*', 'orders.order_reference')
|
||||
->paginate();
|
||||
}
|
||||
|
||||
$data = [
|
||||
'attendees' => $attendees,
|
||||
'event' => $event,
|
||||
'sort_by' => $sort_by,
|
||||
'attendees' => $attendees,
|
||||
'event' => $event,
|
||||
'sort_by' => $sort_by,
|
||||
'sort_order' => $sort_order,
|
||||
'q' => $searchQuery ? $searchQuery : ''
|
||||
'q' => $searchQuery ? $searchQuery : '',
|
||||
];
|
||||
|
||||
|
||||
|
||||
return View::make('ManageEvent.Attendees', $data);
|
||||
}
|
||||
|
||||
public function showCreateAttendee($event_id) {
|
||||
|
||||
public function showCreateAttendee($event_id)
|
||||
{
|
||||
$event = Event::scope()->find($event_id);
|
||||
|
||||
/*
|
||||
* If there are no tickets then we can't create an attendee
|
||||
* @todo This is a bit hackish
|
||||
*/
|
||||
if($event->tickets->count() === 0) {
|
||||
if ($event->tickets->count() === 0) {
|
||||
return '<script>showMessage("You need to create a ticket before you can add an attendee.");</script>';
|
||||
}
|
||||
|
||||
return View::make('ManageEvent.Modals.CreateAttendee', array(
|
||||
return View::make('ManageEvent.Modals.CreateAttendee', [
|
||||
'modal_id' => \Input::get('modal_id'),
|
||||
'event' => $event,
|
||||
'tickets' => $event->tickets()->lists('title', 'id')
|
||||
));
|
||||
'event' => $event,
|
||||
'tickets' => $event->tickets()->lists('title', 'id'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function postCreateAttendee($event_id) {
|
||||
|
||||
public function postCreateAttendee($event_id)
|
||||
{
|
||||
$rules = [
|
||||
'first_name' => 'required',
|
||||
'ticket_id' => 'required|exists:tickets,id,account_id,' . \Auth::user()->account_id,
|
||||
'first_name' => 'required',
|
||||
'ticket_id' => 'required|exists:tickets,id,account_id,'.\Auth::user()->account_id,
|
||||
'ticket_price' => 'numeric|required',
|
||||
'email' => 'email|required',
|
||||
'email' => 'email|required',
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'ticket_id.exists' => 'The ticket you have selected does not exist',
|
||||
'ticket_id.required' => 'The ticket field is required. '
|
||||
'ticket_id.exists' => 'The ticket you have selected does not exist',
|
||||
'ticket_id.required' => 'The ticket field is required. ',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$ticket_id = Input::get('ticket_id');
|
||||
|
|
@ -121,11 +115,10 @@ class EventAttendeesController extends MyBaseController {
|
|||
$attendee_email = Input::get('email');
|
||||
$email_attendee = Input::get('email_ticket');
|
||||
|
||||
|
||||
/*
|
||||
* Create the order
|
||||
*/
|
||||
$order = new Order;
|
||||
$order = new Order();
|
||||
$order->first_name = $attendee_first_name;
|
||||
$order->last_name = $attendee_last_name;
|
||||
$order->email = $attendee_email;
|
||||
|
|
@ -143,30 +136,27 @@ class EventAttendeesController extends MyBaseController {
|
|||
$ticket->increment('sales_volume', $ticket_price);
|
||||
$ticket->event->increment('sales_volume', $ticket_price);
|
||||
|
||||
|
||||
/*
|
||||
* Insert order item
|
||||
*/
|
||||
$orderItem = new OrderItem;
|
||||
$orderItem = new OrderItem();
|
||||
$orderItem->title = $ticket->title;
|
||||
$orderItem->quantity = 1;
|
||||
$orderItem->order_id = $order->id;
|
||||
$orderItem->unit_price = $ticket_price;
|
||||
$orderItem->save();
|
||||
|
||||
|
||||
/*
|
||||
* Update the event stats
|
||||
*/
|
||||
$event_stats = new EventStats;
|
||||
$event_stats = new EventStats();
|
||||
$event_stats->updateTicketsSoldCount($event_id, 1);
|
||||
$event_stats->updateTicketRevenue($ticket_id, $ticket_price);
|
||||
|
||||
|
||||
/*
|
||||
* Create the attendee
|
||||
*/
|
||||
$attendee = new Attendee;
|
||||
$attendee = new Attendee();
|
||||
$attendee->first_name = $attendee_first_name;
|
||||
$attendee->last_name = $attendee_last_name;
|
||||
$attendee->email = $attendee_email;
|
||||
|
|
@ -174,7 +164,7 @@ class EventAttendeesController extends MyBaseController {
|
|||
$attendee->order_id = $order->id;
|
||||
$attendee->ticket_id = $ticket_id;
|
||||
$attendee->account_id = Auth::user()->account_id;
|
||||
$attendee->reference = $order->order_reference . '-1';
|
||||
$attendee->reference = $order->order_reference.'-1';
|
||||
$attendee->save();
|
||||
|
||||
if ($email_attendee == '1') {
|
||||
|
|
@ -183,63 +173,63 @@ class EventAttendeesController extends MyBaseController {
|
|||
|
||||
Session::flash('message', 'Attendee Successfully Created');
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'id' => $attendee->id,
|
||||
'redirectUrl' => route('showEventAttendees', array(
|
||||
'event_id' => $event_id
|
||||
))
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'id' => $attendee->id,
|
||||
'redirectUrl' => route('showEventAttendees', [
|
||||
'event_id' => $event_id,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function showPrintAttendees($event_id) {
|
||||
|
||||
public function showPrintAttendees($event_id)
|
||||
{
|
||||
$data['event'] = Event::scope()->find($event_id);
|
||||
$data['attendees'] = $data['event']->attendees()->withoutCancelled()->orderBy('first_name')->get();
|
||||
|
||||
return View::make('ManageEvent.PrintAttendees', $data);
|
||||
}
|
||||
|
||||
public function showMessageAttendee($attendee_id) {
|
||||
|
||||
public function showMessageAttendee($attendee_id)
|
||||
{
|
||||
$attendee = Attendee::scope()->findOrFail($attendee_id);
|
||||
|
||||
$data = [
|
||||
'attendee' => $attendee,
|
||||
'event' => $attendee->event,
|
||||
'event' => $attendee->event,
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Modals.MessageAttendee', $data);
|
||||
}
|
||||
|
||||
public function postMessageAttendee($attendee_id) {
|
||||
|
||||
public function postMessageAttendee($attendee_id)
|
||||
{
|
||||
$rules = [
|
||||
'subject' => 'required',
|
||||
'message' => 'required'
|
||||
'message' => 'required',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$attendee = Attendee::scope()->findOrFail($attendee_id);
|
||||
|
||||
$data = [
|
||||
'attendee' => $attendee,
|
||||
'attendee' => $attendee,
|
||||
'message_content' => Input::get('message'),
|
||||
'subject' => Input::get('subject'),
|
||||
'event' => $attendee->event,
|
||||
'email_logo' => $attendee->event->organiser->full_logo_path
|
||||
'subject' => Input::get('subject'),
|
||||
'event' => $attendee->event,
|
||||
'email_logo' => $attendee->event->organiser->full_logo_path,
|
||||
];
|
||||
|
||||
Mail::send('Emails.messageAttendees', $data, function($message) use ($attendee, $data) {
|
||||
Mail::send('Emails.messageAttendees', $data, function ($message) use ($attendee, $data) {
|
||||
$message->to($attendee->email, $attendee->full_name)
|
||||
->from(config('attendize.outgoing_email_noreply'), $attendee->event->organiser->name)
|
||||
->replyTo($attendee->event->organiser->email, $attendee->event->organiser->name)
|
||||
|
|
@ -248,50 +238,46 @@ class EventAttendeesController extends MyBaseController {
|
|||
|
||||
/* Could bcc in the above? */
|
||||
if (Input::get('send_copy') == '1') {
|
||||
Mail::send('Emails.messageAttendees', $data, function($message) use ($attendee, $data) {
|
||||
Mail::send('Emails.messageAttendees', $data, function ($message) use ($attendee, $data) {
|
||||
$message->to($attendee->event->organiser->email, $attendee->event->organiser->name)
|
||||
->from(config('attendize.outgoing_email_noreply'), $attendee->event->organiser->name)
|
||||
->replyTo($attendee->event->organiser->email, $attendee->event->organiser->name)
|
||||
->subject($data['subject'] . '[ORGANISER COPY]');
|
||||
->subject($data['subject'].'[ORGANISER COPY]');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'message' => 'Message Successfully Sent'
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'message' => 'Message Successfully Sent',
|
||||
]);
|
||||
}
|
||||
|
||||
public function showMessageAttendees($event_id) {
|
||||
|
||||
public function showMessageAttendees($event_id)
|
||||
{
|
||||
$data = [
|
||||
'event' => Event::scope()->find($event_id),
|
||||
'event' => Event::scope()->find($event_id),
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'tickets' => Event::scope()->find($event_id)->tickets()->lists('title', 'id')->toArray()
|
||||
'tickets' => Event::scope()->find($event_id)->tickets()->lists('title', 'id')->toArray(),
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Modals.MessageAttendees', $data);
|
||||
}
|
||||
|
||||
public function postMessageAttendees($event_id) {
|
||||
|
||||
public function postMessageAttendees($event_id)
|
||||
{
|
||||
$rules = [
|
||||
'subject' => 'required',
|
||||
'message' => 'required',
|
||||
'recipients' => 'required'
|
||||
'subject' => 'required',
|
||||
'message' => 'required',
|
||||
'recipients' => 'required',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$message = Message::createNew();
|
||||
|
|
@ -305,15 +291,15 @@ class EventAttendeesController extends MyBaseController {
|
|||
* Add to the queue
|
||||
*/
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'message' => 'Message Successfully Sent'
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'message' => 'Message Successfully Sent',
|
||||
]);
|
||||
}
|
||||
|
||||
public function showExportAttendees($event_id, $export_as = 'xls') {
|
||||
|
||||
Excel::create('attendees-as-of-' . date('d-m-Y-g.i.a'), function($excel) use ($event_id) {
|
||||
public function showExportAttendees($event_id, $export_as = 'xls')
|
||||
{
|
||||
Excel::create('attendees-as-of-'.date('d-m-Y-g.i.a'), function ($excel) use ($event_id) {
|
||||
|
||||
$excel->setTitle('Attendees List');
|
||||
|
||||
|
|
@ -321,7 +307,7 @@ class EventAttendeesController extends MyBaseController {
|
|||
$excel->setCreator(config('attendize.app_name'))
|
||||
->setCompany(config('attendize.app_name'));
|
||||
|
||||
$excel->sheet('attendees_sheet_1', function($sheet) use ($event_id) {
|
||||
$excel->sheet('attendees_sheet_1', function ($sheet) use ($event_id) {
|
||||
|
||||
DB::connection()->setFetchMode(\PDO::FETCH_ASSOC);
|
||||
$data = DB::table('attendees')
|
||||
|
|
@ -335,58 +321,54 @@ class EventAttendeesController extends MyBaseController {
|
|||
'attendees.first_name', 'attendees.last_name', 'attendees.email', 'attendees.reference', 'orders.order_reference', 'tickets.title', 'orders.created_at', DB::raw("(CASE WHEN attendees.has_arrived = 1 THEN 'YES' ELSE 'NO' END) AS `attendees.has_arrived`"), 'attendees.arrival_time')->get();
|
||||
//DB::raw("(CASE WHEN UNIX_TIMESTAMP(`attendees.arrival_time`) = 0 THEN '---' ELSE 'd' END) AS `attendees.arrival_time`"))
|
||||
|
||||
|
||||
|
||||
|
||||
$sheet->fromArray($data);
|
||||
|
||||
$sheet->row(1, array(
|
||||
'First Name', 'Last Name', 'Email', 'Ticket Reference', 'Order Reference', 'Ticket Type', 'Purchase Date', 'Has Arrived', 'Arrival Time'
|
||||
));
|
||||
$sheet->row(1, [
|
||||
'First Name', 'Last Name', 'Email', 'Ticket Reference', 'Order Reference', 'Ticket Type', 'Purchase Date', 'Has Arrived', 'Arrival Time',
|
||||
]);
|
||||
|
||||
// Set gray background on first row
|
||||
$sheet->row(1, function($row) {
|
||||
$sheet->row(1, function ($row) {
|
||||
$row->setBackground('#f5f5f5');
|
||||
});
|
||||
});
|
||||
})->export($export_as);
|
||||
}
|
||||
|
||||
public function showEditAttendee($event_id, $attendee_id) {
|
||||
|
||||
|
||||
public function showEditAttendee($event_id, $attendee_id)
|
||||
{
|
||||
$attendee = Attendee::scope()->findOrFail($attendee_id);
|
||||
|
||||
$data = [
|
||||
'attendee' => $attendee,
|
||||
'event' => $attendee->event,
|
||||
'tickets' => $attendee->event->tickets->lists('title', 'id'),
|
||||
'event' => $attendee->event,
|
||||
'tickets' => $attendee->event->tickets->lists('title', 'id'),
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Modals.EditAttendee', $data);
|
||||
}
|
||||
|
||||
public function postEditAttendee($event_id, $attendee_id) {
|
||||
|
||||
public function postEditAttendee($event_id, $attendee_id)
|
||||
{
|
||||
$rules = [
|
||||
'first_name' => 'required',
|
||||
'ticket_id' => 'required|exists:tickets,id,account_id,' . Auth::user()->account_id,
|
||||
'email' => 'required|email'
|
||||
'ticket_id' => 'required|exists:tickets,id,account_id,'.Auth::user()->account_id,
|
||||
'email' => 'required|email',
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'ticket_id.exists' => 'The ticket you have selected does not exist',
|
||||
'ticket_id.required' => 'The ticket field is required. '
|
||||
'ticket_id.exists' => 'The ticket you have selected does not exist',
|
||||
'ticket_id.required' => 'The ticket field is required. ',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$attendee = Attendee::scope()->findOrFail($attendee_id);
|
||||
|
|
@ -397,28 +379,30 @@ class EventAttendeesController extends MyBaseController {
|
|||
$attendee->ticket_id = Input::get('ticket_id');
|
||||
$attendee->save();
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'id' => $attendee->id,
|
||||
'message' => 'Refreshing...',
|
||||
'redirectUrl' => ''
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'id' => $attendee->id,
|
||||
'message' => 'Refreshing...',
|
||||
'redirectUrl' => '',
|
||||
]);
|
||||
}
|
||||
|
||||
public function showCancelAttendee($event_id, $attendee_id) {
|
||||
public function showCancelAttendee($event_id, $attendee_id)
|
||||
{
|
||||
$attendee = Attendee::scope()->findOrFail($attendee_id);
|
||||
|
||||
$data = [
|
||||
'attendee' => $attendee,
|
||||
'event' => $attendee->event,
|
||||
'tickets' => $attendee->event->tickets->lists('title', 'id'),
|
||||
'event' => $attendee->event,
|
||||
'tickets' => $attendee->event->tickets->lists('title', 'id'),
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Modals.CancelAttendee', $data);
|
||||
}
|
||||
|
||||
public function postCancelAttendee($event_id, $attendee_id) {
|
||||
public function postCancelAttendee($event_id, $attendee_id)
|
||||
{
|
||||
$attendee = Attendee::scope()->findOrFail($attendee_id);
|
||||
|
||||
$attendee->ticket->decrement('quantity_sold');
|
||||
|
|
@ -426,12 +410,12 @@ class EventAttendeesController extends MyBaseController {
|
|||
$attendee->save();
|
||||
|
||||
$data = [
|
||||
'attendee' => $attendee,
|
||||
'email_logo' => $attendee->organiser->full_logo_path
|
||||
'attendee' => $attendee,
|
||||
'email_logo' => $attendee->organiser->full_logo_path,
|
||||
];
|
||||
|
||||
|
||||
if (Input::get('notify_attendee') == '1') {
|
||||
Mail::send('Emails.notifyCancelledAttendee', $data, function($message) use ($attendee) {
|
||||
Mail::send('Emails.notifyCancelledAttendee', $data, function ($message) use ($attendee) {
|
||||
$message->to($attendee->email, $attendee->full_name)
|
||||
->from(config('attendize.outgoing_email_noreply'), $attendee->event->organiser->name)
|
||||
->replyTo($attendee->event->organiser->email, $attendee->event->organiser->name)
|
||||
|
|
@ -441,12 +425,11 @@ class EventAttendeesController extends MyBaseController {
|
|||
|
||||
\Session::flash('message', 'Successfully Cancelled Attenddee');
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'id' => $attendee->id,
|
||||
'message' => 'Refreshing...',
|
||||
'redirectUrl' => ''
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'id' => $attendee->id,
|
||||
'message' => 'Refreshing...',
|
||||
'redirectUrl' => '',
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,40 +1,45 @@
|
|||
<?php
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Input,
|
||||
DB,
|
||||
Response,
|
||||
View;
|
||||
use App\Models\Event;
|
||||
use App\Models\Attendee;
|
||||
use App\Models\Event;
|
||||
use Carbon\Carbon;
|
||||
use DB;
|
||||
use Input;
|
||||
use Response;
|
||||
use View;
|
||||
|
||||
class EventCheckInController extends MyBaseController {
|
||||
|
||||
class EventCheckInController extends MyBaseController
|
||||
{
|
||||
/**
|
||||
* @param $event_id
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function showCheckIn($event_id) {
|
||||
public function showCheckIn($event_id)
|
||||
{
|
||||
$data['event'] = Event::scope()->findOrFail($event_id);
|
||||
$data['attendees'] = $data['event']->attendees;
|
||||
|
||||
return View::make('ManageEvent.CheckIn', $data);
|
||||
}
|
||||
|
||||
public function postCheckInSearch($event_id) {
|
||||
|
||||
public function postCheckInSearch($event_id)
|
||||
{
|
||||
$searchQuery = Input::get('q');
|
||||
|
||||
$attendees = Attendee::scope()->withoutCancelled()
|
||||
->join('tickets', 'tickets.id', '=', 'attendees.ticket_id')
|
||||
->where(function($query) use ($event_id) {
|
||||
->where(function ($query) use ($event_id) {
|
||||
$query->where('attendees.event_id', '=', $event_id);
|
||||
})->where(function($query) use ($searchQuery) {
|
||||
$query->orWhere('attendees.first_name', 'like', $searchQuery . '%')
|
||||
->orWhere(DB::raw("CONCAT_WS(' ', first_name, last_name)"), 'like', $searchQuery . '%')
|
||||
})->where(function ($query) use ($searchQuery) {
|
||||
$query->orWhere('attendees.first_name', 'like', $searchQuery.'%')
|
||||
->orWhere(DB::raw("CONCAT_WS(' ', first_name, last_name)"), 'like', $searchQuery.'%')
|
||||
//->orWhere('attendees.email', 'like', $searchQuery . '%')
|
||||
->orWhere('attendees.reference', 'like', $searchQuery . '%')
|
||||
->orWhere('attendees.last_name', 'like', $searchQuery . '%');
|
||||
->orWhere('attendees.reference', 'like', $searchQuery.'%')
|
||||
->orWhere('attendees.last_name', 'like', $searchQuery.'%');
|
||||
})
|
||||
->select([
|
||||
'attendees.id',
|
||||
|
|
@ -44,7 +49,7 @@ class EventCheckInController extends MyBaseController {
|
|||
'attendees.reference',
|
||||
'attendees.arrival_time',
|
||||
'attendees.has_arrived',
|
||||
'tickets.title as ticket'
|
||||
'tickets.title as ticket',
|
||||
])
|
||||
->orderBy('attendees.first_name', 'ASC')
|
||||
->get();
|
||||
|
|
@ -52,10 +57,10 @@ class EventCheckInController extends MyBaseController {
|
|||
return Response::json($attendees);
|
||||
}
|
||||
|
||||
public function postCheckInAttendee() {
|
||||
|
||||
public function postCheckInAttendee()
|
||||
{
|
||||
$attendee_id = Input::get('attendee_id');
|
||||
$checking = Input::get('checking');
|
||||
$checking = Input::get('checking');
|
||||
|
||||
$attendee = Attendee::scope()->find($attendee_id);
|
||||
|
||||
|
|
@ -64,10 +69,10 @@ class EventCheckInController extends MyBaseController {
|
|||
*/
|
||||
if ((($checking == 'in') && ($attendee->has_arrived == 1)) || (($checking == 'out') && ($attendee->has_arrived == 0))) {
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'message' => 'Warning: This Attendee Has Already Been Checked ' . (($checking == 'in') ? 'In (at '.$attendee->arrival_time->format('H:i A, F j').')' : 'Out').'!',
|
||||
'status' => 'error',
|
||||
'message' => 'Warning: This Attendee Has Already Been Checked '.(($checking == 'in') ? 'In (at '.$attendee->arrival_time->format('H:i A, F j').')' : 'Out').'!',
|
||||
'checked' => $checking,
|
||||
'id' => $attendee->id
|
||||
'id' => $attendee->id,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -76,11 +81,10 @@ class EventCheckInController extends MyBaseController {
|
|||
$attendee->save();
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'status' => 'success',
|
||||
'checked' => $checking,
|
||||
'message' => 'Attendee Successfully Checked ' . (($checking == 'in') ? 'In' : 'Out'),
|
||||
'id' => $attendee->id
|
||||
'message' => 'Attendee Successfully Checked '.(($checking == 'in') ? 'In' : 'Out'),
|
||||
'id' => $attendee->id,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,36 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
use View,
|
||||
Input,
|
||||
Validator,
|
||||
DB,
|
||||
Response,
|
||||
Session,
|
||||
Request,
|
||||
Redirect,
|
||||
Log,
|
||||
Cookie,
|
||||
App;
|
||||
use PDF;
|
||||
use Bugsnag;
|
||||
use Stripe,
|
||||
Stripe_Charge,
|
||||
Stripe_Customer;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App;
|
||||
use App\Attendize\Utils;
|
||||
use App\Commands\OrderTicketsCommand;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Carbon\Carbon;
|
||||
use App\Models\Event;
|
||||
use App\Models\Affiliate;
|
||||
use App\Models\Order;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\Attendee;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventStats;
|
||||
use App\Models\Order;
|
||||
use App\Models\OrderItem;
|
||||
use App\Models\ReservedTickets;
|
||||
use App\Attendize\Utils;
|
||||
use App\Models\Ticket;
|
||||
use Carbon\Carbon;
|
||||
use Cookie;
|
||||
use DB;
|
||||
use Input;
|
||||
use Log;
|
||||
use PDF;
|
||||
use Redirect;
|
||||
use Request;
|
||||
use Response;
|
||||
use Session;
|
||||
use Stripe;
|
||||
use Stripe_Charge;
|
||||
use Stripe_Customer;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class EventCheckoutController extends Controller
|
||||
{
|
||||
|
||||
protected $is_embedded;
|
||||
|
||||
public function __construct()
|
||||
|
|
@ -59,7 +58,7 @@ class EventCheckoutController extends Controller
|
|||
ReservedTickets::where('session_id', '=', Session::getId())->delete();
|
||||
|
||||
/*
|
||||
* Go though the selected tickets and check if they're available
|
||||
* Go though the selected tickets and check if they're available
|
||||
* , tot up the price and reserve them to prevent over selling.
|
||||
*/
|
||||
|
||||
|
|
@ -73,9 +72,7 @@ class EventCheckoutController extends Controller
|
|||
$quantity_available_validation_rules = [];
|
||||
|
||||
foreach ($ticket_ids as $ticket_id) {
|
||||
|
||||
$current_ticket_quantity = (int)Input::get('ticket_' . $ticket_id);
|
||||
|
||||
$current_ticket_quantity = (int) Input::get('ticket_'.$ticket_id);
|
||||
|
||||
if ($current_ticket_quantity < 1) {
|
||||
continue;
|
||||
|
|
@ -92,21 +89,19 @@ class EventCheckoutController extends Controller
|
|||
*/
|
||||
$max_per_person = min($ticket_quantity_remaining, $ticket->max_per_person);
|
||||
|
||||
$quantity_available_validation_rules['ticket_' . $ticket_id] = ['numeric', 'min:' . $ticket->min_per_person, 'max:' . $max_per_person];
|
||||
|
||||
$quantity_available_validation_rules['ticket_'.$ticket_id] = ['numeric', 'min:'.$ticket->min_per_person, 'max:'.$max_per_person];
|
||||
|
||||
$quantity_available_validation_messages = [
|
||||
'ticket_' . $ticket_id . '.max' => 'The maximum number of tickets you can register is ' . $ticket_quantity_remaining,
|
||||
'ticket_' . $ticket_id . '.min' => 'You must select at least ' . $ticket->min_per_person . ' tickets.'
|
||||
'ticket_'.$ticket_id.'.max' => 'The maximum number of tickets you can register is '.$ticket_quantity_remaining,
|
||||
'ticket_'.$ticket_id.'.min' => 'You must select at least '.$ticket->min_per_person.' tickets.',
|
||||
];
|
||||
|
||||
|
||||
$validator = Validator::make(['ticket_' . $ticket_id => (int)Input::get('ticket_' . $ticket_id)], $quantity_available_validation_rules, $quantity_available_validation_messages);
|
||||
$validator = Validator::make(['ticket_'.$ticket_id => (int) Input::get('ticket_'.$ticket_id)], $quantity_available_validation_rules, $quantity_available_validation_messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -115,18 +110,18 @@ class EventCheckoutController extends Controller
|
|||
$organiser_booking_fee = $organiser_booking_fee + ($current_ticket_quantity * $ticket->organiser_booking_fee);
|
||||
|
||||
$tickets[] = [
|
||||
'ticket' => $ticket,
|
||||
'qty' => $current_ticket_quantity,
|
||||
'price' => ($current_ticket_quantity * $ticket->price),
|
||||
'booking_fee' => ($current_ticket_quantity * $ticket->booking_fee),
|
||||
'ticket' => $ticket,
|
||||
'qty' => $current_ticket_quantity,
|
||||
'price' => ($current_ticket_quantity * $ticket->price),
|
||||
'booking_fee' => ($current_ticket_quantity * $ticket->booking_fee),
|
||||
'organiser_booking_fee' => ($current_ticket_quantity * $ticket->organiser_booking_fee),
|
||||
'full_price' => $ticket->price + $ticket->total_booking_fee
|
||||
'full_price' => $ticket->price + $ticket->total_booking_fee,
|
||||
];
|
||||
|
||||
/*
|
||||
* Reserve the tickets in the DB
|
||||
*/
|
||||
$reservedTickets = new ReservedTickets;
|
||||
$reservedTickets = new ReservedTickets();
|
||||
$reservedTickets->ticket_id = $ticket_id;
|
||||
$reservedTickets->event_id = $event_id;
|
||||
$reservedTickets->quantity_reserved = $current_ticket_quantity;
|
||||
|
|
@ -139,68 +134,67 @@ class EventCheckoutController extends Controller
|
|||
/*
|
||||
* Create our validation rules here
|
||||
*/
|
||||
$validation_rules['ticket_holder_first_name.' . $i . '.' . $ticket_id] = ['required'];
|
||||
$validation_rules['ticket_holder_last_name.' . $i . '.' . $ticket_id] = ['required'];
|
||||
$validation_rules['ticket_holder_email.' . $i . '.' . $ticket_id] = ['required', 'email'];
|
||||
$validation_rules['ticket_holder_first_name.'.$i.'.'.$ticket_id] = ['required'];
|
||||
$validation_rules['ticket_holder_last_name.'.$i.'.'.$ticket_id] = ['required'];
|
||||
$validation_rules['ticket_holder_email.'.$i.'.'.$ticket_id] = ['required', 'email'];
|
||||
|
||||
$validation_messages['ticket_holder_first_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s first name is required';
|
||||
$validation_messages['ticket_holder_last_name.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s last name is required';
|
||||
$validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.required'] = 'Ticket holder ' . ($i + 1) . '\'s email is required';
|
||||
$validation_messages['ticket_holder_email.' . $i . '.' . $ticket_id . '.email'] = 'Ticket holder ' . ($i + 1) . '\'s email appears to be invalid';
|
||||
$validation_messages['ticket_holder_first_name.'.$i.'.'.$ticket_id.'.required'] = 'Ticket holder '.($i + 1).'\'s first name is required';
|
||||
$validation_messages['ticket_holder_last_name.'.$i.'.'.$ticket_id.'.required'] = 'Ticket holder '.($i + 1).'\'s last name is required';
|
||||
$validation_messages['ticket_holder_email.'.$i.'.'.$ticket_id.'.required'] = 'Ticket holder '.($i + 1).'\'s email is required';
|
||||
$validation_messages['ticket_holder_email.'.$i.'.'.$ticket_id.'.email'] = 'Ticket holder '.($i + 1).'\'s email appears to be invalid';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($tickets)) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'message' => 'No tickets selected.'
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'message' => 'No tickets selected.',
|
||||
]);
|
||||
}
|
||||
|
||||
/*
|
||||
* @todo - Store this in something other than a session?
|
||||
*/
|
||||
Session::set('ticket_order_' . $event->id, [
|
||||
'validation_rules' => $validation_rules,
|
||||
'validation_messages' => $validation_messages,
|
||||
'event_id' => $event->id,
|
||||
'tickets' => $tickets, /* probably shouldn't store the whole ticket obj in session */
|
||||
'total_ticket_quantity' => $total_ticket_quantity,
|
||||
'order_started' => time(),
|
||||
'expires' => $order_expires_time,
|
||||
'reserved_tickets_id' => $reservedTickets->id,
|
||||
'order_total' => $order_total,
|
||||
'booking_fee' => $booking_fee,
|
||||
'organiser_booking_fee' => $organiser_booking_fee,
|
||||
'total_booking_fee' => $booking_fee + $organiser_booking_fee,
|
||||
'order_requires_payment' => (ceil($order_total) == 0) ? FALSE : TRUE,
|
||||
'account_id' => $event->account->id,
|
||||
'affiliate_referral' => Cookie::get('affiliate_' . $event_id)
|
||||
Session::set('ticket_order_'.$event->id, [
|
||||
'validation_rules' => $validation_rules,
|
||||
'validation_messages' => $validation_messages,
|
||||
'event_id' => $event->id,
|
||||
'tickets' => $tickets, /* probably shouldn't store the whole ticket obj in session */
|
||||
'total_ticket_quantity' => $total_ticket_quantity,
|
||||
'order_started' => time(),
|
||||
'expires' => $order_expires_time,
|
||||
'reserved_tickets_id' => $reservedTickets->id,
|
||||
'order_total' => $order_total,
|
||||
'booking_fee' => $booking_fee,
|
||||
'organiser_booking_fee' => $organiser_booking_fee,
|
||||
'total_booking_fee' => $booking_fee + $organiser_booking_fee,
|
||||
'order_requires_payment' => (ceil($order_total) == 0) ? false : true,
|
||||
'account_id' => $event->account->id,
|
||||
'affiliate_referral' => Cookie::get('affiliate_'.$event_id),
|
||||
]);
|
||||
|
||||
if (Request::ajax()) {
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'redirectUrl' => route('showEventCheckout', [
|
||||
'event_id' => $event_id,
|
||||
'is_embedded' => $this->is_embedded
|
||||
]) . '#order_form'
|
||||
));
|
||||
'event_id' => $event_id,
|
||||
'is_embedded' => $this->is_embedded,
|
||||
]).'#order_form',
|
||||
]);
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: We should just show an enable JS message here instead
|
||||
*/
|
||||
return Redirect::to(route('showEventCheckout', [
|
||||
'event_id' => $event_id
|
||||
]) . '#order_form');
|
||||
'event_id' => $event_id,
|
||||
]).'#order_form');
|
||||
}
|
||||
|
||||
public function showEventCheckout($event_id)
|
||||
{
|
||||
|
||||
$order_session = Session::get('ticket_order_' . $event_id);
|
||||
$order_session = Session::get('ticket_order_'.$event_id);
|
||||
|
||||
if (!$order_session || $order_session['expires'] < Carbon::now()) {
|
||||
return Redirect::route('showEventPage', ['event_id' => $event_id]);
|
||||
|
|
@ -210,82 +204,79 @@ class EventCheckoutController extends Controller
|
|||
|
||||
//dd($secondsToExpire);
|
||||
$data = $order_session + [
|
||||
'event' => Event::findorFail($order_session['event_id']),
|
||||
'event' => Event::findorFail($order_session['event_id']),
|
||||
'secondsToExpire' => $secondsToExpire,
|
||||
'is_embedded' => $this->is_embedded
|
||||
'is_embedded' => $this->is_embedded,
|
||||
];
|
||||
|
||||
if ($this->is_embedded) {
|
||||
return View::make('Public.ViewEvent.Embedded.EventPageCheckout', $data);
|
||||
}
|
||||
|
||||
return View::make('Public.ViewEvent.EventPageCheckout', $data);
|
||||
}
|
||||
|
||||
public function postCreateOrder($event_id)
|
||||
{
|
||||
|
||||
$mirror_buyer_info = (Input::get('mirror_buyer_info') == 'on') ? TRUE : FALSE;
|
||||
$mirror_buyer_info = (Input::get('mirror_buyer_info') == 'on') ? true : false;
|
||||
|
||||
$event = Event::findOrFail($event_id);
|
||||
|
||||
$order = new Order;
|
||||
$order = new Order();
|
||||
|
||||
$ticket_order = Session::get('ticket_order_' . $event_id);
|
||||
$ticket_order = Session::get('ticket_order_'.$event_id);
|
||||
|
||||
$attendee_increment = 1;
|
||||
|
||||
$validation_rules = $ticket_order['validation_rules'];
|
||||
$validation_messages = $ticket_order['validation_messages'];
|
||||
|
||||
|
||||
if (!$mirror_buyer_info && $event->ask_for_all_attendees_info) {
|
||||
$order->rules = $order->rules + $validation_rules;
|
||||
$order->messages = $order->messages + $validation_messages;
|
||||
}
|
||||
|
||||
if (!$order->validate(Input::all())) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $order->errors()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $order->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Begin payment attempt before creating the attendees etc.
|
||||
* */
|
||||
if ($ticket_order['order_requires_payment']) {
|
||||
|
||||
try {
|
||||
|
||||
$stripe_error = FALSE;
|
||||
$stripe_error = false;
|
||||
|
||||
Stripe::setApiKey($event->account->stripe_api_key);
|
||||
|
||||
$token = Input::get('stripeToken');
|
||||
|
||||
$customer = Stripe_Customer::create(array(
|
||||
'email' => Input::get('order_email'),
|
||||
'card' => $token,
|
||||
'description' => 'Customer: ' . Input::get('order_email')
|
||||
));
|
||||
$customer = Stripe_Customer::create([
|
||||
'email' => Input::get('order_email'),
|
||||
'card' => $token,
|
||||
'description' => 'Customer: '.Input::get('order_email'),
|
||||
]);
|
||||
|
||||
if (Utils::isAttendize()) {
|
||||
$charge = Stripe_Charge::create(array(
|
||||
'customer' => $customer->id,
|
||||
'amount' => ($ticket_order['order_total'] + $ticket_order['organiser_booking_fee']) * 100,
|
||||
'currency' => $event->currency->code,
|
||||
'description' => Input::get('order_email'),
|
||||
$charge = Stripe_Charge::create([
|
||||
'customer' => $customer->id,
|
||||
'amount' => ($ticket_order['order_total'] + $ticket_order['organiser_booking_fee']) * 100,
|
||||
'currency' => $event->currency->code,
|
||||
'description' => Input::get('order_email'),
|
||||
'application_fee' => $ticket_order['booking_fee'] * 100,
|
||||
'description' => 'Order for customer: ' . Input::get('order_email')
|
||||
));
|
||||
'description' => 'Order for customer: '.Input::get('order_email'),
|
||||
]);
|
||||
} else {
|
||||
$charge = Stripe_Charge::create(array(
|
||||
'customer' => $customer->id,
|
||||
'amount' => ($ticket_order['order_total'] + $ticket_order['organiser_booking_fee']) * 100,
|
||||
'currency' => $event->currency->code,
|
||||
$charge = Stripe_Charge::create([
|
||||
'customer' => $customer->id,
|
||||
'amount' => ($ticket_order['order_total'] + $ticket_order['organiser_booking_fee']) * 100,
|
||||
'currency' => $event->currency->code,
|
||||
'description' => Input::get('order_email'),
|
||||
'description' => 'Order for customer: ' . Input::get('order_email')
|
||||
));
|
||||
'description' => 'Order for customer: '.Input::get('order_email'),
|
||||
]);
|
||||
}
|
||||
|
||||
$order->transaction_id = $charge->id;
|
||||
|
|
@ -313,10 +304,10 @@ class EventCheckoutController extends Controller
|
|||
}
|
||||
|
||||
if ($stripe_error) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'message' => $stripe_error
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'message' => $stripe_error,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -351,11 +342,11 @@ class EventCheckoutController extends Controller
|
|||
}
|
||||
|
||||
/*
|
||||
* Update the event stats
|
||||
* Update the event stats
|
||||
*/
|
||||
$event_stats = EventStats::firstOrNew([
|
||||
'event_id' => $event_id,
|
||||
'date' => DB::raw('CURDATE()')
|
||||
'date' => DB::raw('CURDATE()'),
|
||||
]);
|
||||
$event_stats->increment('tickets_sold', $ticket_order['total_ticket_quantity']);
|
||||
|
||||
|
|
@ -384,7 +375,7 @@ class EventCheckoutController extends Controller
|
|||
/*
|
||||
* Insert order items (for use in generating invoices)
|
||||
*/
|
||||
$orderItem = new OrderItem;
|
||||
$orderItem = new OrderItem();
|
||||
$orderItem->title = $attendee_details['ticket']['title'];
|
||||
$orderItem->quantity = $attendee_details['qty'];
|
||||
$orderItem->order_id = $order->id;
|
||||
|
|
@ -396,7 +387,7 @@ class EventCheckoutController extends Controller
|
|||
* Create the attendees
|
||||
*/
|
||||
for ($i = 0; $i < $attendee_details['qty']; $i++) {
|
||||
$attendee = new Attendee;
|
||||
$attendee = new Attendee();
|
||||
$attendee->first_name = $event->ask_for_all_attendees_info ? ($mirror_buyer_info ? $order->first_name : Input::get("ticket_holder_first_name.$i.{$attendee_details['ticket']['id']}")) : $order->first_name;
|
||||
$attendee->last_name = $event->ask_for_all_attendees_info ? ($mirror_buyer_info ? $order->last_name : Input::get("ticket_holder_last_name.$i.{$attendee_details['ticket']['id']}")) : $order->last_name;
|
||||
$attendee->email = $event->ask_for_all_attendees_info ? ($mirror_buyer_info ? $order->email : Input::get("ticket_holder_email.$i.{$attendee_details['ticket']['id']}")) : $order->email;
|
||||
|
|
@ -404,14 +395,13 @@ class EventCheckoutController extends Controller
|
|||
$attendee->order_id = $order->id;
|
||||
$attendee->ticket_id = $attendee_details['ticket']['id'];
|
||||
$attendee->account_id = $event->account->id;
|
||||
$attendee->reference = $order->order_reference . '-' . ($attendee_increment);
|
||||
$attendee->reference = $order->order_reference.'-'.($attendee_increment);
|
||||
$attendee->save();
|
||||
|
||||
/*
|
||||
* Queue an email to send to each attendee
|
||||
*/
|
||||
|
||||
|
||||
/* Keep track of total number of attendees */
|
||||
$attendee_increment++;
|
||||
}
|
||||
|
|
@ -428,32 +418,32 @@ class EventCheckoutController extends Controller
|
|||
ReservedTickets::where('session_id', '=', Session::getId())->delete();
|
||||
|
||||
/*
|
||||
* Kill the session
|
||||
* Kill the session
|
||||
*/
|
||||
Session::forget('ticket_order_' . $event->id);
|
||||
Session::forget('ticket_order_'.$event->id);
|
||||
|
||||
/*
|
||||
* Queue the PDF creation jobs
|
||||
*/
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'redirectUrl' => route('showOrderDetails', [
|
||||
'is_embedded' => $this->is_embedded,
|
||||
'order_reference' => $order->order_reference
|
||||
])
|
||||
));
|
||||
'is_embedded' => $this->is_embedded,
|
||||
'order_reference' => $order->order_reference,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the order details page
|
||||
* Show the order details page.
|
||||
*
|
||||
* @param string $order_reference
|
||||
*
|
||||
* @return view
|
||||
*/
|
||||
public function showOrderDetails($order_reference)
|
||||
{
|
||||
|
||||
$order = Order::where('order_reference', '=', $order_reference)->first();
|
||||
|
||||
if (!$order) {
|
||||
|
|
@ -461,26 +451,26 @@ class EventCheckoutController extends Controller
|
|||
}
|
||||
|
||||
$data = [
|
||||
'order' => $order,
|
||||
'event' => $order->event,
|
||||
'tickets' => $order->event->tickets,
|
||||
'is_embedded' => $this->is_embedded
|
||||
'order' => $order,
|
||||
'event' => $order->event,
|
||||
'tickets' => $order->event->tickets,
|
||||
'is_embedded' => $this->is_embedded,
|
||||
];
|
||||
|
||||
if ($this->is_embedded) {
|
||||
return View::make('Public.ViewEvent.Embedded.EventPageViewOrder', $data);
|
||||
}
|
||||
|
||||
return View::make('Public.ViewEvent.EventPageViewOrder', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Output order tickets
|
||||
* Output order tickets.
|
||||
*
|
||||
* @param string $order_reference
|
||||
*/
|
||||
public function showOrderTickets($order_reference)
|
||||
{
|
||||
|
||||
$order = Order::where('order_reference', '=', $order_reference)->first();
|
||||
|
||||
if (!$order) {
|
||||
|
|
@ -488,10 +478,10 @@ class EventCheckoutController extends Controller
|
|||
}
|
||||
|
||||
$data = [
|
||||
'order' => $order,
|
||||
'event' => $order->event,
|
||||
'tickets' => $order->event->tickets,
|
||||
'attendees' => $order->attendees
|
||||
'order' => $order,
|
||||
'event' => $order->event,
|
||||
'tickets' => $order->event->tickets,
|
||||
'attendees' => $order->attendees,
|
||||
];
|
||||
|
||||
if (Input::get('download') == '1') {
|
||||
|
|
@ -500,5 +490,4 @@ class EventCheckoutController extends Controller
|
|||
|
||||
return View::make('Public.ViewEvent.Partials.PDFTicket', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,43 +1,45 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
use Response, Input, Validator;
|
||||
use Auth;
|
||||
use Image;
|
||||
use Storage;
|
||||
use View;
|
||||
use Carbon\Carbon;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\EventImage;
|
||||
use App\Models\Organiser;
|
||||
use App\Models\Event;
|
||||
|
||||
class EventController extends MyBaseController {
|
||||
|
||||
|
||||
public function showCreateEvent() {
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Image;
|
||||
use Input;
|
||||
use Response;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class EventController extends MyBaseController
|
||||
{
|
||||
public function showCreateEvent()
|
||||
{
|
||||
$data = [
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'organisers' => Organiser::scope()->lists('name', 'id'),
|
||||
'organiser_id' => Input::get('organiser_id') ? Input::get('organiser_id') : false
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'organisers' => Organiser::scope()->lists('name', 'id'),
|
||||
'organiser_id' => Input::get('organiser_id') ? Input::get('organiser_id') : false,
|
||||
];
|
||||
|
||||
return View::make('ManageOrganiser.Modals.CreateEvent', $data);
|
||||
}
|
||||
|
||||
public function postCreateEvent() {
|
||||
|
||||
public function postCreateEvent()
|
||||
{
|
||||
$event = Event::createNew();
|
||||
|
||||
if (!$event->validate(Input::all())) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $event->errors()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $event->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->title = Input::get('title');
|
||||
$event->description = strip_tags(Input::get('description'));
|
||||
$event->start_date = Input::get('start_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_date')) : NULL;
|
||||
$event->start_date = Input::get('start_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_date')) : null;
|
||||
|
||||
/*
|
||||
* Venue location info (Usually autofilled from google maps)
|
||||
|
|
@ -69,32 +71,29 @@ class EventController extends MyBaseController {
|
|||
$event->location_is_manual = 1;
|
||||
}
|
||||
|
||||
$event->end_date = Input::get('end_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_date')) : null;
|
||||
|
||||
$event->end_date = Input::get('end_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_date')) : NULL;
|
||||
|
||||
$event->currency_id = Auth::user()->account->currency_id;
|
||||
//$event->timezone_id = Auth::user()->account->timezone_id;
|
||||
|
||||
|
||||
if (Input::get('organiser_name')) {
|
||||
$organiser = Organiser::createNew(false, false, true);
|
||||
|
||||
$organiser = Organiser::createNew(FALSE, FALSE, TRUE);
|
||||
|
||||
$rules = array(
|
||||
'organiser_name' => array('required'),
|
||||
'organiser_email' => array('required', 'email'),
|
||||
);
|
||||
$messages = array(
|
||||
'organiser_name.required' => 'You must give a name for the event organiser.'
|
||||
);
|
||||
$rules = [
|
||||
'organiser_name' => ['required'],
|
||||
'organiser_email' => ['required', 'email'],
|
||||
];
|
||||
$messages = [
|
||||
'organiser_name.required' => 'You must give a name for the event organiser.',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$organiser->name = Input::get('organiser_name');
|
||||
|
|
@ -106,17 +105,16 @@ class EventController extends MyBaseController {
|
|||
$event->organiser_id = $organiser->id;
|
||||
} elseif (Input::get('organiser_id')) {
|
||||
$event->organiser_id = Input::get('organiser_id');
|
||||
} else { /* Somethings gone horribly wrong */}
|
||||
} else { /* Somethings gone horribly wrong */
|
||||
}
|
||||
|
||||
$event->save();
|
||||
|
||||
if (Input::hasFile('event_image')) {
|
||||
$path = public_path().'/'.config('attendize.event_images_path');
|
||||
$filename = 'event_image-'.md5(time().$event->id).'.'.strtolower(Input::file('event_image')->getClientOriginalExtension());
|
||||
|
||||
$path = public_path() . '/' . config('attendize.event_images_path');
|
||||
$filename = 'event_image-' . md5(time() . $event->id) . '.' . strtolower(Input::file('event_image')->getClientOriginalExtension());
|
||||
|
||||
$file_full_path = $path . '/' . $filename;
|
||||
|
||||
$file_full_path = $path.'/'.$filename;
|
||||
|
||||
Input::file('event_image')->move($path, $filename);
|
||||
|
||||
|
|
@ -128,43 +126,41 @@ class EventController extends MyBaseController {
|
|||
});
|
||||
|
||||
$img->save($file_full_path);
|
||||
|
||||
|
||||
/* Upload to s3 */
|
||||
\Storage::put(config('attendize.event_images_path').'/'.$filename, file_get_contents($file_full_path));
|
||||
|
||||
|
||||
$eventImage = EventImage::createNew();
|
||||
$eventImage->image_path = config('attendize.event_images_path') . '/' . $filename;
|
||||
$eventImage->image_path = config('attendize.event_images_path').'/'.$filename;
|
||||
$eventImage->event_id = $event->id;
|
||||
$eventImage->save();
|
||||
}
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'id' => $event->id,
|
||||
'redirectUrl' => route('showEventTickets', array(
|
||||
'event_id' => $event->id,
|
||||
'first_run' => 'yup'
|
||||
))
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'id' => $event->id,
|
||||
'redirectUrl' => route('showEventTickets', [
|
||||
'event_id' => $event->id,
|
||||
'first_run' => 'yup',
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function postEditEvent($event_id) {
|
||||
|
||||
public function postEditEvent($event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
if (!$event->validate(Input::all())) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $event->errors()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $event->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->is_live = Input::get('is_live');
|
||||
$event->title = Input::get('title');
|
||||
$event->description = strip_tags(Input::get('description'));
|
||||
$event->start_date = Input::get('start_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_date')) : NULL;
|
||||
|
||||
$event->start_date = Input::get('start_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_date')) : null;
|
||||
|
||||
/*
|
||||
* If the google place ID is the same as before then don't update the venue
|
||||
|
|
@ -205,9 +201,7 @@ class EventController extends MyBaseController {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$event->end_date = Input::get('end_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_date')) : NULL;
|
||||
|
||||
$event->end_date = Input::get('end_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_date')) : null;
|
||||
|
||||
if (Input::get('remove_current_image') == '1') {
|
||||
EventImage::where('event_id', '=', $event->id)->delete();
|
||||
|
|
@ -216,12 +210,10 @@ class EventController extends MyBaseController {
|
|||
$event->save();
|
||||
|
||||
if (Input::hasFile('event_image')) {
|
||||
$path = public_path().'/'.config('attendize.event_images_path');
|
||||
$filename = 'event_image-'.md5(time().$event->id).'.'.strtolower(Input::file('event_image')->getClientOriginalExtension());
|
||||
|
||||
$path = public_path() . '/' . config('attendize.event_images_path');
|
||||
$filename = 'event_image-' . md5(time() . $event->id) . '.' . strtolower(Input::file('event_image')->getClientOriginalExtension());
|
||||
|
||||
$file_full_path = $path . '/' . $filename;
|
||||
|
||||
$file_full_path = $path.'/'.$filename;
|
||||
|
||||
Input::file('event_image')->move($path, $filename);
|
||||
|
||||
|
|
@ -233,57 +225,51 @@ class EventController extends MyBaseController {
|
|||
});
|
||||
|
||||
$img->save($file_full_path);
|
||||
|
||||
|
||||
\Storage::put(config('attendize.event_images_path').'/'.$filename, file_get_contents($file_full_path));
|
||||
|
||||
EventImage::where('event_id', '=', $event->id)->delete();
|
||||
|
||||
$eventImage = EventImage::createNew();
|
||||
$eventImage->image_path = config('attendize.event_images_path') . '/' . $filename;
|
||||
$eventImage->image_path = config('attendize.event_images_path').'/'.$filename;
|
||||
$eventImage->event_id = $event->id;
|
||||
$eventImage->save();
|
||||
}
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'id' => $event->id,
|
||||
'message' => 'Event Successfully Updated',
|
||||
'redirectUrl' => ''
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'id' => $event->id,
|
||||
'message' => 'Event Successfully Updated',
|
||||
'redirectUrl' => '',
|
||||
]);
|
||||
}
|
||||
|
||||
public function postUploadEventImage() {
|
||||
|
||||
public function postUploadEventImage()
|
||||
{
|
||||
if (Input::hasFile('event_image')) {
|
||||
|
||||
$the_file = \File::get(Input::file('event_image')->getRealPath());
|
||||
$file_name = 'event_details_image-' . md5(microtime()) . '.' . strtolower(Input::file('event_image')->getClientOriginalExtension());
|
||||
|
||||
$relative_path_to_file = config('attendize.event_images_path') . '/' . $file_name;
|
||||
$file_name = 'event_details_image-'.md5(microtime()).'.'.strtolower(Input::file('event_image')->getClientOriginalExtension());
|
||||
|
||||
$relative_path_to_file = config('attendize.event_images_path').'/'.$file_name;
|
||||
$full_path_to_file = public_path().'/'.$relative_path_to_file;
|
||||
|
||||
|
||||
$img = Image::make($the_file);
|
||||
|
||||
$img->resize(1000, null, function ($constraint) {
|
||||
$constraint->aspectRatio();
|
||||
$constraint->upsize();
|
||||
});
|
||||
|
||||
|
||||
$img->save($full_path_to_file);
|
||||
if(\Storage::put($file_name, $the_file)) {
|
||||
if (\Storage::put($file_name, $the_file)) {
|
||||
return Response::json([
|
||||
'link' => '/'.$relative_path_to_file
|
||||
'link' => '/'.$relative_path_to_file,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
return Response::json([
|
||||
'error' => 'There was a problem uploading your image.'
|
||||
'error' => 'There was a problem uploading your image.',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,33 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Event;
|
||||
use Response, Input, File, Image, Validator, View;
|
||||
use File;
|
||||
use Image;
|
||||
use Input;
|
||||
use Response;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class EventCustomizeController extends MyBaseController {
|
||||
|
||||
public function showCustomize($event_id = '', $tab = '') {
|
||||
class EventCustomizeController extends MyBaseController
|
||||
{
|
||||
public function showCustomize($event_id = '', $tab = '')
|
||||
{
|
||||
$data = $this->getEventViewData($event_id, [
|
||||
'available_bg_images' => $this->getAvailableBackgroundImages(),
|
||||
'available_bg_images' => $this->getAvailableBackgroundImages(),
|
||||
'available_bg_images_thumbs' => $this->getAvailableBackgroundImagesThumbs(),
|
||||
'tab' => $tab
|
||||
'tab' => $tab,
|
||||
]);
|
||||
|
||||
return View::make('ManageEvent.Customize', $data);
|
||||
}
|
||||
|
||||
public function getAvailableBackgroundImages() {
|
||||
|
||||
public function getAvailableBackgroundImages()
|
||||
{
|
||||
$images = [];
|
||||
|
||||
$files = File::files(public_path() . '/' . config('attendize.event_bg_images'));
|
||||
$files = File::files(public_path().'/'.config('attendize.event_bg_images'));
|
||||
|
||||
foreach ($files as $image) {
|
||||
$images[] = str_replace(public_path(), '', $image);
|
||||
|
|
@ -26,12 +35,12 @@ class EventCustomizeController extends MyBaseController {
|
|||
|
||||
return $images;
|
||||
}
|
||||
|
||||
public function getAvailableBackgroundImagesThumbs() {
|
||||
|
||||
public function getAvailableBackgroundImagesThumbs()
|
||||
{
|
||||
$images = [];
|
||||
|
||||
$files = File::files(public_path() . '/' . config('attendize.event_bg_images').'/thumbs');
|
||||
$files = File::files(public_path().'/'.config('attendize.event_bg_images').'/thumbs');
|
||||
|
||||
foreach ($files as $image) {
|
||||
$images[] = str_replace(public_path(), '', $image);
|
||||
|
|
@ -39,17 +48,18 @@ class EventCustomizeController extends MyBaseController {
|
|||
|
||||
return $images;
|
||||
}
|
||||
|
||||
public function postEditEventSocial($event_id) {
|
||||
|
||||
public function postEditEventSocial($event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
$rules = [
|
||||
'social_share_text' => ['max:3000'],
|
||||
'social_show_facebook' => ['boolean'],
|
||||
'social_show_twitter' => ['boolean'],
|
||||
'social_show_linkedin' => ['boolean'],
|
||||
'social_show_email' => ['boolean'],
|
||||
'social_show_googleplus' => ['boolean']
|
||||
'social_share_text' => ['max:3000'],
|
||||
'social_show_facebook' => ['boolean'],
|
||||
'social_show_twitter' => ['boolean'],
|
||||
'social_show_linkedin' => ['boolean'],
|
||||
'social_show_email' => ['boolean'],
|
||||
'social_show_googleplus' => ['boolean'],
|
||||
];
|
||||
$messages = [
|
||||
'social_share_text.max' => 'Please keep the shate text under 3000 characters.',
|
||||
|
|
@ -58,10 +68,10 @@ class EventCustomizeController extends MyBaseController {
|
|||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->social_share_text = Input::get('social_share_text');
|
||||
|
|
@ -73,31 +83,32 @@ class EventCustomizeController extends MyBaseController {
|
|||
$event->save();
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'status' => 'success',
|
||||
'message' => 'Social Settings Succesfully Upated',
|
||||
]);
|
||||
}
|
||||
|
||||
public function postEditEventFees($event_id) {
|
||||
|
||||
public function postEditEventFees($event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
$rules = [
|
||||
'organiser_fee_percentage' => ['numeric', 'between:0,100'],
|
||||
'organiser_fee_fixed' => ['numeric', 'between:0,100']
|
||||
'organiser_fee_fixed' => ['numeric', 'between:0,100'],
|
||||
];
|
||||
$messages = [
|
||||
'organiser_fee_percentage.numeric' => 'Please enter a value between 0 and 100',
|
||||
'organiser_fee_fixed.numeric' => 'Please check the format. It shoud be in the format 0.00.',
|
||||
'organiser_fee_fixed.between' => 'Please enter a value between 0 and 100.'
|
||||
'organiser_fee_fixed.numeric' => 'Please check the format. It shoud be in the format 0.00.',
|
||||
'organiser_fee_fixed.between' => 'Please enter a value between 0 and 100.',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->organiser_fee_percentage = Input::get('organiser_fee_percentage');
|
||||
|
|
@ -105,12 +116,13 @@ class EventCustomizeController extends MyBaseController {
|
|||
$event->save();
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'status' => 'success',
|
||||
'message' => 'Order Page Succesfully Upated',
|
||||
]);
|
||||
}
|
||||
|
||||
public function postEditEventOrderPage($event_id) {
|
||||
public function postEditEventOrderPage($event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
// Just plain text so no validation needed (hopefully)
|
||||
|
|
@ -120,10 +132,10 @@ class EventCustomizeController extends MyBaseController {
|
|||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event->pre_order_display_message = trim(Input::get('pre_order_display_message'));
|
||||
|
|
@ -132,33 +144,32 @@ class EventCustomizeController extends MyBaseController {
|
|||
$event->save();
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'status' => 'success',
|
||||
'message' => 'Order Page Succesfully Upated',
|
||||
]);
|
||||
}
|
||||
|
||||
public function postEditEventDesign($event_id) {
|
||||
|
||||
public function postEditEventDesign($event_id)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
$rules = [
|
||||
'bg_image_path' => ['mimes:jpeg,jpg,png', 'max:4000']
|
||||
'bg_image_path' => ['mimes:jpeg,jpg,png', 'max:4000'],
|
||||
];
|
||||
$messages = [
|
||||
'bg_image_path.mimes' => 'Please ensure you are uploading an image (JPG, PNG, JPEG)',
|
||||
'bg_image_path.max' => 'Pleae ensure the image is not larger than 2.5MB'
|
||||
'bg_image_path.max' => 'Pleae ensure the image is not larger than 2.5MB',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
if (Input::get('bg_image_path_custom') && Input::get('bg_type') == 'image') {
|
||||
$event->bg_image_path = Input::get('bg_image_path_custom');
|
||||
$event->bg_type = 'image';
|
||||
|
|
@ -173,12 +184,10 @@ class EventCustomizeController extends MyBaseController {
|
|||
* Not in use for now.
|
||||
*/
|
||||
if (Input::hasFile('bg_image_path') && Input::get('bg_type') == 'custom_image') {
|
||||
$path = public_path().'/'.config('attendize.event_images_path');
|
||||
$filename = 'event_bg-'.md5($event->id).'.'.strtolower(Input::file('bg_image_path')->getClientOriginalExtension());
|
||||
|
||||
$path = public_path() . '/' . config('attendize.event_images_path');
|
||||
$filename = 'event_bg-'. md5($event->id) . '.' . strtolower(Input::file('bg_image_path')->getClientOriginalExtension());
|
||||
|
||||
$file_full_path = $path . '/' . $filename;
|
||||
|
||||
$file_full_path = $path.'/'.$filename;
|
||||
|
||||
Input::file('bg_image_path')->move($path, $filename);
|
||||
|
||||
|
|
@ -191,8 +200,7 @@ class EventCustomizeController extends MyBaseController {
|
|||
|
||||
$img->save($file_full_path, 75);
|
||||
|
||||
|
||||
$event->bg_image_path = config('attendize.event_images_path') . '/' . $filename;
|
||||
$event->bg_image_path = config('attendize.event_images_path').'/'.$filename;
|
||||
$event->bg_type = 'custom_image';
|
||||
|
||||
\Storage::put(config('attendize.event_images_path').'/'.$filename, file_get_contents($file_full_path));
|
||||
|
|
@ -201,10 +209,9 @@ class EventCustomizeController extends MyBaseController {
|
|||
$event->save();
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'status' => 'success',
|
||||
'message' => 'Event Page Succesfully Upated',
|
||||
'runThis' => 'document.getElementById(\'previewIframe\').contentWindow.location.reload(true);'
|
||||
'runThis' => 'document.getElementById(\'previewIframe\').contentWindow.location.reload(true);',
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,24 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use View;
|
||||
use Carbon\Carbon;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventStats;
|
||||
use DateTime, DatePeriod, DateInterval;
|
||||
use Carbon\Carbon;
|
||||
use DateInterval;
|
||||
use DatePeriod;
|
||||
use DateTime;
|
||||
use View;
|
||||
|
||||
class EventDashboardController extends MyBaseController {
|
||||
|
||||
|
||||
function showDashboard($event_id = FALSE) {
|
||||
class EventDashboardController extends MyBaseController
|
||||
{
|
||||
public function showDashboard($event_id = false)
|
||||
{
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
$num_days= 20;
|
||||
|
||||
/**
|
||||
$num_days = 20;
|
||||
|
||||
/*
|
||||
* This is a fairly hackish way to get the data for the dashboard charts. I'm sure someone
|
||||
* with better SQL skill could do it in one simple query.
|
||||
*
|
||||
|
|
@ -25,7 +29,7 @@ class EventDashboardController extends MyBaseController {
|
|||
->where('date', '>', Carbon::now()->subDays($num_days)->format('Y-m-d'))
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
|
||||
$startDate = new DateTime("-$num_days days");
|
||||
$dateItter = new DatePeriod(
|
||||
$startDate, new DateInterval('P1D'), $num_days
|
||||
|
|
@ -36,7 +40,7 @@ class EventDashboardController extends MyBaseController {
|
|||
/*
|
||||
* I have no idea what I was doing here, but it seems to work;
|
||||
*/
|
||||
$result = array();
|
||||
$result = [];
|
||||
$i = 0;
|
||||
foreach ($dateItter as $date) {
|
||||
$views = 0;
|
||||
|
|
@ -52,23 +56,22 @@ class EventDashboardController extends MyBaseController {
|
|||
$organiser_fees_volume = $item['organiser_fees_volume'];
|
||||
$unique_views = $item['unique_views'];
|
||||
$tickets_sold = $item['tickets_sold'];
|
||||
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$result[] = array(
|
||||
"date" => $date->format('Y-m-d'),
|
||||
"views" => $views,
|
||||
$result[] = [
|
||||
'date' => $date->format('Y-m-d'),
|
||||
'views' => $views,
|
||||
'unique_views' => $unique_views,
|
||||
'sales_volume' => $sales_volume + $organiser_fees_volume,
|
||||
'tickets_sold' => $tickets_sold
|
||||
);
|
||||
'tickets_sold' => $tickets_sold,
|
||||
];
|
||||
}
|
||||
|
||||
$data = [
|
||||
'event' => $event,
|
||||
'chartData' => json_encode($result)
|
||||
'event' => $event,
|
||||
'chartData' => json_encode($result),
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Dashboard', $data);
|
||||
|
|
@ -76,33 +79,31 @@ class EventDashboardController extends MyBaseController {
|
|||
|
||||
/**
|
||||
* @param $chartData
|
||||
* @param bool|FALSE $from_date
|
||||
* @param bool|FALSE $toDate
|
||||
* @param bool|false $from_date
|
||||
* @param bool|false $toDate
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function generateChartJson($chartData, $from_date = FALSE, $toDate = FALSE) {
|
||||
|
||||
public function generateChartJson($chartData, $from_date = false, $toDate = false)
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$startdate = '2014-10-1';
|
||||
$enddate = '2014-11-7';
|
||||
$enddate = '2014-11-7';
|
||||
$timestamp = strtotime($startdate);
|
||||
while ($startdate <= $enddate) {
|
||||
|
||||
$startdate = date('Y-m-d', $timestamp);
|
||||
|
||||
$data[] = [
|
||||
'date' => $startdate,
|
||||
'date' => $startdate,
|
||||
'tickets_sold' => rand(0, 7),
|
||||
'views' => rand(0, 5),
|
||||
'unique_views' => rand(0, 5)
|
||||
'views' => rand(0, 5),
|
||||
'unique_views' => rand(0, 5),
|
||||
];
|
||||
|
||||
|
||||
$timestamp = strtotime('+1 days', strtotime($startdate));
|
||||
}
|
||||
|
||||
return json_encode($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,28 +2,25 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use DB,
|
||||
Response,
|
||||
Input,
|
||||
View,
|
||||
Exception,
|
||||
Validator,
|
||||
Log,
|
||||
Mail;
|
||||
use Excel;
|
||||
use Bugsnag;
|
||||
use Stripe,
|
||||
Stripe_Charge;
|
||||
use App\Models\Attendee;
|
||||
use App\Models\Event;
|
||||
use App\Models\Order;
|
||||
use App\Models\Attendee;
|
||||
use DB;
|
||||
use Excel;
|
||||
use Exception;
|
||||
use Input;
|
||||
use Log;
|
||||
use Mail;
|
||||
use Response;
|
||||
use Stripe;
|
||||
use Stripe_Charge;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class EventOrdersController extends MyBaseController
|
||||
{
|
||||
|
||||
public function showOrders($event_id = '')
|
||||
{
|
||||
|
||||
$allowed_sorts = ['first_name', 'email', 'order_reference', 'order_status_id', 'created_at'];
|
||||
|
||||
$searchQuery = Input::get('q');
|
||||
|
|
@ -44,10 +41,10 @@ class EventOrdersController extends MyBaseController
|
|||
|
||||
$orders = $event->orders()
|
||||
->where(function ($query) use ($searchQuery) {
|
||||
$query->where('order_reference', 'like', $searchQuery . '%')
|
||||
->orWhere('first_name', 'like', $searchQuery . '%')
|
||||
->orWhere('email', 'like', $searchQuery . '%')
|
||||
->orWhere('last_name', 'like', $searchQuery . '%');
|
||||
$query->where('order_reference', 'like', $searchQuery.'%')
|
||||
->orWhere('first_name', 'like', $searchQuery.'%')
|
||||
->orWhere('email', 'like', $searchQuery.'%')
|
||||
->orWhere('last_name', 'like', $searchQuery.'%');
|
||||
})
|
||||
->orderBy($sort_by, $sort_order)
|
||||
->paginate();
|
||||
|
|
@ -56,11 +53,11 @@ class EventOrdersController extends MyBaseController
|
|||
}
|
||||
|
||||
$data = [
|
||||
'orders' => $orders,
|
||||
'event' => $event,
|
||||
'sort_by' => $sort_by,
|
||||
'orders' => $orders,
|
||||
'event' => $event,
|
||||
'sort_by' => $sort_by,
|
||||
'sort_order' => $sort_order,
|
||||
'q' => $searchQuery ? $searchQuery : ''
|
||||
'q' => $searchQuery ? $searchQuery : '',
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Orders', $data);
|
||||
|
|
@ -68,9 +65,8 @@ class EventOrdersController extends MyBaseController
|
|||
|
||||
public function manageOrder($order_id)
|
||||
{
|
||||
|
||||
$data = [
|
||||
'order' => Order::scope()->find($order_id),
|
||||
'order' => Order::scope()->find($order_id),
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
];
|
||||
|
||||
|
|
@ -82,10 +78,10 @@ class EventOrdersController extends MyBaseController
|
|||
$order = Order::scope()->find($order_id);
|
||||
|
||||
$data = [
|
||||
'order' => $order,
|
||||
'event' => $order->event(),
|
||||
'order' => $order,
|
||||
'event' => $order->event(),
|
||||
'attendees' => $order->attendees()->withoutCancelled()->get(),
|
||||
'modal_id' => Input::get('modal_id')
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Modals.CancelOrder', $data);
|
||||
|
|
@ -93,13 +89,13 @@ class EventOrdersController extends MyBaseController
|
|||
|
||||
/**
|
||||
* @param $order_id
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function postCancelOrder($order_id)
|
||||
{
|
||||
|
||||
$rules = [
|
||||
'refund_amount' => ['numeric']
|
||||
'refund_amount' => ['numeric'],
|
||||
];
|
||||
$messages = [
|
||||
'refund_amount.integer' => 'Refund amount must only contain numbers.',
|
||||
|
|
@ -108,22 +104,20 @@ class EventOrdersController extends MyBaseController
|
|||
$validator = Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$order = Order::scope()->findOrFail($order_id);
|
||||
$refund_order = (Input::get('refund_order') === 'on') ? TRUE : FALSE;
|
||||
$refund_order = (Input::get('refund_order') === 'on') ? true : false;
|
||||
$refund_type = Input::get('refund_type');
|
||||
$refund_amount = Input::get('refund_amount');
|
||||
$attendees = Input::get('attendees');
|
||||
$error_message = FALSE;
|
||||
|
||||
$error_message = false;
|
||||
|
||||
if ($refund_order) {
|
||||
|
||||
if (!$order->transaction_id) {
|
||||
$error_message = 'Sorry, this order cannot be refunded.';
|
||||
}
|
||||
|
|
@ -133,20 +127,18 @@ class EventOrdersController extends MyBaseController
|
|||
} elseif ($order->organiser_amount == 0) {
|
||||
$error_message = 'Nothing to refund';
|
||||
} elseif ($refund_amount > ($order->organiser_amount - $order->amount_refunded)) {
|
||||
$error_message = 'The maximum amount you can refund is ' . (money($order->organiser_amount - $order->amount_refunded, $order->event->currency->code));
|
||||
$error_message = 'The maximum amount you can refund is '.(money($order->organiser_amount - $order->amount_refunded, $order->event->currency->code));
|
||||
}
|
||||
if (!$error_message) {
|
||||
try {
|
||||
|
||||
Stripe::setApiKey($order->account->stripe_api_key);
|
||||
$charge = Stripe_Charge::retrieve($order->transaction_id);
|
||||
|
||||
|
||||
if ($refund_type === 'full') { /* Full refund */
|
||||
|
||||
$refund_amount = $order->organiser_amount - $order->amount_refunded;
|
||||
$refund = $charge->refund([
|
||||
'refund_application_fee' => floatval($order->booking_fee) > 0 ? true : false
|
||||
'refund_application_fee' => floatval($order->booking_fee) > 0 ? true : false,
|
||||
]);
|
||||
|
||||
/* Update the event sales volume*/
|
||||
|
|
@ -155,14 +147,11 @@ class EventOrdersController extends MyBaseController
|
|||
$order->is_refunded = 1;
|
||||
$order->amount_refunded = $order->organiser_amount;
|
||||
$order->order_status_id = config('attendize.order_refunded');
|
||||
|
||||
|
||||
|
||||
} else { /* Partial refund */
|
||||
|
||||
$refund = $charge->refund([
|
||||
'amount' => $refund_amount * 100,
|
||||
'refund_application_fee' => floatval($order->booking_fee) > 0 ? true : false
|
||||
'amount' => $refund_amount * 100,
|
||||
'refund_application_fee' => floatval($order->booking_fee) > 0 ? true : false,
|
||||
]);
|
||||
|
||||
/* Update the event sales volume*/
|
||||
|
|
@ -179,8 +168,6 @@ class EventOrdersController extends MyBaseController
|
|||
}
|
||||
$order->amount_refunded = round($refund->amount_refunded / 100, 2);
|
||||
$order->save();
|
||||
|
||||
|
||||
} catch (\Stripe_InvalidRequestError $e) {
|
||||
Log::error($e);
|
||||
$error_message = 'There has been a problem processing your refund. Please check your information and try again.';
|
||||
|
|
@ -201,8 +188,8 @@ class EventOrdersController extends MyBaseController
|
|||
|
||||
if ($error_message) {
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'message' => $error_message
|
||||
'status' => 'success',
|
||||
'message' => $error_message,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -219,11 +206,11 @@ class EventOrdersController extends MyBaseController
|
|||
}
|
||||
|
||||
\Session::flash('message',
|
||||
(!$refund_amount && !$attendees) ? 'Nothing To Do' : "Successfully " . ($refund_order ? " Refunded Order" : " ") . ($attendees && $refund_order ? ' & ' : '') . ($attendees ? "Cancelled Attendee(s)" : ""));
|
||||
(!$refund_amount && !$attendees) ? 'Nothing To Do' : 'Successfully '.($refund_order ? ' Refunded Order' : ' ').($attendees && $refund_order ? ' & ' : '').($attendees ? 'Cancelled Attendee(s)' : ''));
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'redirectUrl' => ''
|
||||
'status' => 'success',
|
||||
'redirectUrl' => '',
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -233,12 +220,11 @@ class EventOrdersController extends MyBaseController
|
|||
*/
|
||||
public function showExportOrders($event_id, $export_as = 'xls')
|
||||
{
|
||||
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
Excel::create('orders-as-of-' . date('d-m-Y-g.i.a'), function ($excel) use ($event) {
|
||||
Excel::create('orders-as-of-'.date('d-m-Y-g.i.a'), function ($excel) use ($event) {
|
||||
|
||||
$excel->setTitle('Orders For Event: ' . $event->title);
|
||||
$excel->setTitle('Orders For Event: '.$event->title);
|
||||
|
||||
// Chain the setters
|
||||
$excel->setCreator(config('attendize.app_name'))
|
||||
|
|
@ -259,15 +245,15 @@ class EventOrdersController extends MyBaseController
|
|||
\DB::raw("(CASE WHEN orders.is_refunded = 1 THEN 'YES' ELSE 'NO' END) AS `orders.is_refunded`"),
|
||||
\DB::raw("(CASE WHEN orders.is_partially_refunded = 1 THEN 'YES' ELSE 'NO' END) AS `orders.is_partially_refunded`"),
|
||||
'orders.amount_refunded',
|
||||
'orders.created_at'
|
||||
'orders.created_at',
|
||||
])->get();
|
||||
//DB::raw("(CASE WHEN UNIX_TIMESTAMP(`attendees.arrival_time`) = 0 THEN '---' ELSE 'd' END) AS `attendees.arrival_time`"))
|
||||
|
||||
$sheet->fromArray($data);
|
||||
|
||||
$sheet->row(1, array(
|
||||
'First Name', 'Last Name', 'Email', 'Order Reference', 'Amount', 'Fully Refunded', 'Partially Refunded', 'Amount Refunded', 'Order Date'
|
||||
));
|
||||
$sheet->row(1, [
|
||||
'First Name', 'Last Name', 'Email', 'Order Reference', 'Amount', 'Fully Refunded', 'Partially Refunded', 'Amount Refunded', 'Order Date',
|
||||
]);
|
||||
|
||||
// Set gray background on first row
|
||||
$sheet->row(1, function ($row) {
|
||||
|
|
@ -279,12 +265,11 @@ class EventOrdersController extends MyBaseController
|
|||
|
||||
public function showMessageOrder($order_id)
|
||||
{
|
||||
|
||||
$order = Order::scope()->findOrFail($order_id);
|
||||
|
||||
$data = [
|
||||
'order' => $order,
|
||||
'event' => $order->event,
|
||||
'order' => $order,
|
||||
'event' => $order->event,
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
];
|
||||
|
||||
|
|
@ -293,29 +278,28 @@ class EventOrdersController extends MyBaseController
|
|||
|
||||
public function postMessageOrder($order_id)
|
||||
{
|
||||
|
||||
$rules = [
|
||||
'subject' => 'required|max:250',
|
||||
'message' => 'required|max:5000'
|
||||
'message' => 'required|max:5000',
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$order = Attendee::scope()->findOrFail($order_id);
|
||||
|
||||
$data = [
|
||||
'order' => $order,
|
||||
'order' => $order,
|
||||
'message_content' => Input::get('message'),
|
||||
'subject' => Input::get('subject'),
|
||||
'event' => $order->event,
|
||||
'email_logo' => $order->event->organiser->full_logo_path
|
||||
'subject' => Input::get('subject'),
|
||||
'event' => $order->event,
|
||||
'email_logo' => $order->event->organiser->full_logo_path,
|
||||
];
|
||||
|
||||
Mail::send('Emails.messageOrder', $data, function ($message) use ($order, $data) {
|
||||
|
|
@ -331,15 +315,13 @@ class EventOrdersController extends MyBaseController
|
|||
$message->to($order->event->organiser->email)
|
||||
->from(config('attendize.outgoing_email_noreply'), $order->event->organiser->name)
|
||||
->replyTo($order->event->organiser->email, $order->event->organiser->name)
|
||||
->subject($data['subject'] . ' [Organiser copy]');
|
||||
->subject($data['subject'].' [Organiser copy]');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'message' => 'Message Successfully Sent'
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'message' => 'Message Successfully Sent',
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
class EventPromoteController extends MyBaseController {
|
||||
|
||||
public function showPromote($event_id) {
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
class EventPromoteController extends MyBaseController
|
||||
{
|
||||
public function showPromote($event_id)
|
||||
{
|
||||
$data = [
|
||||
'event' => Event::scope()->find($event_id)
|
||||
'event' => Event::scope()->find($event_id),
|
||||
];
|
||||
|
||||
|
||||
return View::make('ManageEvent.Promote', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,49 +1,43 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
class EventTicketQuestionsController extends MyBaseController {
|
||||
|
||||
|
||||
public function showQuestions($event_id) {
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
class EventTicketQuestionsController extends MyBaseController
|
||||
{
|
||||
public function showQuestions($event_id)
|
||||
{
|
||||
$data = [
|
||||
'event' => Event::scope()->findOrFail($event_id),
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'question_types' => QuestionType::all()
|
||||
'event' => Event::scope()->findOrFail($event_id),
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'question_types' => QuestionType::all(),
|
||||
];
|
||||
|
||||
|
||||
return View::make('ManageEvent.Modals.ViewQuestions', $data);
|
||||
}
|
||||
|
||||
|
||||
public function postCreateQuestion($event_id) {
|
||||
|
||||
|
||||
public function postCreateQuestion($event_id)
|
||||
{
|
||||
$event = Event::findOrFail($event_id);
|
||||
|
||||
$question = Question::createNew(FALSE, FALSE, TRUE);
|
||||
|
||||
$question = Question::createNew(false, false, true);
|
||||
$question->title = Input::get('title');
|
||||
$question->instructions = Input::get('instructions');
|
||||
$question->options = Input::get('options');
|
||||
$question->is_required = Input::get('title');
|
||||
$question->question_type_id = Input::get('question_type_id');
|
||||
$question->save();
|
||||
|
||||
|
||||
|
||||
|
||||
$ticket_ids = Input::get('tickets');
|
||||
|
||||
foreach($ticket_ids as $ticket_id) {
|
||||
|
||||
foreach ($ticket_ids as $ticket_id) {
|
||||
Ticket::scope()->find($ticket_id)->questions()->attach($question->id);
|
||||
}
|
||||
|
||||
|
||||
$event->questions()->attach($question->id);
|
||||
|
||||
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'message' => 'Successfully Created Question'
|
||||
'status' => 'success',
|
||||
'message' => 'Successfully Created Question',
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,76 +1,79 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Input, View, Response, Log;
|
||||
use App\Models\Event;
|
||||
use App\Models\Ticket;
|
||||
use Carbon\Carbon;
|
||||
use Input;
|
||||
use Log;
|
||||
use Response;
|
||||
use View;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
class EventTicketsController extends MyBaseController {
|
||||
|
||||
public function showTickets($event_id) {
|
||||
|
||||
class EventTicketsController extends MyBaseController
|
||||
{
|
||||
public function showTickets($event_id)
|
||||
{
|
||||
$allowed_sorts = ['created_at', 'quantity_sold', 'sales_volume', 'title'];
|
||||
|
||||
$searchQuery = Input::get('q');
|
||||
$sort_by = (in_array(Input::get('sort_by'), $allowed_sorts) ? Input::get('sort_by') : 'created_at');
|
||||
|
||||
|
||||
$event = Event::scope()->findOrFail($event_id);
|
||||
|
||||
$tickets = $searchQuery
|
||||
? $event->tickets()->where('title', 'like', '%' . $searchQuery . '%')->orderBy($sort_by, 'desc')->paginate(10)
|
||||
$tickets = $searchQuery
|
||||
? $event->tickets()->where('title', 'like', '%'.$searchQuery.'%')->orderBy($sort_by, 'desc')->paginate(10)
|
||||
: $event->tickets()->orderBy($sort_by, 'desc')->paginate(10);
|
||||
|
||||
|
||||
$data = [
|
||||
'event' => $event,
|
||||
'event' => $event,
|
||||
'tickets' => $tickets,
|
||||
'sort_by' => $sort_by,
|
||||
'q' => $searchQuery ? $searchQuery : ''
|
||||
'q' => $searchQuery ? $searchQuery : '',
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Tickets', $data);
|
||||
}
|
||||
|
||||
public function showEditTicket($event_id, $ticket_id) {
|
||||
|
||||
public function showEditTicket($event_id, $ticket_id)
|
||||
{
|
||||
$data = [
|
||||
'event' => Event::scope()->find($event_id),
|
||||
'ticket' => Ticket::scope()->find($ticket_id),
|
||||
'event' => Event::scope()->find($event_id),
|
||||
'ticket' => Ticket::scope()->find($ticket_id),
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
];
|
||||
|
||||
return View::make('ManageEvent.Modals.EditTicket', $data);
|
||||
}
|
||||
|
||||
public function showCreateTicket($event_id) {
|
||||
return View::make('ManageEvent.Modals.CreateTicket', array(
|
||||
public function showCreateTicket($event_id)
|
||||
{
|
||||
return View::make('ManageEvent.Modals.CreateTicket', [
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'event' => Event::find($event_id)
|
||||
));
|
||||
'event' => Event::find($event_id),
|
||||
]);
|
||||
}
|
||||
|
||||
public function postCreateTicket($event_id) {
|
||||
|
||||
public function postCreateTicket($event_id)
|
||||
{
|
||||
$ticket = Ticket::createNew();
|
||||
|
||||
if (!$ticket->validate(Input::all())) {
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $ticket->errors()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $ticket->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
$ticket->event_id = $event_id;
|
||||
$ticket->title = Input::get('title');
|
||||
$ticket->quantity_available = !Input::get('quantity_available') ? NULL : Input::get('quantity_available');
|
||||
$ticket->start_sale_date = Input::get('start_sale_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_sale_date')) : NULL;
|
||||
$ticket->end_sale_date = Input::get('end_sale_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_sale_date')) : NULL;
|
||||
$ticket->quantity_available = !Input::get('quantity_available') ? null : Input::get('quantity_available');
|
||||
$ticket->start_sale_date = Input::get('start_sale_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_sale_date')) : null;
|
||||
$ticket->end_sale_date = Input::get('end_sale_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_sale_date')) : null;
|
||||
$ticket->price = Input::get('price');
|
||||
$ticket->min_per_person = Input::get('min_per_person');
|
||||
$ticket->max_per_person = Input::get('max_per_person');
|
||||
|
|
@ -79,118 +82,114 @@ class EventTicketsController extends MyBaseController {
|
|||
|
||||
\Session::flash('message', 'Successfully Created Ticket');
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'id' => $ticket->id,
|
||||
'message' => 'Refreshing...',
|
||||
'redirectUrl' => route('showEventTickets', array(
|
||||
'event_id' => $event_id
|
||||
))
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'id' => $ticket->id,
|
||||
'message' => 'Refreshing...',
|
||||
'redirectUrl' => route('showEventTickets', [
|
||||
'event_id' => $event_id,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function postPauseTicket() {
|
||||
|
||||
public function postPauseTicket()
|
||||
{
|
||||
$ticket_id = Input::get('ticket_id');
|
||||
|
||||
$ticket = Ticket::scope()->find($ticket_id);
|
||||
|
||||
|
||||
$ticket->is_paused = ($ticket->is_paused == 1) ? 0 : 1;
|
||||
|
||||
|
||||
if ($ticket->save()) {
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'status' => 'success',
|
||||
'message' => 'Ticket Successfully Updated',
|
||||
'id' => $ticket->id
|
||||
'id' => $ticket->id,
|
||||
]);
|
||||
}
|
||||
|
||||
Log::error('Ticket Failed to pause/resume', [
|
||||
'ticket' => $ticket
|
||||
'ticket' => $ticket,
|
||||
]);
|
||||
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'id' => $ticket->id,
|
||||
'message' => 'Whoops!, looks like something went wrong. Please try again.'
|
||||
'status' => 'error',
|
||||
'id' => $ticket->id,
|
||||
'message' => 'Whoops!, looks like something went wrong. Please try again.',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
public function postDeleteTicket() {
|
||||
|
||||
public function postDeleteTicket()
|
||||
{
|
||||
$ticket_id = Input::get('ticket_id');
|
||||
|
||||
$ticket = Ticket::scope()->find($ticket_id);
|
||||
|
||||
if ($ticket->quantity_sold > 0) {
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'status' => 'error',
|
||||
'message' => 'Sorry, you can\'t delete this ticket as some have already been sold',
|
||||
'id' => $ticket->id
|
||||
'id' => $ticket->id,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($ticket->delete()) {
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'status' => 'success',
|
||||
'message' => 'Ticket Successfully Deleted',
|
||||
'id' => $ticket->id
|
||||
'id' => $ticket->id,
|
||||
]);
|
||||
}
|
||||
|
||||
Log::error('Ticket Failed to delete', [
|
||||
'ticket' => $ticket
|
||||
'ticket' => $ticket,
|
||||
]);
|
||||
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'id' => $ticket->id,
|
||||
'message' => 'Whoops!, looks like something went wrong. Please try again.'
|
||||
'status' => 'error',
|
||||
'id' => $ticket->id,
|
||||
'message' => 'Whoops!, looks like something went wrong. Please try again.',
|
||||
]);
|
||||
}
|
||||
|
||||
public function postEditTicket($event_id, $ticket_id) {
|
||||
|
||||
public function postEditTicket($event_id, $ticket_id)
|
||||
{
|
||||
$ticket = Ticket::findOrFail($ticket_id);
|
||||
|
||||
/*
|
||||
* Override some vaidation rules
|
||||
*/
|
||||
$validation_rules['quantity_available'] = ['integer','min:'.($ticket->quantity_sold + $ticket->quantity_reserved)];
|
||||
$validation_rules['quantity_available'] = ['integer', 'min:'.($ticket->quantity_sold + $ticket->quantity_reserved)];
|
||||
$validation_messages['quantity_available.min'] = 'Quantity available can\'t be less the amount sold or reserved.';
|
||||
|
||||
|
||||
$ticket->rules = $validation_rules + $ticket->rules;
|
||||
$ticket->messages = $validation_messages + $ticket->messages;
|
||||
|
||||
|
||||
if (!$ticket->validate(Input::all())) {
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $ticket->errors()
|
||||
));
|
||||
if (!$ticket->validate(Input::all())) {
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $ticket->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
$ticket->title = Input::get('title');
|
||||
$ticket->quantity_available = !Input::get('quantity_available') ? NULL : Input::get('quantity_available');
|
||||
$ticket->quantity_available = !Input::get('quantity_available') ? null : Input::get('quantity_available');
|
||||
$ticket->price = Input::get('price');
|
||||
$ticket->start_sale_date = Input::get('start_sale_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_sale_date')) : NULL;
|
||||
$ticket->end_sale_date = Input::get('end_sale_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_sale_date')) : NULL;
|
||||
$ticket->start_sale_date = Input::get('start_sale_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('start_sale_date')) : null;
|
||||
$ticket->end_sale_date = Input::get('end_sale_date') ? Carbon::createFromFormat('d-m-Y H:i', Input::get('end_sale_date')) : null;
|
||||
$ticket->description = Input::get('description');
|
||||
$ticket->min_per_person = Input::get('min_per_person');
|
||||
$ticket->max_per_person = Input::get('max_per_person');
|
||||
|
||||
|
||||
$ticket->save();
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'id' => $ticket->id,
|
||||
'message' => 'Refreshing...',
|
||||
'redirectUrl' => route('showEventTickets', array(
|
||||
'event_id' => $event_id
|
||||
))
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'id' => $ticket->id,
|
||||
'message' => 'Refreshing...',
|
||||
'redirectUrl' => route('showEventTickets', [
|
||||
'event_id' => $event_id,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,38 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Input, View, Cookie, Mail, Validator, Response, Auth;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Event;
|
||||
use App\Models\Affiliate;
|
||||
use App\Models\Event;
|
||||
use App\Models\EventStats;
|
||||
|
||||
use Auth;
|
||||
use Cookie;
|
||||
use Input;
|
||||
use Mail;
|
||||
use Response;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class EventViewController extends Controller
|
||||
{
|
||||
|
||||
public function showEventHome($event_id, $slug = '', $preview = FALSE)
|
||||
public function showEventHome($event_id, $slug = '', $preview = false)
|
||||
{
|
||||
|
||||
$event = Event::findOrFail($event_id);
|
||||
|
||||
if(!Auth::check() && !$event->is_live) {
|
||||
if (!Auth::check() && !$event->is_live) {
|
||||
return View::make('Public.ViewEvent.EventNotLivePage');
|
||||
}
|
||||
|
||||
$data = [
|
||||
'event' => $event,
|
||||
'tickets' => $event->tickets()->orderBy('created_at', 'desc')->get(),
|
||||
'is_embedded' => 0
|
||||
'event' => $event,
|
||||
'tickets' => $event->tickets()->orderBy('created_at', 'desc')->get(),
|
||||
'is_embedded' => 0,
|
||||
];
|
||||
/*
|
||||
* Don't record stats if we're previewing the event page from the backend or if we own the event.
|
||||
*/
|
||||
if (!$preview || !Auth::check()) {
|
||||
|
||||
$event_stats = new EventStats;
|
||||
$event_stats = new EventStats();
|
||||
$event_stats->updateViewCount($event_id);
|
||||
}
|
||||
|
||||
|
|
@ -37,13 +40,12 @@ class EventViewController extends Controller
|
|||
* See if there is an affiliate referral in the URL
|
||||
*/
|
||||
if ($affiliate_ref = \Input::get('ref')) {
|
||||
|
||||
$affiliate_ref = preg_replace("/\W|_/", '', $affiliate_ref);
|
||||
|
||||
if ($affiliate_ref) {
|
||||
$affiliate = Affiliate::firstOrNew([
|
||||
'name' => Input::get('ref'),
|
||||
'event_id' => $event_id,
|
||||
'name' => Input::get('ref'),
|
||||
'event_id' => $event_id,
|
||||
'account_id' => $event->account_id,
|
||||
]);
|
||||
|
||||
|
|
@ -51,7 +53,7 @@ class EventViewController extends Controller
|
|||
|
||||
$affiliate->save();
|
||||
|
||||
Cookie::queue('affiliate_' . $event_id, $affiliate_ref, 60 * 24 * 60);
|
||||
Cookie::queue('affiliate_'.$event_id, $affiliate_ref, 60 * 24 * 60);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -60,50 +62,45 @@ class EventViewController extends Controller
|
|||
|
||||
public function showEventHomePreview($event_id)
|
||||
{
|
||||
return showEventHome($event_id, TRUE);
|
||||
return showEventHome($event_id, true);
|
||||
}
|
||||
|
||||
|
||||
public function postContactOrganiser($event_id)
|
||||
{
|
||||
|
||||
$rules = [
|
||||
'name' => 'required',
|
||||
'email' => ['required', 'email'],
|
||||
'message' => ['required']
|
||||
'name' => 'required',
|
||||
'email' => ['required', 'email'],
|
||||
'message' => ['required'],
|
||||
];
|
||||
|
||||
$validator = Validator::make(Input::all(), $rules);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validator->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$event = Event::findOrFail($event_id);
|
||||
|
||||
$data = [
|
||||
'sender_name' => Input::get('name'),
|
||||
'sender_email' => Input::get('email'),
|
||||
'sender_name' => Input::get('name'),
|
||||
'sender_email' => Input::get('email'),
|
||||
'message_content' => strip_tags(Input::get('message')),
|
||||
'event' => $event
|
||||
'event' => $event,
|
||||
];
|
||||
|
||||
Mail::send('Emails.messageOrganiser', $data, function ($message) use ($event, $data) {
|
||||
$message->to($event->organiser->email, $event->organiser->name)
|
||||
->from(config('attendize.outgoing_email_noreply'), $data['sender_name'])
|
||||
->replyTo($data['sender_email'], $data['sender_name'])
|
||||
->subject('Message Regarding: ' . $event->title);
|
||||
->subject('Message Regarding: '.$event->title);
|
||||
});
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'message' => 'Message Successfully Sent'
|
||||
));
|
||||
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'message' => 'Message Successfully Sent',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,23 +1,22 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use View;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Event;
|
||||
use View;
|
||||
|
||||
|
||||
class EventViewEmbeddedController extends Controller {
|
||||
|
||||
public function showEmbeddedEvent($event_id) {
|
||||
|
||||
class EventViewEmbeddedController extends Controller
|
||||
{
|
||||
public function showEmbeddedEvent($event_id)
|
||||
{
|
||||
$event = Event::findOrFail($event_id);
|
||||
|
||||
$data = [
|
||||
'event' => $event,
|
||||
'tickets' => $event->tickets()->orderBy('created_at', 'desc')->get(),
|
||||
'is_embedded' => '1'
|
||||
'event' => $event,
|
||||
'tickets' => $event->tickets()->orderBy('created_at', 'desc')->get(),
|
||||
'is_embedded' => '1',
|
||||
];
|
||||
|
||||
return View::make('Public.ViewEvent.Embedded.EventPage', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
class ImageController extends Controller {
|
||||
|
||||
public function generateThumbnail($image_src, $width = FALSE, $height = false, $quality = 90) {
|
||||
class ImageController extends Controller
|
||||
{
|
||||
public function generateThumbnail($image_src, $width = false, $height = false, $quality = 90)
|
||||
{
|
||||
$img = Image::make('public/foo.jpg');
|
||||
|
||||
$img->resize(320, 240);
|
||||
|
|
@ -13,5 +14,4 @@ class ImageController extends Controller {
|
|||
|
||||
$img->save('public/bar.jpg');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,23 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
use View;
|
||||
use Response;
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Timezone;
|
||||
use Artisan;
|
||||
use Config;
|
||||
use DB;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Artisan;
|
||||
use DB;
|
||||
use File;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Timezone;
|
||||
|
||||
use Response;
|
||||
use View;
|
||||
|
||||
class InstallerController extends Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if(file_exists(base_path('installed'))) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
if (file_exists(base_path('installed'))) {
|
||||
abort(403, 'Unauthorized action.');
|
||||
}
|
||||
}
|
||||
|
||||
public function showInstaller()
|
||||
|
|
@ -29,14 +27,14 @@ class InstallerController extends Controller
|
|||
storage_path('framework'),
|
||||
storage_path('logs'),
|
||||
public_path('user_content'),
|
||||
base_path('.env')
|
||||
base_path('.env'),
|
||||
];
|
||||
$data['requirements'] = [
|
||||
'openssl',
|
||||
'pdo',
|
||||
'mbstring',
|
||||
'fileinfo',
|
||||
'tokenizer'
|
||||
'tokenizer',
|
||||
];
|
||||
|
||||
return View::make('Installer.Installer', $data);
|
||||
|
|
@ -65,78 +63,74 @@ class InstallerController extends Controller
|
|||
$app_key = str_random(16);
|
||||
$version = file_get_contents(base_path('VERSION'));
|
||||
|
||||
|
||||
if (Input::get('test') === 'db') {
|
||||
|
||||
$is_db_valid = self::testDatabase($database);
|
||||
|
||||
if ($is_db_valid === 'yes') {
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'status' => 'success',
|
||||
'message' => 'Success, Your connection works!',
|
||||
'test' => 1
|
||||
'test' => 1,
|
||||
]);
|
||||
}
|
||||
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'status' => 'error',
|
||||
'message' => 'Unable to connect! Please check your settings',
|
||||
'test' => 1
|
||||
'test' => 1,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
$config = "APP_ENV=production\n" .
|
||||
"APP_DEBUG=false\n" .
|
||||
"APP_URL={$app_url}\n" .
|
||||
"APP_KEY={$app_key}\n\n" .
|
||||
"DB_TYPE=mysql\n" .
|
||||
"DB_HOST={$database['host']}\n" .
|
||||
"DB_DATABASE={$database['name']}\n" .
|
||||
"DB_USERNAME={$database['username']}\n" .
|
||||
"DB_PASSWORD={$database['password']}\n\n" .
|
||||
"MAIL_DRIVER={$mail['driver']}\n" .
|
||||
"MAIL_PORT={$mail['port']}\n" .
|
||||
"MAIL_ENCRYPTION={$mail['encryption']}\n" .
|
||||
"MAIL_HOST={$mail['host']}\n" .
|
||||
"MAIL_USERNAME={$mail['username']}\n" .
|
||||
"MAIL_FROM_NAME={$mail['from_name']}\n" .
|
||||
"MAIL_FROM_ADDRESS={$mail['from_address']}\n" .
|
||||
$config = "APP_ENV=production\n".
|
||||
"APP_DEBUG=false\n".
|
||||
"APP_URL={$app_url}\n".
|
||||
"APP_KEY={$app_key}\n\n".
|
||||
"DB_TYPE=mysql\n".
|
||||
"DB_HOST={$database['host']}\n".
|
||||
"DB_DATABASE={$database['name']}\n".
|
||||
"DB_USERNAME={$database['username']}\n".
|
||||
"DB_PASSWORD={$database['password']}\n\n".
|
||||
"MAIL_DRIVER={$mail['driver']}\n".
|
||||
"MAIL_PORT={$mail['port']}\n".
|
||||
"MAIL_ENCRYPTION={$mail['encryption']}\n".
|
||||
"MAIL_HOST={$mail['host']}\n".
|
||||
"MAIL_USERNAME={$mail['username']}\n".
|
||||
"MAIL_FROM_NAME={$mail['from_name']}\n".
|
||||
"MAIL_FROM_ADDRESS={$mail['from_address']}\n".
|
||||
"MAIL_PASSWORD={$mail['password']}\n\n";
|
||||
|
||||
$fp = fopen(base_path()."/.env", 'w');
|
||||
$fp = fopen(base_path().'/.env', 'w');
|
||||
fwrite($fp, $config);
|
||||
fclose($fp);
|
||||
|
||||
Config::set('database.default', $database['type']);
|
||||
Config::set("database.connections.mysql.host", $database['host']);
|
||||
Config::set("database.connections.mysql.database", $database['name']);
|
||||
Config::set("database.connections.mysql.username", $database['username']);
|
||||
Config::set("database.connections.mysql.password", $database['password']);
|
||||
Config::set('database.connections.mysql.host', $database['host']);
|
||||
Config::set('database.connections.mysql.database', $database['name']);
|
||||
Config::set('database.connections.mysql.username', $database['username']);
|
||||
Config::set('database.connections.mysql.password', $database['password']);
|
||||
|
||||
DB::reconnect();
|
||||
|
||||
Artisan::call('migrate', array('--force' => true));
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
if (Timezone::count() == 0) {
|
||||
Artisan::call('db:seed', array('--force' => true));
|
||||
Artisan::call('db:seed', ['--force' => true]);
|
||||
}
|
||||
Artisan::call('optimize', array('--force' => true));
|
||||
Artisan::call('optimize', ['--force' => true]);
|
||||
|
||||
$fp = fopen(base_path()."/installed", 'w');
|
||||
$fp = fopen(base_path().'/installed', 'w');
|
||||
fwrite($fp, $version);
|
||||
fclose($fp);
|
||||
|
||||
return Redirect::route('showSignup',['first_run' => 'yup']);
|
||||
return Redirect::route('showSignup', ['first_run' => 'yup']);
|
||||
}
|
||||
|
||||
|
||||
private function testDatabase($database)
|
||||
{
|
||||
Config::set('database.default', $database['type']);
|
||||
Config::set("database.connections.mysql.host", $database['host']);
|
||||
Config::set("database.connections.mysql.database", $database['name']);
|
||||
Config::set("database.connections.mysql.username", $database['username']);
|
||||
Config::set("database.connections.mysql.password", $database['password']);
|
||||
Config::set('database.connections.mysql.host', $database['host']);
|
||||
Config::set('database.connections.mysql.database', $database['name']);
|
||||
Config::set('database.connections.mysql.username', $database['username']);
|
||||
Config::set('database.connections.mysql.password', $database['password']);
|
||||
|
||||
try {
|
||||
DB::reconnect();
|
||||
|
|
@ -144,8 +138,7 @@ class InstallerController extends Controller
|
|||
} catch (Exception $e) {
|
||||
return $e->getMessage();
|
||||
}
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,35 +2,34 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Input,
|
||||
Response,
|
||||
View,
|
||||
Auth;
|
||||
use HttpClient;
|
||||
use App\Models\Account;
|
||||
use App\Models\Timezone;
|
||||
use App\Models\Currency;
|
||||
use App\Models\Timezone;
|
||||
use App\Models\User;
|
||||
use Auth;
|
||||
use HttpClient;
|
||||
use Input;
|
||||
use Response;
|
||||
use View;
|
||||
|
||||
|
||||
class ManageAccountController extends MyBaseController {
|
||||
|
||||
public function showEditAccount() {
|
||||
|
||||
class ManageAccountController extends MyBaseController
|
||||
{
|
||||
public function showEditAccount()
|
||||
{
|
||||
$data = [
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'account' => Account::find(Auth::user()->account_id),
|
||||
'timezones' => Timezone::lists('location', 'id'),
|
||||
'currencies' => Currency::lists('title', 'id')
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'account' => Account::find(Auth::user()->account_id),
|
||||
'timezones' => Timezone::lists('location', 'id'),
|
||||
'currencies' => Currency::lists('title', 'id'),
|
||||
];
|
||||
|
||||
return View::make('ManageAccount.Modals.EditAccount', $data);
|
||||
}
|
||||
|
||||
public function showStripeReturn() {
|
||||
public function showStripeReturn()
|
||||
{
|
||||
$error_message = 'There was an error connecting your Stripe account. Please try again.';
|
||||
|
||||
$error_message = "There was an error connecting your Stripe account. Please try again.";
|
||||
|
||||
if (Input::get('error') || !Input::get('code')) {
|
||||
//BugSnag::notifyError('Error Connecting to Stripe', Input::get('error'));
|
||||
\Session::flash('message', $error_message);
|
||||
|
|
@ -39,26 +38,26 @@ class ManageAccountController extends MyBaseController {
|
|||
}
|
||||
|
||||
$request = [
|
||||
'url' => 'https://connect.stripe.com/oauth/token',
|
||||
'url' => 'https://connect.stripe.com/oauth/token',
|
||||
'params' => [
|
||||
|
||||
'client_secret' => STRIPE_SECRET_KEY, //sk_test_iXk2Ky0DlhIcTcKMvsDa8iKI',
|
||||
'code' => Input::get('code'),
|
||||
'grant_type' => 'authorization_code'
|
||||
]
|
||||
'code' => Input::get('code'),
|
||||
'grant_type' => 'authorization_code',
|
||||
],
|
||||
];
|
||||
|
||||
$response = HttpClient::post($request);
|
||||
|
||||
$content = $response->json();
|
||||
|
||||
if(isset($content->error) || !isset($content->access_token)) {
|
||||
|
||||
if (isset($content->error) || !isset($content->access_token)) {
|
||||
//BugSnag::notifyError('Error Connecting to Stripe', Input::get('error'));
|
||||
\Session::flash('message', $error_message);
|
||||
|
||||
return redirect()->route('showEventsDashboard');
|
||||
}
|
||||
|
||||
|
||||
$account = Account::find(\Auth::user()->account_id);
|
||||
$account->stripe_access_token = $content->access_token;
|
||||
$account->stripe_refresh_token = $content->refresh_token;
|
||||
|
|
@ -66,19 +65,20 @@ class ManageAccountController extends MyBaseController {
|
|||
$account->stripe_data_raw = json_encode($content);
|
||||
$account->save();
|
||||
|
||||
\Session::flash('message', "You have successfully connected your Stripe account.");
|
||||
\Session::flash('message', 'You have successfully connected your Stripe account.');
|
||||
|
||||
return redirect()->route('showEventsDashboard');
|
||||
}
|
||||
|
||||
public function postEditAccount() {
|
||||
public function postEditAccount()
|
||||
{
|
||||
$account = Account::find(Auth::user()->account_id);
|
||||
|
||||
if (!$account->validate(Input::all())) {
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $account->errors()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $account->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
$account->first_name = Input::get('first_name');
|
||||
|
|
@ -88,14 +88,15 @@ class ManageAccountController extends MyBaseController {
|
|||
$account->currency_id = Input::get('currency_id');
|
||||
$account->save();
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'id' => $account->id,
|
||||
'message' => 'Account Successfully Updated'
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'id' => $account->id,
|
||||
'message' => 'Account Successfully Updated',
|
||||
]);
|
||||
}
|
||||
|
||||
public function postEditAccountPayment() {
|
||||
public function postEditAccountPayment()
|
||||
{
|
||||
$account = Account::find(Auth::user()->account_id);
|
||||
|
||||
$account->stripe_publishable_key = Input::get('stripe_publishable_key');
|
||||
|
|
@ -103,58 +104,56 @@ class ManageAccountController extends MyBaseController {
|
|||
|
||||
$account->save();
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'id' => $account->id,
|
||||
'message' => 'Payment Information Successfully Updated'
|
||||
));
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'id' => $account->id,
|
||||
'message' => 'Payment Information Successfully Updated',
|
||||
]);
|
||||
}
|
||||
|
||||
public function postInviteUser() {
|
||||
$rules = array(
|
||||
'email' => array('required', 'email', 'unique:users,email,NULL,id,account_id,'.Auth::user()->account_id),
|
||||
);
|
||||
|
||||
$messages = array(
|
||||
'email.email' => 'Please enter a valid E-mail address.',
|
||||
'email.required' => 'E-mail address is required.',
|
||||
'email.unique' => 'E-mail already in use for this account.',
|
||||
);
|
||||
|
||||
$validation = \Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validation->fails()) {
|
||||
return \Response::json([
|
||||
'status' => 'error',
|
||||
'messages'=> $validation->messages()->toArray()
|
||||
]);
|
||||
}
|
||||
|
||||
public function postInviteUser()
|
||||
{
|
||||
$rules = [
|
||||
'email' => ['required', 'email', 'unique:users,email,NULL,id,account_id,'.Auth::user()->account_id],
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'email.email' => 'Please enter a valid E-mail address.',
|
||||
'email.required' => 'E-mail address is required.',
|
||||
'email.unique' => 'E-mail already in use for this account.',
|
||||
];
|
||||
|
||||
$validation = \Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validation->fails()) {
|
||||
return \Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validation->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
$temp_password = str_random(8);
|
||||
|
||||
$user = new User;
|
||||
|
||||
$user = new User();
|
||||
$user->email = Input::get('email');
|
||||
$user->password = \Hash::make($temp_password);
|
||||
$user->account_id = Auth::user()->account_id;
|
||||
$user->save();
|
||||
|
||||
|
||||
$data = [
|
||||
'user' => $user,
|
||||
'user' => $user,
|
||||
'temp_password' => $temp_password,
|
||||
'inviter' => Auth::user()
|
||||
'inviter' => Auth::user(),
|
||||
];
|
||||
|
||||
\Mail::send('Emails.inviteUser', $data, function($message) use ($data) {
|
||||
|
||||
\Mail::send('Emails.inviteUser', $data, function ($message) use ($data) {
|
||||
$message->to($data['user']->email)
|
||||
->subject($data['inviter']->first_name.' '.$data['inviter']->last_name.' added you to an Attendize Ticketing account.');
|
||||
});
|
||||
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'message'=> 'Success! <b>'.$user->email.'</b> has been sent further instructions.'
|
||||
'status' => 'success',
|
||||
'message' => 'Success! <b>'.$user->email.'</b> has been sent further instructions.',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Attendize\Utils;
|
||||
|
||||
use App\Models\Organiser;
|
||||
use View;
|
||||
|
||||
class MyBaseController extends Controller {
|
||||
|
||||
|
||||
class MyBaseController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
View::share('organisers', Organiser::scope()->get());
|
||||
|
|
@ -19,7 +19,8 @@ class MyBaseController extends Controller {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function setupLayout() {
|
||||
protected function setupLayout()
|
||||
{
|
||||
if (!is_null($this->layout)) {
|
||||
$this->layout = View::make($this->layout);
|
||||
}
|
||||
|
|
@ -27,16 +28,16 @@ class MyBaseController extends Controller {
|
|||
|
||||
/**
|
||||
* Returns data which is required in each view, optionally combined with additional data.
|
||||
*
|
||||
* @param int $event_id
|
||||
*
|
||||
* @param int $event_id
|
||||
* @param array $additional_data
|
||||
*
|
||||
* @return arrau
|
||||
*/
|
||||
public function getEventViewData($event_id, $additional_data = array()) {
|
||||
return array_merge(array(
|
||||
'event' => Event::scope()->findOrFail($event_id)
|
||||
)
|
||||
, $additional_data);
|
||||
public function getEventViewData($event_id, $additional_data = [])
|
||||
{
|
||||
return array_merge([
|
||||
'event' => Event::scope()->findOrFail($event_id),
|
||||
], $additional_data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,80 +2,77 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Response,
|
||||
Input,
|
||||
Image,
|
||||
View;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\Organiser;
|
||||
use Image;
|
||||
use Input;
|
||||
use Response;
|
||||
use View;
|
||||
|
||||
class OrganiserController extends MyBaseController {
|
||||
|
||||
public function showSelectOragniser() {
|
||||
class OrganiserController extends MyBaseController
|
||||
{
|
||||
public function showSelectOragniser()
|
||||
{
|
||||
return View::make('ManageOrganiser.SelectOrganiser');
|
||||
}
|
||||
|
||||
public function showOrganiserDashboard($organiser_id = FALSE) {
|
||||
|
||||
$allowed_sorts = ['created_at', 'start_date', 'end_date', 'title'];
|
||||
public function showOrganiserDashboard($organiser_id = false)
|
||||
{
|
||||
$allowed_sorts = ['created_at', 'start_date', 'end_date', 'title'];
|
||||
|
||||
$searchQuery = Input::get('q');
|
||||
//$sort_order = Input::get('sort_order') == 'asc' ? 'asc' : 'desc';
|
||||
$sort_by = (in_array(Input::get('sort_by'), $allowed_sorts) ? Input::get('sort_by') : 'start_date');
|
||||
|
||||
$events = $searchQuery
|
||||
? Event::scope()->where('title', 'like', '%' . $searchQuery . '%')->orderBy($sort_by, 'desc')->where('organiser_id', '=', $organiser_id)->paginate(12)
|
||||
|
||||
$events = $searchQuery
|
||||
? Event::scope()->where('title', 'like', '%'.$searchQuery.'%')->orderBy($sort_by, 'desc')->where('organiser_id', '=', $organiser_id)->paginate(12)
|
||||
: Event::scope()->where('organiser_id', '=', $organiser_id)->orderBy($sort_by, 'desc')->paginate(12);
|
||||
|
||||
|
||||
$data = [
|
||||
'events' => $events,
|
||||
'organisers' => Organiser::scope()->orderBy('name')->get(),
|
||||
'events' => $events,
|
||||
'organisers' => Organiser::scope()->orderBy('name')->get(),
|
||||
'current_organiser' => Organiser::scope()->find($organiser_id),
|
||||
'q' => $searchQuery ? $searchQuery : '', //Redundant
|
||||
'search' => [
|
||||
'q' => $searchQuery ? $searchQuery : '',
|
||||
'sort_by' => $sort_by,
|
||||
'showPast' => Input::get('past')
|
||||
]
|
||||
'q' => $searchQuery ? $searchQuery : '', //Redundant
|
||||
'search' => [
|
||||
'q' => $searchQuery ? $searchQuery : '',
|
||||
'sort_by' => $sort_by,
|
||||
'showPast' => Input::get('past'),
|
||||
],
|
||||
];
|
||||
|
||||
return View::make('ManageEvents.OrganiserDashboard', $data);
|
||||
}
|
||||
|
||||
|
||||
public function showEditOrganiser($organiser_id) {
|
||||
|
||||
public function showEditOrganiser($organiser_id)
|
||||
{
|
||||
$organiser = Organiser::scope()->findOrfail($organiser_id);
|
||||
|
||||
return View::make('ManageEvents.Modals.EditOrganiser', [
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'organiser' => $organiser
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
'organiser' => $organiser,
|
||||
]);
|
||||
}
|
||||
|
||||
public function showCreateOrganiser() {
|
||||
|
||||
public function showCreateOrganiser()
|
||||
{
|
||||
return View::make('ManageOrganiser.CreateOrganiser', [
|
||||
'modal_id' => 'createOrganiser'
|
||||
'modal_id' => 'createOrganiser',
|
||||
]);
|
||||
|
||||
return View::make('ManageEvents.Modals.CreateOrganiser', [
|
||||
'modal_id' => Input::get('modal_id')
|
||||
'modal_id' => Input::get('modal_id'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function postCreateOrganiser() {
|
||||
$organiser = Organiser::createNew(FALSE, FALSE, TRUE);
|
||||
public function postCreateOrganiser()
|
||||
{
|
||||
$organiser = Organiser::createNew(false, false, true);
|
||||
|
||||
if (!$organiser->validate(Input::all())) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $organiser->errors()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $organiser->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
$organiser->name = Input::get('name');
|
||||
|
|
@ -83,14 +80,13 @@ class OrganiserController extends MyBaseController {
|
|||
$organiser->email = Input::get('email');
|
||||
$organiser->facebook = Input::get('facebook');
|
||||
$organiser->twitter = Input::get('twitter');
|
||||
$organiser->confirmation_key = md5(time().rand(0,999999));
|
||||
$organiser->confirmation_key = md5(time().rand(0, 999999));
|
||||
|
||||
if (Input::hasFile('organiser_logo')) {
|
||||
$path = public_path().'/'.config('attendize.organiser_images_path');
|
||||
$filename = 'organiser_logo-'.$organiser->id.'.'.strtolower(Input::file('organiser_logo')->getClientOriginalExtension());
|
||||
|
||||
$path = public_path() . '/' . config('attendize.organiser_images_path');
|
||||
$filename = 'organiser_logo-' . $organiser->id . '.' . strtolower(Input::file('organiser_logo')->getClientOriginalExtension());
|
||||
|
||||
$file_full_path = $path . '/' . $filename;
|
||||
$file_full_path = $path.'/'.$filename;
|
||||
|
||||
Input::file('organiser_logo')->move($path, $filename);
|
||||
|
||||
|
|
@ -102,26 +98,21 @@ class OrganiserController extends MyBaseController {
|
|||
});
|
||||
|
||||
$img->save($file_full_path);
|
||||
|
||||
if(file_exists($file_full_path)) {
|
||||
$organiser->logo_path = config('attendize.organiser_images_path') . '/' . $filename;
|
||||
|
||||
if (file_exists($file_full_path)) {
|
||||
$organiser->logo_path = config('attendize.organiser_images_path').'/'.$filename;
|
||||
}
|
||||
|
||||
}
|
||||
$organiser->save();
|
||||
|
||||
\Session::flash('message', 'Successfully Created Organiser');
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'message' => 'Refreshing..',
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'message' => 'Refreshing..',
|
||||
'redirectUrl' => route('showOrganiserDashboard', [
|
||||
'organiser_id' => $organiser->id
|
||||
])
|
||||
));
|
||||
'organiser_id' => $organiser->id,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,35 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Input;
|
||||
use View;
|
||||
use Session;
|
||||
use Response;
|
||||
use File;
|
||||
use Storage;
|
||||
use Image;
|
||||
use App\Models\Organiser;
|
||||
use App\Models\Event;
|
||||
use File;
|
||||
use Image;
|
||||
use Input;
|
||||
use Response;
|
||||
use Session;
|
||||
use View;
|
||||
|
||||
class OrganiserCustomizeController extends MyBaseController
|
||||
{
|
||||
|
||||
public function showCustomize($organiser_id) {
|
||||
|
||||
public function showCustomize($organiser_id)
|
||||
{
|
||||
$data = [
|
||||
'organiser' => Organiser::scope()->findOrFail($organiser_id)
|
||||
'organiser' => Organiser::scope()->findOrFail($organiser_id),
|
||||
];
|
||||
|
||||
return View::make('ManageOrganiser.Customize', $data);
|
||||
}
|
||||
|
||||
public function postEditOrganiser($organiser_id) {
|
||||
public function postEditOrganiser($organiser_id)
|
||||
{
|
||||
$organiser = Organiser::scope()->find($organiser_id);
|
||||
|
||||
if (!$organiser->validate(Input::all())) {
|
||||
return Response::json(array(
|
||||
'status' => 'error',
|
||||
'messages' => $organiser->errors()
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $organiser->errors(),
|
||||
]);
|
||||
}
|
||||
|
||||
$organiser->name = Input::get('name');
|
||||
|
|
@ -41,7 +41,7 @@ class OrganiserCustomizeController extends MyBaseController
|
|||
/*
|
||||
* If the email has been changed the user must confirm the email.
|
||||
*/
|
||||
if($organiser->email !== Input::get('email')) {
|
||||
if ($organiser->email !== Input::get('email')) {
|
||||
$organiser->is_email_confirmed = 0;
|
||||
}
|
||||
|
||||
|
|
@ -49,12 +49,11 @@ class OrganiserCustomizeController extends MyBaseController
|
|||
$organiser->logo_path = '';
|
||||
}
|
||||
|
||||
if (Input::hasFile('organiser_logo') ) {
|
||||
|
||||
if (Input::hasFile('organiser_logo')) {
|
||||
$the_file = \File::get(Input::file('organiser_logo')->getRealPath());
|
||||
$file_name = str_slug($organiser->name).'-logo-' . $organiser->id . '.' . strtolower(Input::file('organiser_logo')->getClientOriginalExtension());
|
||||
$file_name = str_slug($organiser->name).'-logo-'.$organiser->id.'.'.strtolower(Input::file('organiser_logo')->getClientOriginalExtension());
|
||||
|
||||
$relative_path_to_file = config('attendize.organiser_images_path') . '/' . $file_name;
|
||||
$relative_path_to_file = config('attendize.organiser_images_path').'/'.$file_name;
|
||||
$full_path_to_file = public_path().'/'.$relative_path_to_file;
|
||||
|
||||
$img = Image::make($the_file);
|
||||
|
|
@ -66,23 +65,20 @@ class OrganiserCustomizeController extends MyBaseController
|
|||
|
||||
$img->save($full_path_to_file);
|
||||
|
||||
if(\Storage::put($file_name, $the_file)) {
|
||||
if (\Storage::put($file_name, $the_file)) {
|
||||
$organiser->logo_path = $relative_path_to_file;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$organiser->save();
|
||||
|
||||
Session::flash('message', 'Successfully Updated Organiser');
|
||||
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'redirectUrl' => route('showOrganiserCustomize', [
|
||||
'organiser_id' => $organiser->id
|
||||
])
|
||||
));
|
||||
'organiser_id' => $organiser->id,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,28 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Organiser;
|
||||
use App\Models\Event;
|
||||
use App\Models\Attendee;
|
||||
use View;
|
||||
use Carbon\Carbon;
|
||||
use Input;
|
||||
|
||||
use View;
|
||||
|
||||
class OrganiserDashboardController extends MyBaseController
|
||||
{
|
||||
|
||||
|
||||
public function showDashboard($organiser_id)
|
||||
{
|
||||
|
||||
$organiser = Organiser::scope()->findOrFail($organiser_id);
|
||||
$upcoming_events = $organiser->events()->where('end_date', '>=', Carbon::now())->get();
|
||||
|
||||
$data = [
|
||||
'organiser' => $organiser,
|
||||
'organiser' => $organiser,
|
||||
'upcoming_events' => $upcoming_events,
|
||||
'search' => [
|
||||
'search' => [
|
||||
'sort_by' => 's',
|
||||
'q' => ''
|
||||
'q' => '',
|
||||
],
|
||||
'q'=> 'dd'
|
||||
'q' => 'dd',
|
||||
];
|
||||
|
||||
return View::make('ManageOrganiser.Dashboard', $data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Models\Organiser;
|
||||
use Input;
|
||||
use View;
|
||||
use App\Models\Organiser;
|
||||
use App\Models\Event;
|
||||
|
||||
class OrganiserEventsController extends MyBaseController
|
||||
{
|
||||
|
||||
public function showEvents($organiser_id) {
|
||||
|
||||
public function showEvents($organiser_id)
|
||||
{
|
||||
$organiser = Organiser::scope()->findOrfail($organiser_id);
|
||||
|
||||
$allowed_sorts = ['created_at', 'start_date', 'end_date', 'title'];
|
||||
|
|
@ -18,22 +19,19 @@ class OrganiserEventsController extends MyBaseController
|
|||
$sort_by = (in_array(Input::get('sort_by'), $allowed_sorts) ? Input::get('sort_by') : 'start_date');
|
||||
|
||||
$events = $searchQuery
|
||||
? Event::scope()->where('title', 'like', '%' . $searchQuery . '%')->orderBy($sort_by, 'desc')->where('organiser_id', '=', $organiser_id)->paginate(12)
|
||||
? Event::scope()->where('title', 'like', '%'.$searchQuery.'%')->orderBy($sort_by, 'desc')->where('organiser_id', '=', $organiser_id)->paginate(12)
|
||||
: Event::scope()->where('organiser_id', '=', $organiser_id)->orderBy($sort_by, 'desc')->paginate(12);
|
||||
|
||||
|
||||
$data = [
|
||||
'events' => $events,
|
||||
'events' => $events,
|
||||
'organiser' => $organiser,
|
||||
'search' => [
|
||||
'q' => $searchQuery ? $searchQuery : '',
|
||||
'sort_by' => Input::get('sort_by') ? Input::get('sort_by') : '',
|
||||
'showPast' => Input::get('past')
|
||||
]
|
||||
'search' => [
|
||||
'q' => $searchQuery ? $searchQuery : '',
|
||||
'sort_by' => Input::get('sort_by') ? Input::get('sort_by') : '',
|
||||
'showPast' => Input::get('past'),
|
||||
],
|
||||
];
|
||||
|
||||
return View::make('ManageOrganiser.Events', $data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,27 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use View;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Organiser;
|
||||
use View;
|
||||
|
||||
|
||||
class OrganiserViewController extends Controller {
|
||||
|
||||
public function showOrganiserHome($organiser_id, $slug='', $preview = FALSE) {
|
||||
|
||||
class OrganiserViewController extends Controller
|
||||
{
|
||||
public function showOrganiserHome($organiser_id, $slug = '', $preview = false)
|
||||
{
|
||||
$organiser = Organiser::findOrFail($organiser_id);
|
||||
|
||||
$data = [
|
||||
'organiser' => $organiser,
|
||||
'tickets' => $organiser->events()->orderBy('created_at', 'desc')->get(),
|
||||
'is_embedded' => 0
|
||||
'organiser' => $organiser,
|
||||
'tickets' => $organiser->events()->orderBy('created_at', 'desc')->get(),
|
||||
'is_embedded' => 0,
|
||||
];
|
||||
|
||||
|
||||
return View::make('Public.ViewOrganiser.OrganiserPage', $data);
|
||||
}
|
||||
|
||||
public function showEventHomePreview($event_id) {
|
||||
return showEventHome($event_id, TRUE);
|
||||
public function showEventHomePreview($event_id)
|
||||
{
|
||||
return showEventHome($event_id, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,12 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Contracts\Auth\PasswordBroker;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class RemindersController extends Controller {
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class RemindersController extends Controller
|
||||
{
|
||||
/**
|
||||
* The Guard implementation.
|
||||
*
|
||||
|
|
@ -24,7 +22,8 @@ class RemindersController extends Controller {
|
|||
*/
|
||||
protected $passwords;
|
||||
|
||||
public function __construct(Guard $auth, PasswordBroker $passwords) {
|
||||
public function __construct(Guard $auth, PasswordBroker $passwords)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->passwords = $passwords;
|
||||
|
||||
|
|
@ -32,21 +31,22 @@ class RemindersController extends Controller {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the e-mail subject line to be used for the reset link email.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getEmailSubject()
|
||||
{
|
||||
return isset($this->subject) ? $this->subject : 'Your Password Reset Link';
|
||||
}
|
||||
|
||||
* Get the e-mail subject line to be used for the reset link email.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getEmailSubject()
|
||||
{
|
||||
return isset($this->subject) ? $this->subject : 'Your Password Reset Link';
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the password reminder view.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getRemind() {
|
||||
public function getRemind()
|
||||
{
|
||||
return \View::make('Public.LoginAndRegister.ForgotPassword');
|
||||
}
|
||||
|
||||
|
|
@ -55,11 +55,11 @@ class RemindersController extends Controller {
|
|||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function postRemind(Request $request) {
|
||||
|
||||
public function postRemind(Request $request)
|
||||
{
|
||||
$this->validate($request, ['email' => 'required']);
|
||||
|
||||
$response = $this->passwords->sendResetLink($request->only('email'), function($m) {
|
||||
$response = $this->passwords->sendResetLink($request->only('email'), function ($m) {
|
||||
$m->subject($this->getEmailSubject());
|
||||
});
|
||||
|
||||
|
|
@ -75,12 +75,15 @@ class RemindersController extends Controller {
|
|||
/**
|
||||
* Display the password reset view for the given token.
|
||||
*
|
||||
* @param string $token
|
||||
* @param string $token
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getReset($token = null) {
|
||||
if (is_null($token))
|
||||
public function getReset($token = null)
|
||||
{
|
||||
if (is_null($token)) {
|
||||
\App::abort(404);
|
||||
}
|
||||
|
||||
return \View::make('Public.LoginAndRegister.ResetPassword')->with('token', $token);
|
||||
}
|
||||
|
|
@ -90,10 +93,11 @@ class RemindersController extends Controller {
|
|||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function postReset(Request $request) {
|
||||
public function postReset(Request $request)
|
||||
{
|
||||
$this->validate($request, [
|
||||
'token' => 'required',
|
||||
'email' => 'required',
|
||||
'token' => 'required',
|
||||
'email' => 'required',
|
||||
'password' => 'required|confirmed',
|
||||
]);
|
||||
|
||||
|
|
@ -101,7 +105,7 @@ class RemindersController extends Controller {
|
|||
'email', 'password', 'password_confirmation', 'token'
|
||||
);
|
||||
|
||||
$response = $this->passwords->reset($credentials, function($user, $password) {
|
||||
$response = $this->passwords->reset($credentials, function ($user, $password) {
|
||||
$user->password = bcrypt($password);
|
||||
|
||||
$user->save();
|
||||
|
|
@ -112,6 +116,7 @@ class RemindersController extends Controller {
|
|||
switch ($response) {
|
||||
case PasswordBroker::PASSWORD_RESET:
|
||||
\Session::flash('message', 'Password Successfully Reset');
|
||||
|
||||
return redirect(route('login'));
|
||||
|
||||
default:
|
||||
|
|
@ -120,5 +125,4 @@ class RemindersController extends Controller {
|
|||
->withErrors(['email' => trans($response)]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,49 +2,47 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Input,
|
||||
Response,
|
||||
Auth,
|
||||
Validator;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Response;
|
||||
|
||||
class UserController extends Controller {
|
||||
|
||||
public function showEditUser() {
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
public function showEditUser()
|
||||
{
|
||||
$data = [
|
||||
'user' => \Auth::user(),
|
||||
'modal_id' => \Input::get('modal_id')
|
||||
'user' => \Auth::user(),
|
||||
'modal_id' => \Input::get('modal_id'),
|
||||
];
|
||||
|
||||
return \View::make('ManageUser.Modals.EditUser', $data);
|
||||
}
|
||||
|
||||
public function postEditUser() {
|
||||
|
||||
$rules = array(
|
||||
'email' => ['required', 'email', 'exists:users,email,account_id,' . Auth::user()->account_id],
|
||||
public function postEditUser()
|
||||
{
|
||||
$rules = [
|
||||
'email' => ['required', 'email', 'exists:users,email,account_id,'.Auth::user()->account_id],
|
||||
'new_password' => ['min:5', 'confirmed', 'required_with:password'],
|
||||
'password' => 'passcheck',
|
||||
'first_name' => ['required'],
|
||||
'last_name' => ['required']
|
||||
);
|
||||
'password' => 'passcheck',
|
||||
'first_name' => ['required'],
|
||||
'last_name' => ['required'],
|
||||
];
|
||||
|
||||
$messages = [
|
||||
'email.email' => 'Please enter a valid E-mail address.',
|
||||
'email.required' => 'E-mail address is required.',
|
||||
'password.passcheck' => 'This password is incorrect.',
|
||||
'email.exists' => 'This E-mail has is already in use.',
|
||||
'first_name.required' => 'Please enter your first name.'
|
||||
'email.email' => 'Please enter a valid E-mail address.',
|
||||
'email.required' => 'E-mail address is required.',
|
||||
'password.passcheck' => 'This password is incorrect.',
|
||||
'email.exists' => 'This E-mail has is already in use.',
|
||||
'first_name.required' => 'Please enter your first name.',
|
||||
];
|
||||
|
||||
$validation = \Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validation->fails()) {
|
||||
return Response::json([
|
||||
'status' => 'error',
|
||||
'messages' => $validation->messages()->toArray()
|
||||
'status' => 'error',
|
||||
'messages' => $validation->messages()->toArray(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -57,15 +55,12 @@ class UserController extends Controller {
|
|||
$user->first_name = Input::get('first_name');
|
||||
$user->last_name = Input::get('last_name');
|
||||
|
||||
|
||||
|
||||
//$user->email = Input::get('email');
|
||||
$user->save();
|
||||
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'message' => 'Successfully Edited User'
|
||||
'status' => 'success',
|
||||
'message' => 'Successfully Edited User',
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,57 +2,55 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Request,
|
||||
View,
|
||||
Auth,
|
||||
Input,
|
||||
Redirect;
|
||||
use \Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
class UserLoginController extends Controller {
|
||||
use Auth;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Request;
|
||||
use View;
|
||||
|
||||
class UserLoginController extends Controller
|
||||
{
|
||||
protected $auth;
|
||||
|
||||
public function __construct(Guard $auth) {
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
public function showLogin() {
|
||||
public function showLogin()
|
||||
{
|
||||
|
||||
/*
|
||||
* If there's an ajax request to the login page assume the person has been
|
||||
* logged out and redirect them to the login page
|
||||
*/
|
||||
if (Request::ajax()) {
|
||||
return Response::json(array(
|
||||
'status' => 'success',
|
||||
'redirectUrl' => route('login')
|
||||
));
|
||||
return Response::json([
|
||||
'status' => 'success',
|
||||
'redirectUrl' => route('login'),
|
||||
]);
|
||||
}
|
||||
|
||||
return View::make('Public.LoginAndRegister.Login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the login
|
||||
*
|
||||
* Handle the login.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function postLogin() {
|
||||
|
||||
public function postLogin()
|
||||
{
|
||||
$email = Input::get('email');
|
||||
$password = Input::get('password');
|
||||
|
||||
if ($this->auth->attempt(array('email' => $email, 'password' => $password), true)) {
|
||||
if ($this->auth->attempt(['email' => $email, 'password' => $password], true)) {
|
||||
return Redirect::to(route('showSelectOrganiser'));
|
||||
}
|
||||
|
||||
return Redirect::to('login?failed=yup')->with('message', 'Your username/password combination was incorrect')
|
||||
->withInput();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,21 +2,22 @@
|
|||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
class UserLogoutController extends Controller {
|
||||
|
||||
class UserLogoutController extends Controller
|
||||
{
|
||||
protected $auth;
|
||||
|
||||
public function __construct(Guard $auth) {
|
||||
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
|
||||
public function doLogout() {
|
||||
public function doLogout()
|
||||
{
|
||||
$this->auth->logout();
|
||||
|
||||
return \Redirect::to('/?logged_out=yup');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,106 +1,106 @@
|
|||
<?php namespace App\Http\Controllers;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Mail;
|
||||
use Session;
|
||||
use Validator;
|
||||
use Redirect;
|
||||
use Hash;
|
||||
use Auth;
|
||||
use Input;
|
||||
use View;
|
||||
use App\Attendize\Utils;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use App\Models\Account;
|
||||
use App\Models\User;
|
||||
use Auth;
|
||||
use Hash;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Input;
|
||||
use Mail;
|
||||
use Redirect;
|
||||
use Session;
|
||||
use Validator;
|
||||
use View;
|
||||
|
||||
class UserSignupController extends Controller {
|
||||
|
||||
class UserSignupController extends Controller
|
||||
{
|
||||
protected $auth;
|
||||
|
||||
public function __construct(Guard $auth) {
|
||||
|
||||
if(Account::count() > 0 && !Utils::isAttendize()) {
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
if (Account::count() > 0 && !Utils::isAttendize()) {
|
||||
return Redirect::route('login');
|
||||
}
|
||||
|
||||
$this->auth = $auth;
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
public function showSignup() {
|
||||
|
||||
public function showSignup()
|
||||
{
|
||||
return View::make('Public.LoginAndRegister.Signup');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates an account
|
||||
* Creates an account.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function postSignup() {
|
||||
$rules = array(
|
||||
'email' => array('required', 'email', 'unique:users'),
|
||||
'password' => array('required', 'min:5', 'confirmed'),
|
||||
'first_name' => array('required'),
|
||||
'terms_agreed' => Utils::isAttendize() ? array('required') : ''
|
||||
);
|
||||
public function postSignup()
|
||||
{
|
||||
$rules = [
|
||||
'email' => ['required', 'email', 'unique:users'],
|
||||
'password' => ['required', 'min:5', 'confirmed'],
|
||||
'first_name' => ['required'],
|
||||
'terms_agreed' => Utils::isAttendize() ? ['required'] : '',
|
||||
];
|
||||
|
||||
$messages = array(
|
||||
'email.email' => 'Please enter a valid E-mail address.',
|
||||
'email.required' => 'E-mail address is required.',
|
||||
'password.required' => 'Password is required.',
|
||||
'password.min' => 'Your password is too short! Min 5 symbols.',
|
||||
'email.unique' => 'This E-mail has already been taken.',
|
||||
'first_name.required' => 'Please enter your first name.',
|
||||
'terms_agreed.required' => 'Please agree to our Terms of Service.'
|
||||
);
|
||||
$messages = [
|
||||
'email.email' => 'Please enter a valid E-mail address.',
|
||||
'email.required' => 'E-mail address is required.',
|
||||
'password.required' => 'Password is required.',
|
||||
'password.min' => 'Your password is too short! Min 5 symbols.',
|
||||
'email.unique' => 'This E-mail has already been taken.',
|
||||
'first_name.required' => 'Please enter your first name.',
|
||||
'terms_agreed.required' => 'Please agree to our Terms of Service.',
|
||||
];
|
||||
|
||||
$validation = Validator::make(Input::all(), $rules, $messages);
|
||||
$validation = Validator::make(Input::all(), $rules, $messages);
|
||||
|
||||
if ($validation->fails()) {
|
||||
return Redirect::to('signup')->withInput()->withErrors($validation);
|
||||
}
|
||||
if ($validation->fails()) {
|
||||
return Redirect::to('signup')->withInput()->withErrors($validation);
|
||||
}
|
||||
|
||||
$account = new Account;
|
||||
$account->email = Input::get('email');
|
||||
$account->first_name = Input::get('first_name');
|
||||
$account->last_name = Input::get('last_name');
|
||||
$account->currency_id = config('attendize.default_currency');
|
||||
$account->timezone_id = config('attendize.default_timezone');
|
||||
$account->save();
|
||||
$account = new Account();
|
||||
$account->email = Input::get('email');
|
||||
$account->first_name = Input::get('first_name');
|
||||
$account->last_name = Input::get('last_name');
|
||||
$account->currency_id = config('attendize.default_currency');
|
||||
$account->timezone_id = config('attendize.default_timezone');
|
||||
$account->save();
|
||||
|
||||
$user = new User;
|
||||
$user->email = Input::get('email');
|
||||
$user->first_name = Input::get('first_name');
|
||||
$user->last_name = Input::get('last_name');
|
||||
$user->password = Hash::make(Input::get('password'));
|
||||
$user->account_id = $account->id;
|
||||
$user = new User();
|
||||
$user->email = Input::get('email');
|
||||
$user->first_name = Input::get('first_name');
|
||||
$user->last_name = Input::get('last_name');
|
||||
$user->password = Hash::make(Input::get('password'));
|
||||
$user->account_id = $account->id;
|
||||
$user->is_parent = 1;
|
||||
$user->is_registered = 1;
|
||||
$user->save();
|
||||
$user->save();
|
||||
|
||||
|
||||
if(Utils::isAttendize()) {
|
||||
Mail::send('Emails.ConfirmEmail', ['first_name' => $user->first_name, 'confirmation_code' => $user->confirmation_code], function($message) {
|
||||
if (Utils::isAttendize()) {
|
||||
Mail::send('Emails.ConfirmEmail', ['first_name' => $user->first_name, 'confirmation_code' => $user->confirmation_code], function ($message) {
|
||||
$message->to(Input::get('email'), Input::get('first_name'))
|
||||
->subject('Thank you for registering for Attendize');
|
||||
});
|
||||
}
|
||||
|
||||
Session::flash('message', "Success! You can now login.");
|
||||
Session::flash('message', 'Success! You can now login.');
|
||||
|
||||
return Redirect::to('login');
|
||||
return Redirect::to('login');
|
||||
}
|
||||
|
||||
function confirmEmail($confirmation_code) {
|
||||
|
||||
public function confirmEmail($confirmation_code)
|
||||
{
|
||||
$user = User::whereConfirmationCode($confirmation_code)->first();
|
||||
|
||||
if ( ! $user)
|
||||
{
|
||||
if (!$user) {
|
||||
return \View::make('Public.Errors.Generic', [
|
||||
'message' => 'The confirmation code is missing or malformed.'
|
||||
'message' => 'The confirmation code is missing or malformed.',
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -108,21 +108,19 @@ class UserSignupController extends Controller {
|
|||
$user->confirmation_code = null;
|
||||
$user->save();
|
||||
|
||||
\Session::flash('message', "Success! Your email is now verified. You can now login.");
|
||||
\Session::flash('message', 'Success! Your email is now verified. You can now login.');
|
||||
|
||||
//$this->auth->login($user);
|
||||
|
||||
return Redirect::route('login');
|
||||
}
|
||||
|
||||
|
||||
private function validateEmail($data)
|
||||
{
|
||||
$rules = [
|
||||
'email' => 'required|email|unique:users'
|
||||
'email' => 'required|email|unique:users',
|
||||
];
|
||||
|
||||
return Validator::make($data, $rules);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,35 +1,36 @@
|
|||
<?php namespace App\Http;
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel {
|
||||
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
|
||||
'Illuminate\Cookie\Middleware\EncryptCookies',
|
||||
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
|
||||
'Illuminate\Session\Middleware\StartSession',
|
||||
'Illuminate\View\Middleware\ShareErrorsFromSession',
|
||||
'App\Http\Middleware\VerifyCsrfToken',
|
||||
'App\Http\Middleware\GeneralChecks'
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => 'App\Http\Middleware\Authenticate',
|
||||
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
|
||||
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
|
||||
'first.run' => 'App\Http\Middleware\FirstRunMiddleware',
|
||||
'installed' => 'App\Http\Middleware\CheckInstalled'
|
||||
];
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
|
||||
'Illuminate\Cookie\Middleware\EncryptCookies',
|
||||
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
|
||||
'Illuminate\Session\Middleware\StartSession',
|
||||
'Illuminate\View\Middleware\ShareErrorsFromSession',
|
||||
'App\Http\Middleware\VerifyCsrfToken',
|
||||
'App\Http\Middleware\GeneralChecks',
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => 'App\Http\Middleware\Authenticate',
|
||||
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
|
||||
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
|
||||
'first.run' => 'App\Http\Middleware\FirstRunMiddleware',
|
||||
'installed' => 'App\Http\Middleware\CheckInstalled',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,50 +1,49 @@
|
|||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
class Authenticate {
|
||||
class Authenticate
|
||||
{
|
||||
/**
|
||||
* The Guard implementation.
|
||||
*
|
||||
* @var Guard
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* The Guard implementation.
|
||||
*
|
||||
* @var Guard
|
||||
*/
|
||||
protected $auth;
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*
|
||||
* @param Guard $auth
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*
|
||||
* @param Guard $auth
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->guest())
|
||||
{
|
||||
if ($request->ajax())
|
||||
{
|
||||
return response('Unauthorized.', 401);
|
||||
}
|
||||
else
|
||||
{
|
||||
return redirect()->guest('login');
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->guest()) {
|
||||
if ($request->ajax()) {
|
||||
return response('Unauthorized.', 401);
|
||||
} else {
|
||||
return redirect()->guest('login');
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,25 @@
|
|||
<?php namespace app\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace app\Http\Middleware;
|
||||
|
||||
use App\Attendize\Utils;
|
||||
use Closure;
|
||||
use Redirect;
|
||||
use Request;
|
||||
use App\Models\OrderStatus;
|
||||
use App\Attendize\Utils;
|
||||
|
||||
class CheckInstalled
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if(!file_exists(base_path('installed')) && !Utils::isAttendize()) {
|
||||
if (!file_exists(base_path('installed')) && !Utils::isAttendize()) {
|
||||
return Redirect::to('install');
|
||||
}
|
||||
|
||||
|
|
@ -25,4 +27,4 @@ class CheckInstalled
|
|||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,20 @@
|
|||
<?php namespace app\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace app\Http\Middleware;
|
||||
|
||||
use Request;
|
||||
use Closure;
|
||||
use Utils;
|
||||
use App;
|
||||
use Auth;
|
||||
use Input;
|
||||
use Redirect;
|
||||
use Cache;
|
||||
use Session;
|
||||
use File;
|
||||
use App\Models\Organiser;
|
||||
use Closure;
|
||||
use Redirect;
|
||||
use Request;
|
||||
|
||||
class FirstRunMiddleware
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
|
|
@ -30,11 +26,11 @@ class FirstRunMiddleware
|
|||
*/
|
||||
if (Organiser::scope()->count() === 0 && !($request->route()->getName() == 'showCreateOrganiser') && !($request->route()->getName() == 'postCreateOrganiser')) {
|
||||
return redirect(route('showCreateOrganiser', [
|
||||
'first_run' => '1'
|
||||
'first_run' => '1',
|
||||
]));
|
||||
} elseif (Organiser::scope()->count() === 1 && ($request->route()->getName() == 'showSelectOrganiser')) {
|
||||
return redirect(route('showOrganiserDashboard', [
|
||||
'organiser_id' => Organiser::scope()->first()->id
|
||||
'organiser_id' => Organiser::scope()->first()->id,
|
||||
]));
|
||||
}
|
||||
|
||||
|
|
@ -42,4 +38,4 @@ class FirstRunMiddleware
|
|||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
<?php namespace app\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace app\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use App;
|
||||
|
||||
class GeneralChecks
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
|
|
@ -17,11 +19,11 @@ class GeneralChecks
|
|||
|
||||
// Show message to IE 8 and before users
|
||||
if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/(?i)msie [2-8]/', $_SERVER['HTTP_USER_AGENT'])) {
|
||||
Session::flash('message', "Please update your browser. This application requires a modern browser.");
|
||||
Session::flash('message', 'Please update your browser. This application requires a modern browser.');
|
||||
}
|
||||
|
||||
$response = $next($request);
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,44 +1,46 @@
|
|||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
|
||||
class RedirectIfAuthenticated {
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* The Guard implementation.
|
||||
*
|
||||
* @var Guard
|
||||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* The Guard implementation.
|
||||
*
|
||||
* @var Guard
|
||||
*/
|
||||
protected $auth;
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*
|
||||
* @param Guard $auth
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*
|
||||
* @param Guard $auth
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->check())
|
||||
{
|
||||
return new RedirectResponse(route('showSelectOrganiser'));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->check()) {
|
||||
return new RedirectResponse(route('showSelectOrganiser'));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,26 @@
|
|||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier {
|
||||
|
||||
|
||||
protected $except = [
|
||||
'install/*',
|
||||
];
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
class VerifyCsrfToken extends BaseVerifier
|
||||
{
|
||||
protected $except = [
|
||||
'install/*',
|
||||
];
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
<?php namespace App\Http\Requests;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
abstract class Request extends FormRequest {
|
||||
|
||||
//
|
||||
|
||||
abstract class Request extends FormRequest
|
||||
{
|
||||
//
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,41 +15,38 @@
|
|||
* Installer
|
||||
*/
|
||||
Route::get('install', [
|
||||
'as' => 'showInstaller',
|
||||
'uses' => 'InstallerController@showInstaller'
|
||||
'as' => 'showInstaller',
|
||||
'uses' => 'InstallerController@showInstaller',
|
||||
]);
|
||||
Route::post('install', [
|
||||
'as' => 'postInstaller',
|
||||
'uses' => 'InstallerController@postInstaller'
|
||||
'as' => 'postInstaller',
|
||||
'uses' => 'InstallerController@postInstaller',
|
||||
]);
|
||||
|
||||
/*
|
||||
* Stripe connect return
|
||||
* Stripe connect return
|
||||
*/
|
||||
Route::any('payment/return/stripe', [
|
||||
'as' => 'showStripeReturn',
|
||||
'uses' => 'ManageAccountController@showStripeReturn'
|
||||
'as' => 'showStripeReturn',
|
||||
'uses' => 'ManageAccountController@showStripeReturn',
|
||||
]);
|
||||
|
||||
|
||||
/*
|
||||
* Logout
|
||||
*/
|
||||
Route::any('/logout', [
|
||||
'uses' => 'UserLogoutController@doLogout',
|
||||
'as' => 'logout'
|
||||
'as' => 'logout',
|
||||
]);
|
||||
|
||||
|
||||
Route::group(array('middleware' => ['installed']), function() {
|
||||
|
||||
Route::group(['middleware' => ['installed']], function () {
|
||||
|
||||
/*
|
||||
* Login
|
||||
*/
|
||||
Route::get('/login', [
|
||||
'as' => 'login',
|
||||
'uses' => 'UserLoginController@showLogin'
|
||||
'as' => 'login',
|
||||
'uses' => 'UserLoginController@showLogin',
|
||||
]);
|
||||
Route::post('/login', 'UserLoginController@postLogin');
|
||||
|
||||
|
|
@ -57,36 +54,34 @@ Route::group(array('middleware' => ['installed']), function() {
|
|||
* Forgot password
|
||||
*/
|
||||
Route::get('login/forgot-password', [
|
||||
'as' => 'forgotPassword',
|
||||
'uses' => 'RemindersController@getRemind'
|
||||
'as' => 'forgotPassword',
|
||||
'uses' => 'RemindersController@getRemind',
|
||||
]);
|
||||
|
||||
Route::post('login/forgot-password', [
|
||||
'as' => 'postForgotPassword',
|
||||
'uses' => 'RemindersController@postRemind'
|
||||
'as' => 'postForgotPassword',
|
||||
'uses' => 'RemindersController@postRemind',
|
||||
]);
|
||||
|
||||
/*
|
||||
* Reset Password
|
||||
*/
|
||||
Route::get('login/reset-password/{token}', [
|
||||
'as' => 'showResetPassword',
|
||||
'uses' => 'RemindersController@getReset'
|
||||
'as' => 'showResetPassword',
|
||||
'uses' => 'RemindersController@getReset',
|
||||
]);
|
||||
|
||||
Route::post('login/reset-password', [
|
||||
'as' => 'postResetPassword',
|
||||
'uses' => 'RemindersController@postReset'
|
||||
'as' => 'postResetPassword',
|
||||
'uses' => 'RemindersController@postReset',
|
||||
]);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Registration / Account creation
|
||||
*/
|
||||
Route::get('/signup', [
|
||||
'uses' => 'UserSignupController@showSignup',
|
||||
'as' => 'showSignup'
|
||||
'as' => 'showSignup',
|
||||
]);
|
||||
Route::post('/signup', 'UserSignupController@postSignup');
|
||||
|
||||
|
|
@ -94,155 +89,147 @@ Route::group(array('middleware' => ['installed']), function() {
|
|||
* Confirm Email
|
||||
*/
|
||||
Route::get('signup/confirm_email/{confirmation_code}', [
|
||||
'as' => 'confirmEmail',
|
||||
'uses' => 'UserSignupController@confirmEmail'
|
||||
'as' => 'confirmEmail',
|
||||
'uses' => 'UserSignupController@confirmEmail',
|
||||
]);
|
||||
});
|
||||
|
||||
/*
|
||||
* Public organiser page routes
|
||||
*/
|
||||
Route::group(['prefix' => 'o'], function() {
|
||||
|
||||
Route::get('/{organiser_id}/{organier_slug?}', [
|
||||
'as' => 'showOrganiserHome',
|
||||
'uses' => 'OrganiserViewController@showOrganiserHome'
|
||||
]);
|
||||
|
||||
});
|
||||
Route::group(['prefix' => 'o'], function () {
|
||||
|
||||
Route::get('/{organiser_id}/{organier_slug?}', [
|
||||
'as' => 'showOrganiserHome',
|
||||
'uses' => 'OrganiserViewController@showOrganiserHome',
|
||||
]);
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
* Public event page routes
|
||||
*/
|
||||
Route::group(array('prefix' => 'e'), function() {
|
||||
|
||||
|
||||
Route::group(['prefix' => 'e'], function () {
|
||||
|
||||
/*
|
||||
* Embedded events
|
||||
*/
|
||||
Route::get('/{event_id}/embed', [
|
||||
'as' => 'showEmbeddedEventPage',
|
||||
'uses' => 'EventViewEmbeddedController@showEmbeddedEvent'
|
||||
'as' => 'showEmbeddedEventPage',
|
||||
'uses' => 'EventViewEmbeddedController@showEmbeddedEvent',
|
||||
]);
|
||||
|
||||
Route::get('/{event_id}/{event_slug?}', [
|
||||
'as' => 'showEventPage',
|
||||
'uses' => 'EventViewController@showEventHome'
|
||||
'as' => 'showEventPage',
|
||||
'uses' => 'EventViewController@showEventHome',
|
||||
]);
|
||||
|
||||
Route::post('/{event_id}/contact_organiser', [
|
||||
'as' => 'postContactOrganiser',
|
||||
'uses' => 'EventViewController@postContactOrganiser'
|
||||
'as' => 'postContactOrganiser',
|
||||
'uses' => 'EventViewController@postContactOrganiser',
|
||||
]);
|
||||
|
||||
/*
|
||||
* Used for previewing designs in the backend. Doesn't log page views etc.
|
||||
*/
|
||||
Route::get('/{event_id}/preview', [
|
||||
'as' => 'showEventPagePreview',
|
||||
'uses' => 'EventViewController@showEventHomePreview'
|
||||
'as' => 'showEventPagePreview',
|
||||
'uses' => 'EventViewController@showEventHomePreview',
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/checkout/', [
|
||||
'as' => 'postValidateTickets',
|
||||
'uses' => 'EventCheckoutController@postValidateTickets'
|
||||
'as' => 'postValidateTickets',
|
||||
'uses' => 'EventCheckoutController@postValidateTickets',
|
||||
]);
|
||||
|
||||
Route::get('{event_id}/checkout/create', [
|
||||
'as' => 'showEventCheckout',
|
||||
'uses' => 'EventCheckoutController@showEventCheckout'
|
||||
'as' => 'showEventCheckout',
|
||||
'uses' => 'EventCheckoutController@showEventCheckout',
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/checkout/create', [
|
||||
'as' => 'postCreateOrder',
|
||||
'uses' => 'EventCheckoutController@postCreateOrder'
|
||||
'as' => 'postCreateOrder',
|
||||
'uses' => 'EventCheckoutController@postCreateOrder',
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View order
|
||||
*/
|
||||
Route::get('order/{order_reference}', [
|
||||
'as' => 'showOrderDetails',
|
||||
'uses' => 'EventCheckoutController@showOrderDetails'
|
||||
'as' => 'showOrderDetails',
|
||||
'uses' => 'EventCheckoutController@showOrderDetails',
|
||||
]);
|
||||
|
||||
Route::get('order/{order_reference}/tickets', [
|
||||
'as' => 'showOrderTickets',
|
||||
'uses' => 'EventCheckoutController@showOrderTickets'
|
||||
'as' => 'showOrderTickets',
|
||||
'uses' => 'EventCheckoutController@showOrderTickets',
|
||||
]);
|
||||
|
||||
|
||||
/*
|
||||
* Begin logged in stuff
|
||||
*/
|
||||
Route::group(array('middleware' => ['auth', 'first.run']), function() {
|
||||
|
||||
Route::group(['middleware' => ['auth', 'first.run']], function () {
|
||||
|
||||
/*
|
||||
* Edit User
|
||||
*/
|
||||
Route::group(['prefix' => 'user'], function() {
|
||||
|
||||
Route::group(['prefix' => 'user'], function () {
|
||||
|
||||
Route::get('/', [
|
||||
'as' => 'showEditUser',
|
||||
'uses' => 'UserController@showEditUser'
|
||||
'as' => 'showEditUser',
|
||||
'uses' => 'UserController@showEditUser',
|
||||
]);
|
||||
Route::post('/', [
|
||||
'as' => 'postEditUser',
|
||||
'uses' => 'UserController@postEditUser'
|
||||
'as' => 'postEditUser',
|
||||
'uses' => 'UserController@postEditUser',
|
||||
]);
|
||||
|
||||
|
||||
});
|
||||
|
||||
/*
|
||||
* Manage account
|
||||
*/
|
||||
Route::group(array('prefix' => 'account'), function() {
|
||||
Route::group(['prefix' => 'account'], function () {
|
||||
|
||||
Route::get('/', [
|
||||
'as' => 'showEditAccount',
|
||||
'uses' => 'ManageAccountController@showEditAccount'
|
||||
'as' => 'showEditAccount',
|
||||
'uses' => 'ManageAccountController@showEditAccount',
|
||||
]);
|
||||
|
||||
Route::post('/', [
|
||||
'as' => 'postEditAccount',
|
||||
'uses' => 'ManageAccountController@postEditAccount'
|
||||
'as' => 'postEditAccount',
|
||||
'uses' => 'ManageAccountController@postEditAccount',
|
||||
]);
|
||||
Route::post('/edit_payment', [
|
||||
'as' => 'postEditAccountPayment',
|
||||
'uses' => 'ManageAccountController@postEditAccountPayment'
|
||||
'as' => 'postEditAccountPayment',
|
||||
'uses' => 'ManageAccountController@postEditAccountPayment',
|
||||
]);
|
||||
|
||||
Route::post('invite_user', [
|
||||
'as' => 'postInviteUser',
|
||||
'uses' => 'ManageAccountController@postInviteUser'
|
||||
'as' => 'postInviteUser',
|
||||
'uses' => 'ManageAccountController@postInviteUser',
|
||||
]);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Route::get('select_organiser', [
|
||||
'as' => 'showSelectOrganiser',
|
||||
'uses' => 'OrganiserController@showSelectOragniser'
|
||||
'as' => 'showSelectOrganiser',
|
||||
'uses' => 'OrganiserController@showSelectOragniser',
|
||||
]);
|
||||
|
||||
/*
|
||||
* New organiser dashboard
|
||||
*/
|
||||
Route::group(array('prefix' => 'organiser'), function() {
|
||||
Route::group(['prefix' => 'organiser'], function () {
|
||||
/*
|
||||
* -----------
|
||||
* Organiser Dashboard
|
||||
* -----------
|
||||
*/
|
||||
Route::get('{organiser_id}/dashboard', [
|
||||
'as' => 'showOrganiserDashboard',
|
||||
'uses' => 'OrganiserDashboardController@showDashboard'
|
||||
'as' => 'showOrganiserDashboard',
|
||||
'uses' => 'OrganiserDashboardController@showDashboard',
|
||||
]);
|
||||
|
||||
/*
|
||||
|
|
@ -251,8 +238,8 @@ Route::group(array('middleware' => ['auth', 'first.run']), function() {
|
|||
* -----------
|
||||
*/
|
||||
Route::get('{organiser_id}/events', [
|
||||
'as' => 'showOrganiserEvents',
|
||||
'uses' => 'OrganiserEventsController@showEvents'
|
||||
'as' => 'showOrganiserEvents',
|
||||
'uses' => 'OrganiserEventsController@showEvents',
|
||||
]);
|
||||
/*
|
||||
* -----------
|
||||
|
|
@ -260,17 +247,15 @@ Route::group(array('middleware' => ['auth', 'first.run']), function() {
|
|||
* -----------
|
||||
*/
|
||||
Route::get('{organiser_id}/customize', [
|
||||
'as' => 'showOrganiserCustomize',
|
||||
'uses' => 'OrganiserCustomizeController@showCustomize'
|
||||
'as' => 'showOrganiserCustomize',
|
||||
'uses' => 'OrganiserCustomizeController@showCustomize',
|
||||
]);
|
||||
});
|
||||
|
||||
/*
|
||||
* Events dashboard
|
||||
*/
|
||||
Route::group(array('prefix' => 'events'), function() {
|
||||
|
||||
|
||||
Route::group(['prefix' => 'events'], function () {
|
||||
|
||||
/*
|
||||
* -----------
|
||||
|
|
@ -278,91 +263,86 @@ Route::group(array('middleware' => ['auth', 'first.run']), function() {
|
|||
* -----------
|
||||
*/
|
||||
Route::get('/organiser/create', [
|
||||
'as' => 'showCreateOrganiser',
|
||||
'uses' => 'OrganiserController@showCreateOrganiser'
|
||||
'as' => 'showCreateOrganiser',
|
||||
'uses' => 'OrganiserController@showCreateOrganiser',
|
||||
]);
|
||||
Route::post('/organiser/create', [
|
||||
'as' => 'postCreateOrganiser',
|
||||
'uses' => 'OrganiserController@postCreateOrganiser'
|
||||
'as' => 'postCreateOrganiser',
|
||||
'uses' => 'OrganiserController@postCreateOrganiser',
|
||||
]);
|
||||
Route::get('/organiser/{organiser_id}', [
|
||||
'as' => 'showOrganiserEventsDashboard',
|
||||
'uses' => 'OrganiserController@showOrganiserDashboard'
|
||||
'as' => 'showOrganiserEventsDashboard',
|
||||
'uses' => 'OrganiserController@showOrganiserDashboard',
|
||||
]);
|
||||
Route::get('/organiser/{organiser_id?}', [
|
||||
'as' => 'showSearchEventsDashboard',
|
||||
'uses' => 'OrganiserController@showOrganiserDashboard'
|
||||
'as' => 'showSearchEventsDashboard',
|
||||
'uses' => 'OrganiserController@showOrganiserDashboard',
|
||||
]);
|
||||
Route::get('/organiser/{organiser_id}/edit', [
|
||||
'as' => 'showEditOrganiser',
|
||||
'uses' => 'OrganiserController@showEditOrganiser'
|
||||
'as' => 'showEditOrganiser',
|
||||
'uses' => 'OrganiserController@showEditOrganiser',
|
||||
]);
|
||||
Route::post('/organiser/{organiser_id}/edit', [
|
||||
'as' => 'postEditOrganiser',
|
||||
'uses' => 'OrganiserCustomizeController@postEditOrganiser'
|
||||
'as' => 'postEditOrganiser',
|
||||
'uses' => 'OrganiserCustomizeController@postEditOrganiser',
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ----------
|
||||
* Create Event
|
||||
* ----------
|
||||
*/
|
||||
Route::get('/create', [
|
||||
'as' => 'showCreateEvent',
|
||||
'uses' => 'EventController@showCreateEvent'
|
||||
'as' => 'showCreateEvent',
|
||||
'uses' => 'EventController@showCreateEvent',
|
||||
]);
|
||||
|
||||
Route::post('/create', [
|
||||
'as' => 'postCreateEvent',
|
||||
'uses' => 'EventController@postCreateEvent'
|
||||
'as' => 'postCreateEvent',
|
||||
'uses' => 'EventController@postCreateEvent',
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
* Upoad event images
|
||||
*/
|
||||
Route::post('/upload_image', [
|
||||
'as' => 'postUploadEventImage',
|
||||
'uses' => 'EventController@postUploadEventImage'
|
||||
'as' => 'postUploadEventImage',
|
||||
'uses' => 'EventController@postUploadEventImage',
|
||||
]);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Event Management Stuff
|
||||
*/
|
||||
Route::group(array('prefix' => 'event'), function() {
|
||||
Route::group(['prefix' => 'event'], function () {
|
||||
|
||||
/*
|
||||
* -------
|
||||
* Dashboard
|
||||
* -------
|
||||
*/
|
||||
Route::get('{event_id}/dashboard/', array(
|
||||
'as' => 'showEventDashboard',
|
||||
'uses' => 'EventDashboardController@showDashboard')
|
||||
Route::get('{event_id}/dashboard/', [
|
||||
'as' => 'showEventDashboard',
|
||||
'uses' => 'EventDashboardController@showDashboard', ]
|
||||
);
|
||||
|
||||
Route::get('{event_id}', function($event_id) {
|
||||
Route::get('{event_id}', function ($event_id) {
|
||||
return Redirect::route('showEventDashboard', [
|
||||
'event_id' => $event_id
|
||||
'event_id' => $event_id,
|
||||
]);
|
||||
});
|
||||
|
||||
/**
|
||||
/*
|
||||
* @todo Move to a controller
|
||||
*/
|
||||
Route::get('{event_id}/go_live', ['as' => 'MakeEventLive', function($event_id) {
|
||||
Route::get('{event_id}/go_live', ['as' => 'MakeEventLive', function ($event_id) {
|
||||
$event = \App\Models\Event::scope()->findOrFail($event_id);
|
||||
$event->is_live = 1;
|
||||
$event->save();
|
||||
\Session::flash('message', 'Event Successfully Made Live! You can undo this action in event settings page.');
|
||||
|
||||
return Redirect::route('showEventDashboard', [
|
||||
'event_id' => $event_id
|
||||
'event_id' => $event_id,
|
||||
]);
|
||||
}]);
|
||||
|
||||
|
|
@ -371,157 +351,152 @@ Route::group(array('middleware' => ['auth', 'first.run']), function() {
|
|||
* Tickets
|
||||
* -------
|
||||
*/
|
||||
Route::get('{event_id}/tickets/', array(
|
||||
'as' => 'showEventTickets',
|
||||
'uses' => 'EventTicketsController@showTickets'
|
||||
));
|
||||
Route::get('{event_id}/tickets/edit/{ticket_id}', array(
|
||||
'as' => 'showEditTicket',
|
||||
'uses' => 'EventTicketsController@showEditTicket'
|
||||
));
|
||||
Route::post('{event_id}/tickets/edit/{ticket_id}', array(
|
||||
'as' => 'postEditTicket',
|
||||
'uses' => 'EventTicketsController@postEditTicket'
|
||||
));
|
||||
Route::get('{event_id}/tickets/create', array(
|
||||
'as' => 'showCreateTicket',
|
||||
'uses' => 'EventTicketsController@showCreateTicket'
|
||||
));
|
||||
Route::post('{event_id}/tickets/create', array(
|
||||
'as' => 'postCreateTicket',
|
||||
'uses' => 'EventTicketsController@postCreateTicket'
|
||||
));
|
||||
Route::post('{event_id}/tickets/delete', array(
|
||||
'as' => 'postDeleteTicket',
|
||||
'uses' => 'EventTicketsController@postDeleteTicket'
|
||||
));
|
||||
Route::post('{event_id}/tickets/pause', array(
|
||||
'as' => 'postPauseTicket',
|
||||
'uses' => 'EventTicketsController@postPauseTicket'
|
||||
));
|
||||
Route::get('{event_id}/tickets/', [
|
||||
'as' => 'showEventTickets',
|
||||
'uses' => 'EventTicketsController@showTickets',
|
||||
]);
|
||||
Route::get('{event_id}/tickets/edit/{ticket_id}', [
|
||||
'as' => 'showEditTicket',
|
||||
'uses' => 'EventTicketsController@showEditTicket',
|
||||
]);
|
||||
Route::post('{event_id}/tickets/edit/{ticket_id}', [
|
||||
'as' => 'postEditTicket',
|
||||
'uses' => 'EventTicketsController@postEditTicket',
|
||||
]);
|
||||
Route::get('{event_id}/tickets/create', [
|
||||
'as' => 'showCreateTicket',
|
||||
'uses' => 'EventTicketsController@showCreateTicket',
|
||||
]);
|
||||
Route::post('{event_id}/tickets/create', [
|
||||
'as' => 'postCreateTicket',
|
||||
'uses' => 'EventTicketsController@postCreateTicket',
|
||||
]);
|
||||
Route::post('{event_id}/tickets/delete', [
|
||||
'as' => 'postDeleteTicket',
|
||||
'uses' => 'EventTicketsController@postDeleteTicket',
|
||||
]);
|
||||
Route::post('{event_id}/tickets/pause', [
|
||||
'as' => 'postPauseTicket',
|
||||
'uses' => 'EventTicketsController@postPauseTicket',
|
||||
]);
|
||||
|
||||
/*
|
||||
* Ticket questions
|
||||
*/
|
||||
Route::get('{event_id}/tickets/questions', [
|
||||
'as' => 'showTicketQuestions',
|
||||
'uses' => 'EventTicketQuestionsController@showQuestions'
|
||||
'as' => 'showTicketQuestions',
|
||||
'uses' => 'EventTicketQuestionsController@showQuestions',
|
||||
]);
|
||||
Route::post('{event_id}/tickets/questions/create', [
|
||||
'as' => 'postCreateQuestion',
|
||||
'uses' => 'EventTicketQuestionsController@postCreateQuestion'
|
||||
'as' => 'postCreateQuestion',
|
||||
'uses' => 'EventTicketQuestionsController@postCreateQuestion',
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* -------
|
||||
* Attendees
|
||||
* -------
|
||||
*/
|
||||
Route::get('{event_id}/attendees/', array(
|
||||
'as' => 'showEventAttendees',
|
||||
'uses' => 'EventAttendeesController@showAttendees'
|
||||
));
|
||||
Route::get('{event_id}/attendees/', [
|
||||
'as' => 'showEventAttendees',
|
||||
'uses' => 'EventAttendeesController@showAttendees',
|
||||
]);
|
||||
|
||||
Route::get('{event_id}/attendees/message', [
|
||||
'as' => 'showMessageAttendees',
|
||||
'uses' => 'EventAttendeesController@showMessageAttendees'
|
||||
'as' => 'showMessageAttendees',
|
||||
'uses' => 'EventAttendeesController@showMessageAttendees',
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/attendees/message', [
|
||||
'as' => 'postMessageAttendees',
|
||||
'uses' => 'EventAttendeesController@postMessageAttendees'
|
||||
'as' => 'postMessageAttendees',
|
||||
'uses' => 'EventAttendeesController@postMessageAttendees',
|
||||
]);
|
||||
|
||||
Route::get('{event_id}/attendees/single_message', [
|
||||
'as' => 'showMessageAttendee',
|
||||
'uses' => 'EventAttendeesController@showMessageAttendee'
|
||||
'as' => 'showMessageAttendee',
|
||||
'uses' => 'EventAttendeesController@showMessageAttendee',
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/attendees/single_message', [
|
||||
'as' => 'postMessageAttendee',
|
||||
'uses' => 'EventAttendeesController@postMessageAttendee'
|
||||
'as' => 'postMessageAttendee',
|
||||
'uses' => 'EventAttendeesController@postMessageAttendee',
|
||||
]);
|
||||
|
||||
|
||||
Route::get('{event_id}/attendees/create', [
|
||||
'as' => 'showCreateAttendee',
|
||||
'uses' => 'EventAttendeesController@showCreateAttendee'
|
||||
'as' => 'showCreateAttendee',
|
||||
'uses' => 'EventAttendeesController@showCreateAttendee',
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/attendees/create', [
|
||||
'as' => 'postCreateAttendee',
|
||||
'uses' => 'EventAttendeesController@postCreateAttendee'
|
||||
'as' => 'postCreateAttendee',
|
||||
'uses' => 'EventAttendeesController@postCreateAttendee',
|
||||
]);
|
||||
|
||||
Route::get('{event_id}/attendees/print', [
|
||||
'as' => 'showPrintAttendees',
|
||||
'uses' => 'EventAttendeesController@showPrintAttendees'
|
||||
'as' => 'showPrintAttendees',
|
||||
'uses' => 'EventAttendeesController@showPrintAttendees',
|
||||
]);
|
||||
|
||||
Route::get('{event_id}/attendees/export/{export_as?}', [
|
||||
'as' => 'showExportAttendees',
|
||||
'uses' => 'EventAttendeesController@showExportAttendees'
|
||||
'as' => 'showExportAttendees',
|
||||
'uses' => 'EventAttendeesController@showExportAttendees',
|
||||
]);
|
||||
|
||||
Route::get('{event_id}/attendees/{attendee_id}/edit', [
|
||||
'as' => 'showEditAttendee',
|
||||
'uses' => 'EventAttendeesController@showEditAttendee'
|
||||
'as' => 'showEditAttendee',
|
||||
'uses' => 'EventAttendeesController@showEditAttendee',
|
||||
]);
|
||||
Route::post('{event_id}/attendees/{attendee_id}/edit', [
|
||||
'as' => 'postEditAttendee',
|
||||
'uses' => 'EventAttendeesController@postEditAttendee'
|
||||
'as' => 'postEditAttendee',
|
||||
'uses' => 'EventAttendeesController@postEditAttendee',
|
||||
]);
|
||||
|
||||
Route::get('{event_id}/attendees/{attendee_id}/cancel', [
|
||||
'as' => 'showCancelAttendee',
|
||||
'uses' => 'EventAttendeesController@showCancelAttendee'
|
||||
'as' => 'showCancelAttendee',
|
||||
'uses' => 'EventAttendeesController@showCancelAttendee',
|
||||
]);
|
||||
Route::post('{event_id}/attendees/{attendee_id}/cancel', [
|
||||
'as' => 'postCancelAttendee',
|
||||
'uses' => 'EventAttendeesController@postCancelAttendee'
|
||||
'as' => 'postCancelAttendee',
|
||||
'uses' => 'EventAttendeesController@postCancelAttendee',
|
||||
]);
|
||||
|
||||
|
||||
/*
|
||||
* -------
|
||||
* Orders
|
||||
* -------
|
||||
*/
|
||||
Route::get('{event_id}/orders/', array(
|
||||
'as' => 'showEventOrders',
|
||||
'uses' => 'EventOrdersController@showOrders'
|
||||
));
|
||||
Route::get('{event_id}/orders/', [
|
||||
'as' => 'showEventOrders',
|
||||
'uses' => 'EventOrdersController@showOrders',
|
||||
]);
|
||||
|
||||
Route::get('order/{order_id}', array(
|
||||
'as' => 'showManageOrder',
|
||||
'uses' => 'EventOrdersController@manageOrder'
|
||||
));
|
||||
Route::get('order/{order_id}', [
|
||||
'as' => 'showManageOrder',
|
||||
'uses' => 'EventOrdersController@manageOrder',
|
||||
]);
|
||||
|
||||
Route::get('order/{order_id}/cancel', array(
|
||||
'as' => 'showCancelOrder',
|
||||
'uses' => 'EventOrdersController@showCancelOrder'
|
||||
));
|
||||
Route::get('order/{order_id}/cancel', [
|
||||
'as' => 'showCancelOrder',
|
||||
'uses' => 'EventOrdersController@showCancelOrder',
|
||||
]);
|
||||
|
||||
Route::post('order/{order_id}/cancel', array(
|
||||
'as' => 'postCancelOrder',
|
||||
'uses' => 'EventOrdersController@postCancelOrder'
|
||||
));
|
||||
Route::post('order/{order_id}/cancel', [
|
||||
'as' => 'postCancelOrder',
|
||||
'uses' => 'EventOrdersController@postCancelOrder',
|
||||
]);
|
||||
|
||||
Route::get('{event_id}/orders/export/{export_as?}', [
|
||||
'as' => 'showExportOrders',
|
||||
'uses' => 'EventOrdersController@showExportOrders'
|
||||
'as' => 'showExportOrders',
|
||||
'uses' => 'EventOrdersController@showExportOrders',
|
||||
]);
|
||||
Route::get('{event_id}/orders/message', [
|
||||
'as' => 'showMessageOrder',
|
||||
'uses' => 'EventOrdersController@showMessageOrder'
|
||||
'as' => 'showMessageOrder',
|
||||
'uses' => 'EventOrdersController@showMessageOrder',
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/orders/message', [
|
||||
'as' => 'postMessageOrder',
|
||||
'uses' => 'EventOrdersController@postMessageOrder'
|
||||
'as' => 'postMessageOrder',
|
||||
'uses' => 'EventOrdersController@postMessageOrder',
|
||||
]);
|
||||
|
||||
/*
|
||||
|
|
@ -529,102 +504,88 @@ Route::group(array('middleware' => ['auth', 'first.run']), function() {
|
|||
* Edit Event
|
||||
* -------
|
||||
*/
|
||||
Route::post('{event_id}/customize', array(
|
||||
'as' => 'postEditEvent',
|
||||
'uses' => 'EventController@postEditEvent'
|
||||
));
|
||||
Route::post('{event_id}/customize', [
|
||||
'as' => 'postEditEvent',
|
||||
'uses' => 'EventController@postEditEvent',
|
||||
]);
|
||||
|
||||
/*
|
||||
* -------
|
||||
* Customize Design etc.
|
||||
* -------
|
||||
*/
|
||||
Route::get('{event_id}/customize', array(
|
||||
'as' => 'showEventCustomize',
|
||||
'uses' => 'EventCustomizeController@showCustomize'
|
||||
));
|
||||
|
||||
Route::get('{event_id}/customize/{tab?}', array(
|
||||
'as' => 'showEventCustomizeTab',
|
||||
'uses' => 'EventCustomizeController@showCustomize'
|
||||
));
|
||||
|
||||
|
||||
|
||||
Route::post('{event_id}/customize/order_page', array(
|
||||
'as' => 'postEditEventOrderPage',
|
||||
'uses' => 'EventCustomizeController@postEditEventOrderPage'
|
||||
));
|
||||
Route::post('{event_id}/customize/design', array(
|
||||
'as' => 'postEditEventDesign',
|
||||
'uses' => 'EventCustomizeController@postEditEventDesign'
|
||||
));
|
||||
Route::post('{event_id}/customize/social', array(
|
||||
'as' => 'postEditEventSocial',
|
||||
'uses' => 'EventCustomizeController@postEditEventSocial'
|
||||
));
|
||||
|
||||
Route::post('{event_id}/customize/fees', array(
|
||||
'as' => 'postEditEventFees',
|
||||
'uses' => 'EventCustomizeController@postEditEventFees'
|
||||
));
|
||||
Route::get('{event_id}/customize', [
|
||||
'as' => 'showEventCustomize',
|
||||
'uses' => 'EventCustomizeController@showCustomize',
|
||||
]);
|
||||
|
||||
Route::get('{event_id}/customize/{tab?}', [
|
||||
'as' => 'showEventCustomizeTab',
|
||||
'uses' => 'EventCustomizeController@showCustomize',
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/customize/order_page', [
|
||||
'as' => 'postEditEventOrderPage',
|
||||
'uses' => 'EventCustomizeController@postEditEventOrderPage',
|
||||
]);
|
||||
Route::post('{event_id}/customize/design', [
|
||||
'as' => 'postEditEventDesign',
|
||||
'uses' => 'EventCustomizeController@postEditEventDesign',
|
||||
]);
|
||||
Route::post('{event_id}/customize/social', [
|
||||
'as' => 'postEditEventSocial',
|
||||
'uses' => 'EventCustomizeController@postEditEventSocial',
|
||||
]);
|
||||
|
||||
Route::post('{event_id}/customize/fees', [
|
||||
'as' => 'postEditEventFees',
|
||||
'uses' => 'EventCustomizeController@postEditEventFees',
|
||||
]);
|
||||
|
||||
/*
|
||||
* -------
|
||||
* Check In App
|
||||
* -------
|
||||
*/
|
||||
Route::get('{event_id}/check_in', array(
|
||||
'as' => 'showChechIn',
|
||||
'uses' => 'EventCheckInController@showCheckIn'
|
||||
));
|
||||
Route::post('{event_id}/check_in/search', array(
|
||||
'as' => 'postCheckInSearch',
|
||||
'uses' => 'EventCheckInController@postCheckInSearch'
|
||||
));
|
||||
Route::post('{event_id}/check_in/', array(
|
||||
'as' => 'postCheckInAttendee',
|
||||
'uses' => 'EventCheckInController@postCheckInAttendee'
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
Route::get('{event_id}/check_in', [
|
||||
'as' => 'showChechIn',
|
||||
'uses' => 'EventCheckInController@showCheckIn',
|
||||
]);
|
||||
Route::post('{event_id}/check_in/search', [
|
||||
'as' => 'postCheckInSearch',
|
||||
'uses' => 'EventCheckInController@postCheckInSearch',
|
||||
]);
|
||||
Route::post('{event_id}/check_in/', [
|
||||
'as' => 'postCheckInAttendee',
|
||||
'uses' => 'EventCheckInController@postCheckInAttendee',
|
||||
]);
|
||||
|
||||
/*
|
||||
* -------
|
||||
* Promote
|
||||
* -------
|
||||
*/
|
||||
Route::get('{event_id}/promote', array(
|
||||
'as' => 'showEventPromote',
|
||||
'uses' => 'EventPromoteController@showPromote'
|
||||
));
|
||||
Route::get('{event_id}/promote', [
|
||||
'as' => 'showEventPromote',
|
||||
'uses' => 'EventPromoteController@showPromote',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Route::post('queue/push', function() {
|
||||
Route::post('queue/push', function () {
|
||||
|
||||
// set_time_limit(300);
|
||||
|
||||
return Queue::marshal();
|
||||
});
|
||||
|
||||
|
||||
Route::get('/', function() {
|
||||
Route::get('/', function () {
|
||||
|
||||
return Redirect::route('showSelectOrganiser');
|
||||
});
|
||||
|
||||
|
||||
Route::get('/terms_and_conditions', ['as' => 'termsAndConditions', function() {
|
||||
Route::get('/terms_and_conditions', ['as' => 'termsAndConditions', function () {
|
||||
|
||||
return 'TODO: add terms and cond';
|
||||
//return View::make('Public.Website.Terms_and_Cond');
|
||||
}]);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,38 +1,43 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Attendize\Utils;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use \App\Attendize\Utils;
|
||||
|
||||
class Account extends MyBaseModel {
|
||||
class Account extends MyBaseModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
|
||||
protected $rules = [
|
||||
'first_name' => ['required'],
|
||||
'last_name' => ['required'],
|
||||
'email' => ['required', 'email']
|
||||
'last_name' => ['required'],
|
||||
'email' => ['required', 'email'],
|
||||
];
|
||||
|
||||
|
||||
protected $messages = [];
|
||||
|
||||
public function users() {
|
||||
|
||||
public function users()
|
||||
{
|
||||
return $this->hasMany('\App\Models\User');
|
||||
}
|
||||
|
||||
public function orders() {
|
||||
|
||||
public function orders()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Order');
|
||||
}
|
||||
|
||||
public function currency() {
|
||||
|
||||
public function currency()
|
||||
{
|
||||
return $this->hasOne('\App\Models\Currency');
|
||||
}
|
||||
|
||||
public function getStripeApiKeyAttribute() {
|
||||
if(Utils::isAttendize()) {
|
||||
public function getStripeApiKeyAttribute()
|
||||
{
|
||||
if (Utils::isAttendize()) {
|
||||
return $this->stripe_access_token;
|
||||
}
|
||||
|
||||
return $this->stripe_secret_key;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of Activity
|
||||
* Description of Activity.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class Activity extends \Illuminate\Database\Eloquent\Model {
|
||||
|
||||
class Activity extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
class Affiliate extends \Illuminate\Database\Eloquent\Model {
|
||||
protected $fillable = array('name', 'visits', 'tickets_sold', 'event_id', 'account_id', 'sales_volume');
|
||||
|
||||
public function getDates() {
|
||||
return array('created_at', 'updated_at');
|
||||
class Affiliate extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
protected $fillable = ['name', 'visits', 'tickets_sold', 'event_id', 'account_id', 'sales_volume'];
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at'];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
|
|
@ -7,52 +9,58 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||
*/
|
||||
|
||||
/**
|
||||
* Description of Attendees
|
||||
* Description of Attendees.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class Attendee extends MyBaseModel {
|
||||
class Attendee extends MyBaseModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
public function order(){
|
||||
|
||||
public function order()
|
||||
{
|
||||
return$this->belongsTo('\App\Models\Order');
|
||||
}
|
||||
|
||||
public function ticket() {
|
||||
|
||||
public function ticket()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Ticket');
|
||||
}
|
||||
|
||||
public function event() {
|
||||
return $this->belongsTo('\App\Models\Event');
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Event');
|
||||
}
|
||||
|
||||
|
||||
public function scopeWithoutCancelled($query) {
|
||||
|
||||
public function scopeWithoutCancelled($query)
|
||||
{
|
||||
return $query->where('attendees.is_cancelled', '=', 0);
|
||||
}
|
||||
|
||||
public function getFullNameAttribute() {
|
||||
|
||||
public function getFullNameAttribute()
|
||||
{
|
||||
return $this->first_name.' '.$this->last_name;
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
//
|
||||
// public function getReferenceAttribute() {
|
||||
// return $this->order->order_reference
|
||||
// }
|
||||
|
||||
public function getDates() {
|
||||
return array('created_at', 'updated_at', 'arrival_time');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a private referennce number for the attendee. Use for checking in the attendee.
|
||||
*/
|
||||
public static function boot() {
|
||||
parent::boot();
|
||||
|
||||
static::creating(function($order) {
|
||||
$order->private_reference_number = str_pad(rand(0, pow(10, 9)-1), 9, '0', STR_PAD_LEFT);
|
||||
});
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'arrival_time'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a private referennce number for the attendee. Use for checking in the attendee.
|
||||
*/
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function ($order) {
|
||||
$order->private_reference_number = str_pad(rand(0, pow(10, 9) - 1), 9, '0', STR_PAD_LEFT);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,25 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of Currency
|
||||
* Description of Currency.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class Currency extends \Illuminate\Database\Eloquent\Model {
|
||||
public $timestamps = false;
|
||||
protected $softDelete = false;
|
||||
|
||||
protected $table = 'currencies';
|
||||
class Currency extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
protected $softDelete = false;
|
||||
|
||||
protected $table = 'currencies';
|
||||
|
||||
public function event() {
|
||||
return $this->belongsTo('\App\Models\Event');
|
||||
}
|
||||
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Event');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of DateFormat
|
||||
* Description of DateFormat.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class DateFormat extends \Illuminate\Database\Eloquent\Model {
|
||||
|
||||
class DateFormat extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
protected $softDelete = false;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,20 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of DateTimeFormat
|
||||
* Description of DateTimeFormat.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class DateTimeFormat extends \Illuminate\Database\Eloquent\Model {
|
||||
|
||||
class DateTimeFormat extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
protected $table = 'datetime_formats';
|
||||
|
||||
|
||||
public $timestamps = false;
|
||||
protected $softDelete = false;
|
||||
protected $softDelete = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of DiscountCode
|
||||
* Description of DiscountCode.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class DiscountCode extends \Illuminate\Database\Eloquent\Model {
|
||||
class DiscountCode extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
//put your code here
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,112 +1,136 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Str, URL;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Str;
|
||||
use URL;
|
||||
|
||||
class Event extends MyBaseModel {
|
||||
|
||||
class Event extends MyBaseModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $rules = array(
|
||||
'title' => array('required'),
|
||||
'description' => array('required'),
|
||||
'location_venue_name' => array('required_without:venue_name_full'),
|
||||
'venue_name_full' => array('required_without:location_venue_name'),
|
||||
'start_date' => array('required'),
|
||||
'end_date' => array('required'),
|
||||
'organiser_name' => array('required_without:organiser_id'),
|
||||
'event_image' => ['mimes:jpeg,jpg,png', 'max:3000']
|
||||
);
|
||||
protected $messages = array(
|
||||
'title.required' => 'You must at least give a title for your event.',
|
||||
'organiser_name.required_without' => 'Please create an organiser or select an existing organiser.',
|
||||
'event_image.mimes' => 'Please ensure you are uploading an image (JPG, PNG, JPEG)',
|
||||
'event_image.max' => 'Pleae ensure the image is not larger then 3MB',
|
||||
'location_venue_name.required_without' => 'Please enter a venue for your event',
|
||||
'venue_name_full.required_without' => 'Please enter a venue for your event'
|
||||
);
|
||||
|
||||
public function questions() {
|
||||
return $this->belongsToMany('\App\Models\Question', 'event_question');
|
||||
protected $rules = [
|
||||
'title' => ['required'],
|
||||
'description' => ['required'],
|
||||
'location_venue_name' => ['required_without:venue_name_full'],
|
||||
'venue_name_full' => ['required_without:location_venue_name'],
|
||||
'start_date' => ['required'],
|
||||
'end_date' => ['required'],
|
||||
'organiser_name' => ['required_without:organiser_id'],
|
||||
'event_image' => ['mimes:jpeg,jpg,png', 'max:3000'],
|
||||
];
|
||||
protected $messages = [
|
||||
'title.required' => 'You must at least give a title for your event.',
|
||||
'organiser_name.required_without' => 'Please create an organiser or select an existing organiser.',
|
||||
'event_image.mimes' => 'Please ensure you are uploading an image (JPG, PNG, JPEG)',
|
||||
'event_image.max' => 'Pleae ensure the image is not larger then 3MB',
|
||||
'location_venue_name.required_without' => 'Please enter a venue for your event',
|
||||
'venue_name_full.required_without' => 'Please enter a venue for your event',
|
||||
];
|
||||
|
||||
public function questions()
|
||||
{
|
||||
return $this->belongsToMany('\App\Models\Question', 'event_question');
|
||||
}
|
||||
|
||||
public function attendees() {
|
||||
public function attendees()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Attendee');
|
||||
}
|
||||
|
||||
public function images() {
|
||||
|
||||
public function images()
|
||||
{
|
||||
return $this->hasMany('\App\Models\EventImage');
|
||||
}
|
||||
public function messages() {
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Message')->orderBy('created_at', 'DESC');
|
||||
}
|
||||
|
||||
public function tickets() {
|
||||
public function tickets()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Ticket');
|
||||
}
|
||||
|
||||
public function stats() {
|
||||
|
||||
public function stats()
|
||||
{
|
||||
return $this->hasMany('\App\Models\EventStats');
|
||||
}
|
||||
|
||||
public function affiliates() {
|
||||
|
||||
public function affiliates()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Affiliate');
|
||||
}
|
||||
|
||||
public function orders() {
|
||||
public function orders()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Order');
|
||||
}
|
||||
|
||||
public function account() {
|
||||
public function account()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Account');
|
||||
}
|
||||
|
||||
public function currency() {
|
||||
public function currency()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Currency');
|
||||
}
|
||||
|
||||
public function organiser() {
|
||||
public function organiser()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Organiser');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Getters & Setters
|
||||
*/
|
||||
|
||||
public function getEmbedUrlAttribute() {
|
||||
public function getEmbedUrlAttribute()
|
||||
{
|
||||
return str_replace(['http:', 'https:'], '', route('showEmbeddedEventPage', ['event' => $this->id]));
|
||||
}
|
||||
|
||||
public function getFixedFeeAttribute() {
|
||||
public function getFixedFeeAttribute()
|
||||
{
|
||||
return config('attendize.ticket_booking_fee_fixed') + $this->organiser_fee_fixed;
|
||||
}
|
||||
public function getPercentageFeeAttribute() {
|
||||
|
||||
public function getPercentageFeeAttribute()
|
||||
{
|
||||
return config('attendize.ticket_booking_fee_percentage') + $this->organiser_fee_percentage;
|
||||
}
|
||||
|
||||
public function getHappeningNowAttribute() {
|
||||
|
||||
public function getHappeningNowAttribute()
|
||||
{
|
||||
return Carbon::now()->between($this->start_date, $this->end_date);
|
||||
}
|
||||
|
||||
public function getCurrencySymbolAttribute() {
|
||||
|
||||
public function getCurrencySymbolAttribute()
|
||||
{
|
||||
return $this->currency->symbol_left;
|
||||
}
|
||||
public function getCurrencyCodeAttribute() {
|
||||
|
||||
public function getCurrencyCodeAttribute()
|
||||
{
|
||||
return $this->currency->code;
|
||||
}
|
||||
|
||||
public function getEmbedHtmlCodeAttribute () {
|
||||
|
||||
public function getEmbedHtmlCodeAttribute()
|
||||
{
|
||||
return "<!--Attendize.com Ticketing Embed Code-->
|
||||
<iframe style='overflow:hidden; min-height: 350px;' frameBorder='0' seamless='seamless' width='100%' height='100%' src='".$this->embed_url."' vspace='0' hspace='0' scrolling='auto' allowtransparency='true'></iframe>
|
||||
<!--/Attendize.com Ticketing Embed Code-->";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Get a usable address for embedding Google Maps
|
||||
*/
|
||||
public function getMapAddressAttribute() {
|
||||
|
||||
public function getMapAddressAttribute()
|
||||
{
|
||||
$string = $this->venue.','
|
||||
.$this->location_street_number.','
|
||||
.$this->location_address_line_1.','
|
||||
|
|
@ -114,26 +138,27 @@ class Event extends MyBaseModel {
|
|||
.$this->location_state.','
|
||||
.$this->location_post_code.','
|
||||
.$this->location_country;
|
||||
|
||||
|
||||
return urlencode($string);
|
||||
|
||||
}
|
||||
|
||||
public function getBgImageUrlAttribute() {
|
||||
|
||||
public function getBgImageUrlAttribute()
|
||||
{
|
||||
return URL::to('/').'/'.$this->bg_image_path;
|
||||
}
|
||||
|
||||
public function getEventUrlAttribute() {
|
||||
|
||||
public function getEventUrlAttribute()
|
||||
{
|
||||
return URL::to('/').'/e/'.$this->id.'/'.Str::slug($this->title);
|
||||
}
|
||||
|
||||
|
||||
public function getSalesAndFeesVoulmeAttribute() {
|
||||
public function getSalesAndFeesVoulmeAttribute()
|
||||
{
|
||||
return $this->sales_volume + $this->organiser_fees_volume;
|
||||
}
|
||||
|
||||
public function getDates() {
|
||||
return array('created_at', 'updated_at', 'start_date', 'end_date');
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'start_date', 'end_date'];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of EventImage
|
||||
* Description of EventImage.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class EventImage extends MyBaseModel {
|
||||
|
||||
|
||||
class EventImage extends MyBaseModel
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,84 +1,84 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
use DB, Cookie;
|
||||
use App\Models\Ticket;
|
||||
namespace App\Models;
|
||||
|
||||
class EventStats extends \Illuminate\Database\Eloquent\Model {
|
||||
use Cookie;
|
||||
use DB;
|
||||
|
||||
class EventStats extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
public static $unguarded = true;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @todo This shouldn't be in a view.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Update the amount of revenue a ticket has earned
|
||||
*
|
||||
* @param int $ticket_id
|
||||
* Update the amount of revenue a ticket has earned.
|
||||
*
|
||||
* @param int $ticket_id
|
||||
* @param float $amount
|
||||
* @param bool $deduct
|
||||
* @param bool $deduct
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function updateTicketRevenue($ticket_id, $amount, $deduct = FALSE) {
|
||||
public function updateTicketRevenue($ticket_id, $amount, $deduct = false)
|
||||
{
|
||||
$ticket = Ticket::find($ticket_id);
|
||||
|
||||
if($deduct) {
|
||||
|
||||
if ($deduct) {
|
||||
$amount = $amount * -1;
|
||||
}
|
||||
|
||||
|
||||
$ticket->ticket_revenue = $ticket->ticket_revenue + $amount;
|
||||
|
||||
|
||||
return $ticket->save();
|
||||
}
|
||||
|
||||
public function updateViewCount($event_id) {
|
||||
|
||||
public function updateViewCount($event_id)
|
||||
{
|
||||
$stats = $this->firstOrNew([
|
||||
'event_id' => $event_id,
|
||||
'date' => DB::raw('CURDATE()')
|
||||
'date' => DB::raw('CURDATE()'),
|
||||
]);
|
||||
|
||||
|
||||
$cookie_name = 'visitTrack_'.$event_id.'_'.date('dmy');
|
||||
|
||||
if(!Cookie::get($cookie_name)) {
|
||||
|
||||
if (!Cookie::get($cookie_name)) {
|
||||
Cookie::queue($cookie_name, true, 60 * 24 * 14);
|
||||
++$stats->unique_views;
|
||||
}
|
||||
|
||||
|
||||
++$stats->views;
|
||||
|
||||
return $stats->save();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* TODO: Missing amount?
|
||||
*/
|
||||
public function updateSalesVolume($event_id) {
|
||||
public function updateSalesVolume($event_id)
|
||||
{
|
||||
$stats = $this->firstOrNew([
|
||||
'event_id' => $event_id,
|
||||
'date' => DB::raw('CURDATE()')
|
||||
'date' => DB::raw('CURDATE()'),
|
||||
]);
|
||||
|
||||
|
||||
$stats->sales_volume = $stats->sales_volume + $amount;
|
||||
|
||||
|
||||
return $stats->save();
|
||||
}
|
||||
|
||||
|
||||
public function updateTicketsSoldCount($event_id, $count) {
|
||||
|
||||
public function updateTicketsSoldCount($event_id, $count)
|
||||
{
|
||||
$stats = $this->firstOrNew([
|
||||
'event_id' => $event_id,
|
||||
'date' => DB::raw('CURDATE()')
|
||||
'date' => DB::raw('CURDATE()'),
|
||||
]);
|
||||
|
||||
|
||||
$stats->increment('tickets_sold', $count);
|
||||
|
||||
return $stats->save();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +1,36 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of Message
|
||||
* Description of Message.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class Message extends MyBaseModel {
|
||||
|
||||
public function event() {
|
||||
class Message extends MyBaseModel
|
||||
{
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Event');
|
||||
}
|
||||
|
||||
public function getRecipientsLabelAttribute() {
|
||||
if($this->recipients == 0) {
|
||||
|
||||
public function getRecipientsLabelAttribute()
|
||||
{
|
||||
if ($this->recipients == 0) {
|
||||
return 'All Attendees';
|
||||
}
|
||||
|
||||
|
||||
$ticket = Ticket::scope()->find($this->recipients);
|
||||
|
||||
return 'Ticket: '.$ticket->title;
|
||||
}
|
||||
|
||||
public function getDates() {
|
||||
return array('created_at', 'updated_at', 'sent_at');
|
||||
}
|
||||
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'sent_at'];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,26 +2,28 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use Auth,
|
||||
Validator;
|
||||
use Auth;
|
||||
use Validator;
|
||||
|
||||
/*
|
||||
* Adapted from: https://github.com/hillelcoren/invoice-ninja/blob/master/app/models/EntityModel.php
|
||||
*/
|
||||
|
||||
class MyBaseModel extends \Illuminate\Database\Eloquent\Model {
|
||||
|
||||
class MyBaseModel extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
protected $softDelete = true;
|
||||
public $timestamps = true;
|
||||
protected $rules = array();
|
||||
protected $messages = array();
|
||||
protected $rules = [];
|
||||
protected $messages = [];
|
||||
protected $errors;
|
||||
|
||||
public function validate($data) {
|
||||
public function validate($data)
|
||||
{
|
||||
$v = Validator::make($data, $this->rules, $this->messages);
|
||||
|
||||
if ($v->fails()) {
|
||||
$this->errors = $v->messages();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -29,30 +31,30 @@ class MyBaseModel extends \Illuminate\Database\Eloquent\Model {
|
|||
return true;
|
||||
}
|
||||
|
||||
public function errors($returnArray = TRUE) {
|
||||
public function errors($returnArray = true)
|
||||
{
|
||||
return $returnArray ? $this->errors->toArray() : $this->errors;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param int $account_id
|
||||
* @param int $user_id
|
||||
* @param int $account_id
|
||||
* @param int $user_id
|
||||
* @param bool $ignore_user_id
|
||||
*
|
||||
* @return \className
|
||||
*/
|
||||
public static function createNew($account_id = FALSE, $user_id = FALSE, $ignore_user_id = FALSE) {
|
||||
public static function createNew($account_id = false, $user_id = false, $ignore_user_id = false)
|
||||
{
|
||||
$className = get_called_class();
|
||||
$entity = new $className();
|
||||
|
||||
if (Auth::check()) {
|
||||
|
||||
if (!$ignore_user_id) {
|
||||
$entity->user_id = Auth::user()->id;
|
||||
}
|
||||
|
||||
$entity->account_id = Auth::user()->account_id;
|
||||
} else if ($account_id || $user_id) {
|
||||
|
||||
} elseif ($account_id || $user_id) {
|
||||
if ($user_id && !$ignore_user_id) {
|
||||
$entity->user_id = $user_id;
|
||||
}
|
||||
|
|
@ -65,16 +67,17 @@ class MyBaseModel extends \Illuminate\Database\Eloquent\Model {
|
|||
return $entity;
|
||||
}
|
||||
|
||||
public function getFormatedDate($field, $format = 'd-m-Y H:i') {
|
||||
return $this->$field === NULL ? NULL : date($format, strtotime($this->$field));
|
||||
public function getFormatedDate($field, $format = 'd-m-Y H:i')
|
||||
{
|
||||
return $this->$field === null ? null : date($format, strtotime($this->$field));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param int $accountId
|
||||
*/
|
||||
public function scopeScope($query, $accountId = false) {
|
||||
|
||||
public function scopeScope($query, $accountId = false)
|
||||
{
|
||||
|
||||
/*
|
||||
* GOD MODE - DON'T UNCOMMENT!
|
||||
* returning $query before adding the account_id condition will let you
|
||||
|
|
@ -82,18 +85,16 @@ class MyBaseModel extends \Illuminate\Database\Eloquent\Model {
|
|||
* //return $query;
|
||||
*/
|
||||
|
||||
|
||||
if (!$accountId) {
|
||||
$accountId = Auth::user()->account_id;
|
||||
}
|
||||
|
||||
$table = $this->getTable();
|
||||
|
||||
$query->where(function($query) use ($accountId, $table) {
|
||||
$query->whereRaw(\DB::raw('(' . $table . '.account_id = ' . $accountId . ')'));
|
||||
$query->where(function ($query) use ($accountId, $table) {
|
||||
$query->whereRaw(\DB::raw('('.$table.'.account_id = '.$accountId.')'));
|
||||
});
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,84 +2,94 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use File;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use PDF;
|
||||
use File;
|
||||
|
||||
class Order extends MyBaseModel {
|
||||
|
||||
class Order extends MyBaseModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
public $rules = [
|
||||
'order_first_name' => ['required'],
|
||||
'order_last_name' => ['required'],
|
||||
'order_email' => ['required', 'email'],
|
||||
'order_last_name' => ['required'],
|
||||
'order_email' => ['required', 'email'],
|
||||
];
|
||||
public $messages = [
|
||||
'order_first_name.required' => 'Please enter a valid first name',
|
||||
'order_last_name.required' => 'Please enter a valid last name',
|
||||
'order_email.email' => 'Please enter a valid email',
|
||||
'order_last_name.required' => 'Please enter a valid last name',
|
||||
'order_email.email' => 'Please enter a valid email',
|
||||
];
|
||||
|
||||
public function orderItems() {
|
||||
public function orderItems()
|
||||
{
|
||||
return $this->hasMany('\App\Models\OrderItem');
|
||||
}
|
||||
|
||||
public function attendees() {
|
||||
public function attendees()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Attendee');
|
||||
}
|
||||
|
||||
public function account() {
|
||||
public function account()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Account');
|
||||
}
|
||||
|
||||
public function event() {
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Event');
|
||||
}
|
||||
|
||||
public function tickets() {
|
||||
public function tickets()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Ticket');
|
||||
}
|
||||
|
||||
public function orderStatus() {
|
||||
public function orderStatus()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\OrderStatus');
|
||||
}
|
||||
|
||||
public function getOrganiserAmountAttribute() {
|
||||
public function getOrganiserAmountAttribute()
|
||||
{
|
||||
return $this->amount + $this->organiser_booking_fee;
|
||||
}
|
||||
|
||||
public function getTotalAmountAttribute() {
|
||||
public function getTotalAmountAttribute()
|
||||
{
|
||||
return $this->amount + $this->organiser_booking_fee + $this->booking_fee;
|
||||
}
|
||||
|
||||
public function getFullNameAttribute() {
|
||||
return $this->first_name . ' ' . $this->last_name;
|
||||
public function getFullNameAttribute()
|
||||
{
|
||||
return $this->first_name.' '.$this->last_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate and save the PDF tickets
|
||||
*
|
||||
* Generate and save the PDF tickets.
|
||||
*
|
||||
* @todo Move this from the order model
|
||||
* @return boolean
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function generatePdfTickets() {
|
||||
|
||||
public function generatePdfTickets()
|
||||
{
|
||||
$data = [
|
||||
'order' => $this,
|
||||
'event' => $this->event,
|
||||
'tickets' => $this->event->tickets,
|
||||
'attendees' => $this->attendees
|
||||
'order' => $this,
|
||||
'event' => $this->event,
|
||||
'tickets' => $this->event->tickets,
|
||||
'attendees' => $this->attendees,
|
||||
];
|
||||
|
||||
$pdf_file_path = public_path(config('attendize.event_pdf_tickets_path')) . '/' . $this->order_reference;
|
||||
$pdf_file = $pdf_file_path.'.pdf';
|
||||
|
||||
$pdf_file_path = public_path(config('attendize.event_pdf_tickets_path')).'/'.$this->order_reference;
|
||||
$pdf_file = $pdf_file_path.'.pdf';
|
||||
|
||||
if (file_exists($pdf_file)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!is_dir($pdf_file_path)) {
|
||||
|
||||
if (!is_dir($pdf_file_path)) {
|
||||
File::makeDirectory($pdf_file_path, 0777, true, true);
|
||||
}
|
||||
|
||||
|
|
@ -92,12 +102,12 @@ class Order extends MyBaseModel {
|
|||
return file_exists($pdf_file);
|
||||
}
|
||||
|
||||
public static function boot() {
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function($order) {
|
||||
$order->order_reference = strtoupper(str_random(5)) . date('jn');
|
||||
static::creating(function ($order) {
|
||||
$order->order_reference = strtoupper(str_random(5)).date('jn');
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,17 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of OrderItems
|
||||
* Description of OrderItems.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class OrderItem extends MyBaseModel {
|
||||
public $timestamps = false;
|
||||
|
||||
class OrderItem extends MyBaseModel
|
||||
{
|
||||
public $timestamps = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of OrderStatus
|
||||
* Description of OrderStatus.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class OrderStatus extends \Illuminate\Database\Eloquent\Model {
|
||||
|
||||
|
||||
class OrderStatus extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,55 +1,56 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Str;
|
||||
|
||||
class Organiser extends MyBaseModel {
|
||||
|
||||
protected $rules = array(
|
||||
'name' => array('required'),
|
||||
'email' => array('required', 'email'),
|
||||
'organiser_logo' => ['mimes:jpeg,jpg,png', 'max:10000']
|
||||
);
|
||||
protected $messages = array(
|
||||
'name.required' => 'You must at least give a name for the event organiser.',
|
||||
'organiser_logo.max' => 'Please upload an image smaller than 10Mb',
|
||||
'organiser_logo.size' => 'Please upload an image smaller than 10Mb',
|
||||
'organiser_logo.mimes' => 'Please select a valid image type (jpeg, jpg, png)'
|
||||
);
|
||||
|
||||
public function events() {
|
||||
class Organiser extends MyBaseModel
|
||||
{
|
||||
protected $rules = [
|
||||
'name' => ['required'],
|
||||
'email' => ['required', 'email'],
|
||||
'organiser_logo' => ['mimes:jpeg,jpg,png', 'max:10000'],
|
||||
];
|
||||
protected $messages = [
|
||||
'name.required' => 'You must at least give a name for the event organiser.',
|
||||
'organiser_logo.max' => 'Please upload an image smaller than 10Mb',
|
||||
'organiser_logo.size' => 'Please upload an image smaller than 10Mb',
|
||||
'organiser_logo.mimes' => 'Please select a valid image type (jpeg, jpg, png)',
|
||||
];
|
||||
|
||||
public function events()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Event');
|
||||
}
|
||||
|
||||
public function attendees() {
|
||||
|
||||
public function attendees()
|
||||
{
|
||||
return $this->hasManyThrough('\App\Models\Attendee', '\App\Models\Event');
|
||||
}
|
||||
|
||||
public function getFullLogoPathAttribute() {
|
||||
if($this->logo_path && (file_exists(config('attendize.cdn_url_user_assets').'/'.$this->logo_path) || file_exists(public_path($this->logo_path)))) {
|
||||
|
||||
public function getFullLogoPathAttribute()
|
||||
{
|
||||
if ($this->logo_path && (file_exists(config('attendize.cdn_url_user_assets').'/'.$this->logo_path) || file_exists(public_path($this->logo_path)))) {
|
||||
return config('attendize.cdn_url_user_assets').'/'.$this->logo_path;
|
||||
}
|
||||
|
||||
|
||||
return config('attendize.fallback_organiser_logo_url');
|
||||
}
|
||||
|
||||
public function getOrganiserUrlAttribute() {
|
||||
public function getOrganiserUrlAttribute()
|
||||
{
|
||||
return route('showOrganiserHome', [
|
||||
'organiser_id' => $this->id,
|
||||
'organiser_slug' => Str::slug($this->oraganiser_name)
|
||||
'organiser_id' => $this->id,
|
||||
'organiser_slug' => Str::slug($this->oraganiser_name),
|
||||
]);
|
||||
}
|
||||
|
||||
public function getOrganiserSalesVolumeAttribute() {
|
||||
public function getOrganiserSalesVolumeAttribute()
|
||||
{
|
||||
return $this->events->sum('sales_volume');
|
||||
}
|
||||
|
||||
|
||||
public function getDailyStats() {
|
||||
|
||||
|
||||
|
||||
public function getDailyStats()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of PaymentGateway
|
||||
* Description of PaymentGateway.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class PaymentGateway extends \Illuminate\Database\Eloquent\Model {
|
||||
class PaymentGateway extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
//put your code here
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,25 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* Description of Questions
|
||||
* Description of Questions.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class Question extends MyBaseModel {
|
||||
class Question extends MyBaseModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
public function events() {
|
||||
|
||||
public function events()
|
||||
{
|
||||
return $this->belongsToMany('\App\Models\Event');
|
||||
}
|
||||
|
||||
|
||||
public function question_types() {
|
||||
|
||||
public function question_types()
|
||||
{
|
||||
return $this->hasOne('\App\Models\QuestionType');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
class QuestionType extends \Illuminate\Database\Eloquent\Model {
|
||||
|
||||
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class QuestionType extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of ReservedTickets
|
||||
* Description of ReservedTickets.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class ReservedTickets extends \Illuminate\Database\Eloquent\Model {
|
||||
|
||||
|
||||
|
||||
class ReservedTickets extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,41 +1,47 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
|
||||
class Ticket extends MyBaseModel {
|
||||
class Ticket extends MyBaseModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
|
||||
public $rules = [
|
||||
'title' => array('required'),
|
||||
'price' => array('required', 'numeric', 'min:0'),
|
||||
'start_sale_date' => array('date'),
|
||||
'end_sale_date' => array('date', 'after:start_sale_date'),
|
||||
'quantity_available' => ['integer', 'min:0']
|
||||
'title' => ['required'],
|
||||
'price' => ['required', 'numeric', 'min:0'],
|
||||
'start_sale_date' => ['date'],
|
||||
'end_sale_date' => ['date', 'after:start_sale_date'],
|
||||
'quantity_available' => ['integer', 'min:0'],
|
||||
];
|
||||
public $messages = [
|
||||
'price.numeric' => 'The price must be a valid number (e.g 12.50)',
|
||||
'title.required' => 'You must at least give a title for your ticket. (e.g Early Bird)',
|
||||
'quantity_available.integer' => 'Please ensure the quantity available is a number.'
|
||||
'price.numeric' => 'The price must be a valid number (e.g 12.50)',
|
||||
'title.required' => 'You must at least give a title for your ticket. (e.g Early Bird)',
|
||||
'quantity_available.integer' => 'Please ensure the quantity available is a number.',
|
||||
];
|
||||
|
||||
public function event() {
|
||||
public function event()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Event');
|
||||
}
|
||||
|
||||
public function order() {
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsToMany('\App\Models\Order');
|
||||
}
|
||||
|
||||
public function questions() {
|
||||
public function questions()
|
||||
{
|
||||
return $this->belongsToMany('\App\Models\Question', 'ticket_question');
|
||||
}
|
||||
|
||||
public function reserved() {
|
||||
|
||||
|
||||
public function reserved()
|
||||
{
|
||||
}
|
||||
|
||||
public function scopeSoldOut($query) {
|
||||
public function scopeSoldOut($query)
|
||||
{
|
||||
$query->where('remaining_tickets', '=', 0);
|
||||
}
|
||||
|
||||
|
|
@ -43,104 +49,97 @@ class Ticket extends MyBaseModel {
|
|||
* Getters & Setters
|
||||
*/
|
||||
|
||||
public function getDates() {
|
||||
return array('created_at', 'updated_at', 'start_sale_date', 'end_sale_date');
|
||||
public function getDates()
|
||||
{
|
||||
return ['created_at', 'updated_at', 'start_sale_date', 'end_sale_date'];
|
||||
}
|
||||
|
||||
public function getQuantityRemainingAttribute() {
|
||||
|
||||
if(is_null($this->quantity_available)) {
|
||||
public function getQuantityRemainingAttribute()
|
||||
{
|
||||
if (is_null($this->quantity_available)) {
|
||||
return 9999; //Better way to do this?
|
||||
}
|
||||
|
||||
|
||||
return $this->quantity_available - ($this->quantity_sold + $this->quantity_reserved);
|
||||
}
|
||||
|
||||
public function getQuantityReservedAttribute() {
|
||||
|
||||
public function getQuantityReservedAttribute()
|
||||
{
|
||||
$reserved_total = \DB::table('reserved_tickets')
|
||||
->where('ticket_id', $this->id)
|
||||
->where('expires', '>', \Carbon::now())
|
||||
->sum('quantity_reserved');
|
||||
|
||||
|
||||
return $reserved_total;
|
||||
}
|
||||
|
||||
|
||||
public function getBookingFeeAttribute () {
|
||||
return (int)ceil($this->price) === 0 ? 0 : round(($this->price * (config('attendize.ticket_booking_fee_percentage') / 100)) + (config('attendize.ticket_booking_fee_fixed')), 2);
|
||||
|
||||
public function getBookingFeeAttribute()
|
||||
{
|
||||
return (int) ceil($this->price) === 0 ? 0 : round(($this->price * (config('attendize.ticket_booking_fee_percentage') / 100)) + (config('attendize.ticket_booking_fee_fixed')), 2);
|
||||
}
|
||||
|
||||
public function getOrganiserBookingFeeAttribute() {
|
||||
return (int)ceil($this->price) === 0 ? 0 : round(($this->price * ($this->event->organiser_fee_percentage / 100)) + ($this->event->organiser_fee_fixed), 2);
|
||||
|
||||
public function getOrganiserBookingFeeAttribute()
|
||||
{
|
||||
return (int) ceil($this->price) === 0 ? 0 : round(($this->price * ($this->event->organiser_fee_percentage / 100)) + ($this->event->organiser_fee_fixed), 2);
|
||||
}
|
||||
|
||||
public function getTotalBookingFeeAttribute() {
|
||||
|
||||
public function getTotalBookingFeeAttribute()
|
||||
{
|
||||
return $this->getBookingFeeAttribute() + $this->getOrganiserBookingFeeAttribute();
|
||||
}
|
||||
|
||||
public function getTotalPriceAttribute() {
|
||||
|
||||
public function getTotalPriceAttribute()
|
||||
{
|
||||
return $this->getTotalBookingFeeAttribute() + $this->price;
|
||||
}
|
||||
|
||||
public function getTicketMaxMinRangAttribute() {
|
||||
|
||||
public function getTicketMaxMinRangAttribute()
|
||||
{
|
||||
$range = [];
|
||||
|
||||
for($i=$this->min_per_person; $i<=$this->max_per_person; $i++) {
|
||||
|
||||
for ($i = $this->min_per_person; $i <= $this->max_per_person; $i++) {
|
||||
$range[] = [$i => $i];
|
||||
}
|
||||
|
||||
|
||||
return $range;
|
||||
}
|
||||
|
||||
|
||||
public function isFree() {
|
||||
return (int)ceil($this->price) === 0;
|
||||
public function isFree()
|
||||
{
|
||||
return (int) ceil($this->price) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the maximum figure to go to on dropdowns
|
||||
*
|
||||
* @return int
|
||||
|
||||
public function getMaxPerPersonMaxValueAttribute() {
|
||||
return $this->max_per_person === -1 ? config('attendize.max_tickets_per_person') : $this->max_per_person;
|
||||
}
|
||||
/**
|
||||
* Return the maximum figure to go to on dropdowns.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getSaleStatusAttribute() {
|
||||
|
||||
if ($this->start_sale_date !== NULL) {
|
||||
public function getSaleStatusAttribute()
|
||||
{
|
||||
if ($this->start_sale_date !== null) {
|
||||
if ($this->start_sale_date->isFuture()) {
|
||||
return config('attendize.ticket_status_before_sale_date');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($this->end_sale_date !== NULL) {
|
||||
if ($this->end_sale_date !== null) {
|
||||
if ($this->end_sale_date->isPast()) {
|
||||
return config('attendize.ticket_status_after_sale_date');
|
||||
}
|
||||
}
|
||||
|
||||
if ((int)$this->quantity_available > 0) {
|
||||
if ((int)$this->quantity_remaining <= 0) {
|
||||
if ((int) $this->quantity_available > 0) {
|
||||
if ((int) $this->quantity_remaining <= 0) {
|
||||
return config('attendize.ticket_status_sold_out');
|
||||
}
|
||||
}
|
||||
|
||||
if($this->event->start_date->lte(\Carbon::now())) {
|
||||
if ($this->event->start_date->lte(\Carbon::now())) {
|
||||
return config('attendize.ticket_status_off_sale');
|
||||
}
|
||||
|
||||
|
||||
return config('attendize.ticket_status_on_sale');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// public function setQuantityAvailableAttribute($value) {
|
||||
// $this->attributes['quantity_available'] = trim($value) == '' ? -1 : $value;
|
||||
|
|
@ -149,5 +148,4 @@ class Ticket extends MyBaseModel {
|
|||
// public function setMaxPerPersonAttribute($value) {
|
||||
// $this->attributes['max_per_person'] = trim($value) == '' ? -1 : $value;
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of TicketStatuses
|
||||
* Description of TicketStatuses.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class TicketStatus extends \Illuminate\Database\Eloquent\Model {
|
||||
class TicketStatus extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
//put your code here
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Eloquent\SoftDeletingTrait;
|
||||
namespace App\Models;
|
||||
|
||||
/*
|
||||
Attendize.com - Event Management & Ticketing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Description of Timezone
|
||||
* Description of Timezone.
|
||||
*
|
||||
* @author Dave
|
||||
*/
|
||||
class Timezone extends \Illuminate\Database\Eloquent\Model {
|
||||
class Timezone extends \Illuminate\Database\Eloquent\Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
protected $softDelete = false;
|
||||
protected $softDelete = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,16 @@
|
|||
<?php namespace App\Models;
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Auth\Authenticatable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Auth\Passwords\CanResetPassword;
|
||||
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
|
||||
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
|
||||
class User extends Model implements AuthenticatableContract, CanResetPasswordContract {
|
||||
|
||||
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
|
||||
{
|
||||
use Authenticatable, CanResetPassword, SoftDeletes;
|
||||
|
||||
/**
|
||||
|
|
@ -24,13 +25,15 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = array('password');
|
||||
protected $hidden = ['password'];
|
||||
|
||||
public function account() {
|
||||
public function account()
|
||||
{
|
||||
return $this->belongsTo('\App\Models\Account');
|
||||
}
|
||||
|
||||
public function activity() {
|
||||
public function activity()
|
||||
{
|
||||
return $this->hasMany('\App\Models\Activity');
|
||||
}
|
||||
|
||||
|
|
@ -39,7 +42,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getAuthIdentifier() {
|
||||
public function getAuthIdentifier()
|
||||
{
|
||||
return $this->getKey();
|
||||
}
|
||||
|
||||
|
|
@ -48,7 +52,8 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAuthPassword() {
|
||||
public function getAuthPassword()
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
|
|
@ -57,28 +62,32 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getReminderEmail() {
|
||||
public function getReminderEmail()
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function getRememberToken() {
|
||||
public function getRememberToken()
|
||||
{
|
||||
return $this->remember_token;
|
||||
}
|
||||
|
||||
public function setRememberToken($value) {
|
||||
public function setRememberToken($value)
|
||||
{
|
||||
$this->remember_token = $value;
|
||||
}
|
||||
|
||||
public function getRememberTokenName() {
|
||||
public function getRememberTokenName()
|
||||
{
|
||||
return 'remember_token';
|
||||
}
|
||||
|
||||
public static function boot() {
|
||||
|
||||
public static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
static::creating(function($user) {
|
||||
static::creating(function ($user) {
|
||||
$user->confirmation_code = str_random();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,19 +3,16 @@
|
|||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Request;
|
||||
use App\Models\Organiser;
|
||||
use Auth;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider {
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot() {
|
||||
|
||||
public function boot()
|
||||
{
|
||||
require app_path('Attendize/constants.php');
|
||||
}
|
||||
|
||||
|
|
@ -28,15 +25,10 @@ class AppServiceProvider extends ServiceProvider {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register() {
|
||||
|
||||
|
||||
|
||||
public function register()
|
||||
{
|
||||
$this->app->bind(
|
||||
'Illuminate\Contracts\Auth\Registrar', 'App\Services\Registrar'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,34 +1,35 @@
|
|||
<?php namespace App\Providers;
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Bus\Dispatcher;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BusServiceProvider extends ServiceProvider {
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @param \Illuminate\Bus\Dispatcher $dispatcher
|
||||
* @return void
|
||||
*/
|
||||
public function boot(Dispatcher $dispatcher)
|
||||
{
|
||||
$dispatcher->mapUsing(function($command)
|
||||
{
|
||||
return Dispatcher::simpleMapping(
|
||||
$command, 'App\Commands', 'App\Handlers\Commands'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
class BusServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @param \Illuminate\Bus\Dispatcher $dispatcher
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(Dispatcher $dispatcher)
|
||||
{
|
||||
$dispatcher->mapUsing(function ($command) {
|
||||
return Dispatcher::simpleMapping(
|
||||
$command, 'App\Commands', 'App\Handlers\Commands'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,24 @@
|
|||
<?php namespace App\Providers;
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ConfigServiceProvider extends ServiceProvider {
|
||||
|
||||
/**
|
||||
* Overwrite any vendor / package configuration.
|
||||
*
|
||||
* This service provider is intended to provide a convenient location for you
|
||||
* to overwrite any "vendor" or package configuration that you may want to
|
||||
* modify before the application handles the incoming request / command.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
config([
|
||||
//
|
||||
]);
|
||||
}
|
||||
|
||||
class ConfigServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Overwrite any vendor / package configuration.
|
||||
*
|
||||
* This service provider is intended to provide a convenient location for you
|
||||
* to overwrite any "vendor" or package configuration that you may want to
|
||||
* modify before the application handles the incoming request / command.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
config([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,32 +1,34 @@
|
|||
<?php namespace App\Providers;
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Contracts\Events\Dispatcher as DispatcherContract;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider {
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event handler mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
'event.name' => [
|
||||
'EventListener',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The event handler mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
'event.name' => [
|
||||
'EventListener',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any other events for your application.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Events\Dispatcher $events
|
||||
* @return void
|
||||
*/
|
||||
public function boot(DispatcherContract $events)
|
||||
{
|
||||
parent::boot($events);
|
||||
|
||||
//
|
||||
}
|
||||
/**
|
||||
* Register any other events for your application.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Events\Dispatcher $events
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(DispatcherContract $events)
|
||||
{
|
||||
parent::boot($events);
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,28 @@
|
|||
<?php namespace App\Providers;
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class HelpersServiceProvider extends ServiceProvider {
|
||||
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
require app_path('Helpers/helpers.php');
|
||||
require app_path('Helpers/macros.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
|
||||
}
|
||||
class HelpersServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
require app_path('Helpers/helpers.php');
|
||||
require app_path('Helpers/macros.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,44 +1,46 @@
|
|||
<?php namespace App\Providers;
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Routing\Router;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Routing\Router;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider {
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* This namespace is applied to the controller routes in your routes file.
|
||||
*
|
||||
* In addition, it is set as the URL generator's root namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'App\Http\Controllers';
|
||||
|
||||
/**
|
||||
* This namespace is applied to the controller routes in your routes file.
|
||||
*
|
||||
* In addition, it is set as the URL generator's root namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'App\Http\Controllers';
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @param \Illuminate\Routing\Router $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot(Router $router)
|
||||
{
|
||||
parent::boot($router);
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @param \Illuminate\Routing\Router $router
|
||||
* @return void
|
||||
*/
|
||||
public function boot(Router $router)
|
||||
{
|
||||
parent::boot($router);
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @param \Illuminate\Routing\Router $router
|
||||
* @return void
|
||||
*/
|
||||
public function map(Router $router)
|
||||
{
|
||||
$router->group(['namespace' => $this->namespace], function($router)
|
||||
{
|
||||
require app_path('Http/routes.php');
|
||||
});
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @param \Illuminate\Routing\Router $router
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map(Router $router)
|
||||
{
|
||||
$router->group(['namespace' => $this->namespace], function ($router) {
|
||||
require app_path('Http/routes.php');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,39 +1,42 @@
|
|||
<?php namespace App\Services;
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\User;
|
||||
use Validator;
|
||||
use Illuminate\Contracts\Auth\Registrar as RegistrarContract;
|
||||
use Validator;
|
||||
|
||||
class Registrar implements RegistrarContract {
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
public function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => 'required|max:255',
|
||||
'email' => 'required|email|max:255|unique:users',
|
||||
'password' => 'required|confirmed|min:6',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return User
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => bcrypt($data['password']),
|
||||
]);
|
||||
}
|
||||
class Registrar implements RegistrarContract
|
||||
{
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
public function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => 'required|max:255',
|
||||
'email' => 'required|email|max:255|unique:users',
|
||||
'password' => 'required|confirmed|min:6',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
public function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => bcrypt($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
*/
|
||||
|
||||
$app = new Illuminate\Foundation\Application(
|
||||
realpath(__DIR__.'/../')
|
||||
realpath(__DIR__.'/../')
|
||||
);
|
||||
|
||||
/*
|
||||
|
|
@ -27,18 +27,18 @@ $app = new Illuminate\Foundation\Application(
|
|||
*/
|
||||
|
||||
$app->singleton(
|
||||
'Illuminate\Contracts\Http\Kernel',
|
||||
'App\Http\Kernel'
|
||||
'Illuminate\Contracts\Http\Kernel',
|
||||
'App\Http\Kernel'
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
'Illuminate\Contracts\Console\Kernel',
|
||||
'App\Console\Kernel'
|
||||
'Illuminate\Contracts\Console\Kernel',
|
||||
'App\Console\Kernel'
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
'Illuminate\Contracts\Debug\ExceptionHandler',
|
||||
'App\Exceptions\Handler'
|
||||
'Illuminate\Contracts\Debug\ExceptionHandler',
|
||||
'App\Exceptions\Handler'
|
||||
);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ require __DIR__.'/../vendor/autoload.php';
|
|||
|
||||
$compiledPath = __DIR__.'/cache/compiled.php';
|
||||
|
||||
if (file_exists($compiledPath))
|
||||
{
|
||||
require $compiledPath;
|
||||
if (file_exists($compiledPath)) {
|
||||
require $compiledPath;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<?php
|
||||
|
||||
return array(
|
||||
return [
|
||||
|
||||
'debug' => false,
|
||||
'binpath' => 'lib/',
|
||||
'binfile' => 'wkhtmltopdf-amd64',
|
||||
'output_mode' => 'I'
|
||||
);
|
||||
'debug' => false,
|
||||
'binpath' => 'lib/',
|
||||
'binfile' => 'wkhtmltopdf-amd64',
|
||||
'output_mode' => 'I',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ return [
|
|||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
*/
|
||||
'key' => env('APP_KEY', 'SomeRandomString'),
|
||||
'key' => env('APP_KEY', 'SomeRandomString'),
|
||||
'cipher' => MCRYPT_RIJNDAEL_128,
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -141,8 +141,6 @@ return [
|
|||
'App\Providers\RouteServiceProvider',
|
||||
'App\Providers\HelpersServiceProvider',
|
||||
|
||||
|
||||
|
||||
],
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -156,55 +154,55 @@ return [
|
|||
*/
|
||||
'aliases' => [
|
||||
|
||||
'App' => 'Illuminate\Support\Facades\App',
|
||||
'Artisan' => 'Illuminate\Support\Facades\Artisan',
|
||||
'Auth' => 'Illuminate\Support\Facades\Auth',
|
||||
'Blade' => 'Illuminate\Support\Facades\Blade',
|
||||
'Bus' => 'Illuminate\Support\Facades\Bus',
|
||||
'Cache' => 'Illuminate\Support\Facades\Cache',
|
||||
'Config' => 'Illuminate\Support\Facades\Config',
|
||||
'Cookie' => 'Illuminate\Support\Facades\Cookie',
|
||||
'Crypt' => 'Illuminate\Support\Facades\Crypt',
|
||||
'DB' => 'Illuminate\Support\Facades\DB',
|
||||
'App' => 'Illuminate\Support\Facades\App',
|
||||
'Artisan' => 'Illuminate\Support\Facades\Artisan',
|
||||
'Auth' => 'Illuminate\Support\Facades\Auth',
|
||||
'Blade' => 'Illuminate\Support\Facades\Blade',
|
||||
'Bus' => 'Illuminate\Support\Facades\Bus',
|
||||
'Cache' => 'Illuminate\Support\Facades\Cache',
|
||||
'Config' => 'Illuminate\Support\Facades\Config',
|
||||
'Cookie' => 'Illuminate\Support\Facades\Cookie',
|
||||
'Crypt' => 'Illuminate\Support\Facades\Crypt',
|
||||
'DB' => 'Illuminate\Support\Facades\DB',
|
||||
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
|
||||
/*
|
||||
* changed Event alias to LaravelEvent as there was a conflict
|
||||
* If something blows up it could be because of this
|
||||
*/
|
||||
'LaravelEvent' => 'Illuminate\Support\Facades\Event',
|
||||
'File' => 'Illuminate\Support\Facades\File',
|
||||
'Hash' => 'Illuminate\Support\Facades\Hash',
|
||||
'Input' => 'Illuminate\Support\Facades\Input',
|
||||
'Inspiring' => 'Illuminate\Foundation\Inspiring',
|
||||
'Lang' => 'Illuminate\Support\Facades\Lang',
|
||||
'Log' => 'Illuminate\Support\Facades\Log',
|
||||
'Mail' => 'Illuminate\Support\Facades\Mail',
|
||||
'Password' => 'Illuminate\Support\Facades\Password',
|
||||
'Queue' => 'Illuminate\Support\Facades\Queue',
|
||||
'Redirect' => 'Illuminate\Support\Facades\Redirect',
|
||||
'Redis' => 'Illuminate\Support\Facades\Redis',
|
||||
'Request' => 'Illuminate\Support\Facades\Request',
|
||||
'Response' => 'Illuminate\Support\Facades\Response',
|
||||
'Route' => 'Illuminate\Support\Facades\Route',
|
||||
'Schema' => 'Illuminate\Support\Facades\Schema',
|
||||
'Session' => 'Illuminate\Support\Facades\Session',
|
||||
'Storage' => 'Illuminate\Support\Facades\Storage',
|
||||
'URL' => 'Illuminate\Support\Facades\URL',
|
||||
'Validator' => 'Illuminate\Support\Facades\Validator',
|
||||
'View' => 'Illuminate\Support\Facades\View',
|
||||
'Form' => 'Illuminate\Html\FormFacade',
|
||||
'HTML' => 'Illuminate\Html\HtmlFacade',
|
||||
'Str' => 'Illuminate\Support\Str',
|
||||
'Utils' => 'App\Attendize\Utils',
|
||||
'Carbon' => 'Carbon\Carbon',
|
||||
'PDF' => 'Nitmedia\Wkhtml2pdf\Facades\Wkhtml2pdf',
|
||||
'DNS1D' => 'Milon\Barcode\Facades\DNS1DFacade',
|
||||
'DNS2D' => 'Milon\Barcode\Facades\DNS2DFacade',
|
||||
'Image' => 'Intervention\Image\Facades\Image',
|
||||
'Excel' => 'Maatwebsite\Excel\Facades\Excel',
|
||||
'Socialize' => 'Laravel\Socialite\Facades\Socialite',
|
||||
'HttpClient' => 'Vinelab\Http\Facades\Client',
|
||||
'Purifier' => 'Mews\Purifier\Facades\Purifier',
|
||||
'LaravelEvent' => 'Illuminate\Support\Facades\Event',
|
||||
'File' => 'Illuminate\Support\Facades\File',
|
||||
'Hash' => 'Illuminate\Support\Facades\Hash',
|
||||
'Input' => 'Illuminate\Support\Facades\Input',
|
||||
'Inspiring' => 'Illuminate\Foundation\Inspiring',
|
||||
'Lang' => 'Illuminate\Support\Facades\Lang',
|
||||
'Log' => 'Illuminate\Support\Facades\Log',
|
||||
'Mail' => 'Illuminate\Support\Facades\Mail',
|
||||
'Password' => 'Illuminate\Support\Facades\Password',
|
||||
'Queue' => 'Illuminate\Support\Facades\Queue',
|
||||
'Redirect' => 'Illuminate\Support\Facades\Redirect',
|
||||
'Redis' => 'Illuminate\Support\Facades\Redis',
|
||||
'Request' => 'Illuminate\Support\Facades\Request',
|
||||
'Response' => 'Illuminate\Support\Facades\Response',
|
||||
'Route' => 'Illuminate\Support\Facades\Route',
|
||||
'Schema' => 'Illuminate\Support\Facades\Schema',
|
||||
'Session' => 'Illuminate\Support\Facades\Session',
|
||||
'Storage' => 'Illuminate\Support\Facades\Storage',
|
||||
'URL' => 'Illuminate\Support\Facades\URL',
|
||||
'Validator' => 'Illuminate\Support\Facades\Validator',
|
||||
'View' => 'Illuminate\Support\Facades\View',
|
||||
'Form' => 'Illuminate\Html\FormFacade',
|
||||
'HTML' => 'Illuminate\Html\HtmlFacade',
|
||||
'Str' => 'Illuminate\Support\Str',
|
||||
'Utils' => 'App\Attendize\Utils',
|
||||
'Carbon' => 'Carbon\Carbon',
|
||||
'PDF' => 'Nitmedia\Wkhtml2pdf\Facades\Wkhtml2pdf',
|
||||
'DNS1D' => 'Milon\Barcode\Facades\DNS1DFacade',
|
||||
'DNS2D' => 'Milon\Barcode\Facades\DNS2DFacade',
|
||||
'Image' => 'Intervention\Image\Facades\Image',
|
||||
'Excel' => 'Maatwebsite\Excel\Facades\Excel',
|
||||
'Socialize' => 'Laravel\Socialite\Facades\Socialite',
|
||||
'HttpClient' => 'Vinelab\Http\Facades\Client',
|
||||
'Purifier' => 'Mews\Purifier\Facades\Purifier',
|
||||
'Markdown' => 'MaxHoffmann\Parsedown\ParsedownFacade',
|
||||
|
||||
],
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ return [
|
|||
'fallback_organiser_logo_url' => '/assets/images/logo-100x100-lightBg.png',
|
||||
'cdn_url' => '',
|
||||
|
||||
'max_tickets_per_person' => 30, #Depreciated
|
||||
'checkout_timeout_after' => 8, #mintutes
|
||||
'max_tickets_per_person' => 30, //Depreciated
|
||||
'checkout_timeout_after' => 8, //mintutes
|
||||
|
||||
'ticket_status_sold_out' => 1,
|
||||
'ticket_status_after_sale_date' => 2,
|
||||
'ticket_status_after_sale_date' => 2,
|
||||
'ticket_status_before_sale_date' => 3,
|
||||
'ticket_status_on_sale' => 4,
|
||||
'ticket_status_off_sale' => 5,
|
||||
'ticket_status_off_sale' => 5,
|
||||
|
||||
'ticket_booking_fee_fixed' => 0,
|
||||
'ticket_booking_fee_percentage' => 0,
|
||||
|
|
@ -34,14 +34,14 @@ return [
|
|||
'order_partially_refunded' => 3,
|
||||
'order_cancelled' => 4,
|
||||
|
||||
'default_timezone' => 30, #Europe/Dublin
|
||||
'default_currency' => 2, #Euro
|
||||
'default_timezone' => 30, //Europe/Dublin
|
||||
'default_currency' => 2, //Euro
|
||||
'default_date_format' => 'j M, Y',
|
||||
'default_date_picker_format' => 'd M, yyyy',
|
||||
'default_datetime_format' => 'F j, Y, g:i a',
|
||||
'default_query_cache' => 120, #Minutes
|
||||
'default_query_cache' => 120, //Minutes
|
||||
'default_locale' => 'en',
|
||||
|
||||
'cdn_url_user_assets' => '',
|
||||
'cdn_url_static_assets' => ''
|
||||
'cdn_url_static_assets' => '',
|
||||
];
|
||||
|
|
|
|||
108
config/auth.php
108
config/auth.php
|
|
@ -2,66 +2,66 @@
|
|||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Authentication Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the authentication driver that will be utilized.
|
||||
| This driver manages the retrieval and authentication of the users
|
||||
| attempting to get access to protected areas of your application.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Authentication Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the authentication driver that will be utilized.
|
||||
| This driver manages the retrieval and authentication of the users
|
||||
| attempting to get access to protected areas of your application.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'eloquent',
|
||||
'driver' => 'eloquent',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Model
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "Eloquent" authentication driver, we need to know which
|
||||
| Eloquent model should be used to retrieve your users. Of course, it
|
||||
| is often just the "User" model but you may use whatever you like.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Model
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "Eloquent" authentication driver, we need to know which
|
||||
| Eloquent model should be used to retrieve your users. Of course, it
|
||||
| is often just the "User" model but you may use whatever you like.
|
||||
|
|
||||
*/
|
||||
|
||||
'model' => 'App\Models\User',
|
||||
'model' => 'App\Models\User',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "Database" authentication driver, we need to know which
|
||||
| table should be used to retrieve your users. We have chosen a basic
|
||||
| default value but you may easily change it to any table you like.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "Database" authentication driver, we need to know which
|
||||
| table should be used to retrieve your users. We have chosen a basic
|
||||
| default value but you may easily change it to any table you like.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => 'users',
|
||||
'table' => 'users',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the options for resetting passwords including the view
|
||||
| that is your password reset e-mail. You can also set the name of the
|
||||
| table that maintains all of the reset tokens for your application.
|
||||
|
|
||||
| The expire time is the number of minutes that the reset token should be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the options for resetting passwords including the view
|
||||
| that is your password reset e-mail. You can also set the name of the
|
||||
| table that maintains all of the reset tokens for your application.
|
||||
|
|
||||
| The expire time is the number of minutes that the reset token should be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'password' => [
|
||||
'email' => 'Emails.Auth.Reminder',
|
||||
'table' => 'password_resets',
|
||||
'expire' => 60,
|
||||
],
|
||||
'password' => [
|
||||
'email' => 'Emails.Auth.Reminder',
|
||||
'table' => 'password_resets',
|
||||
'expire' => 60,
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'store_path' => public_path("/"),
|
||||
'store_path' => public_path('/'),
|
||||
];
|
||||
|
|
|
|||
122
config/cache.php
122
config/cache.php
|
|
@ -2,78 +2,78 @@
|
|||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache connection that gets used while
|
||||
| using this caching library. This connection is used when another is
|
||||
| not explicitly specified when executing a given caching function.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache connection that gets used while
|
||||
| using this caching library. This connection is used when another is
|
||||
| not explicitly specified when executing a given caching function.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('CACHE_DRIVER', 'file'),
|
||||
'default' => env('CACHE_DRIVER', 'file'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Stores
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the cache "stores" for your application as
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Stores
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the cache "stores" for your application as
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
*/
|
||||
|
||||
'stores' => [
|
||||
'stores' => [
|
||||
|
||||
'apc' => [
|
||||
'driver' => 'apc'
|
||||
],
|
||||
'apc' => [
|
||||
'driver' => 'apc',
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'driver' => 'array'
|
||||
],
|
||||
'array' => [
|
||||
'driver' => 'array',
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'cache',
|
||||
'connection' => null,
|
||||
],
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'cache',
|
||||
'connection' => null,
|
||||
],
|
||||
|
||||
'file' => [
|
||||
'driver' => 'file',
|
||||
'path' => storage_path().'/framework/cache',
|
||||
],
|
||||
'file' => [
|
||||
'driver' => 'file',
|
||||
'path' => storage_path().'/framework/cache',
|
||||
],
|
||||
|
||||
'memcached' => [
|
||||
'driver' => 'memcached',
|
||||
'servers' => [
|
||||
[
|
||||
'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100
|
||||
],
|
||||
],
|
||||
],
|
||||
'memcached' => [
|
||||
'driver' => 'memcached',
|
||||
'servers' => [
|
||||
[
|
||||
'host' => '127.0.0.1', 'port' => 11211, 'weight' => 100,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
],
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
],
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing a RAM based store such as APC or Memcached, there might
|
||||
| be other applications utilizing the same cache. So, we'll specify a
|
||||
| value to get prefixed to all our keys so we can avoid collisions.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing a RAM based store such as APC or Memcached, there might
|
||||
| be other applications utilizing the same cache. So, we'll specify a
|
||||
| value to get prefixed to all our keys so we can avoid collisions.
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => 'laravel',
|
||||
'prefix' => 'laravel',
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,40 +2,40 @@
|
|||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Additional Compiled Classes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify additional classes to include in the compiled file
|
||||
| generated by the `artisan optimize` command. These should be classes
|
||||
| that are included on basically every request into the application.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Additional Compiled Classes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify additional classes to include in the compiled file
|
||||
| generated by the `artisan optimize` command. These should be classes
|
||||
| that are included on basically every request into the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => [
|
||||
'files' => [
|
||||
|
||||
realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'),
|
||||
realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'),
|
||||
realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'),
|
||||
realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'),
|
||||
realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'),
|
||||
realpath(__DIR__.'/../app/Providers/AppServiceProvider.php'),
|
||||
realpath(__DIR__.'/../app/Providers/BusServiceProvider.php'),
|
||||
realpath(__DIR__.'/../app/Providers/ConfigServiceProvider.php'),
|
||||
realpath(__DIR__.'/../app/Providers/EventServiceProvider.php'),
|
||||
realpath(__DIR__.'/../app/Providers/RouteServiceProvider.php'),
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Compiled File Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may list service providers which define a "compiles" function
|
||||
| that returns additional files that should be compiled, providing an
|
||||
| easy way to get common files from any packages you are utilizing.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Compiled File Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may list service providers which define a "compiles" function
|
||||
| that returns additional files that should be compiled, providing an
|
||||
| easy way to get common files from any packages you are utilizing.
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
//
|
||||
],
|
||||
'providers' => [
|
||||
//
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,124 +2,124 @@
|
|||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDO Fetch Style
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, database results will be returned as instances of the PHP
|
||||
| stdClass object; however, you may desire to retrieve records in an
|
||||
| array format for simplicity. Here you can tweak the fetch style.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDO Fetch Style
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By default, database results will be returned as instances of the PHP
|
||||
| stdClass object; however, you may desire to retrieve records in an
|
||||
| array format for simplicity. Here you can tweak the fetch style.
|
||||
|
|
||||
*/
|
||||
|
||||
'fetch' => PDO::FETCH_CLASS,
|
||||
'fetch' => PDO::FETCH_CLASS,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'mysql',
|
||||
'default' => 'mysql',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
'connections' => [
|
||||
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'database' => storage_path().'/database.sqlite',
|
||||
'prefix' => '',
|
||||
],
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'database' => storage_path().'/database.sqlite',
|
||||
'prefix' => '',
|
||||
],
|
||||
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'host' => env('DB_HOST'),
|
||||
'database' => env('DB_DATABASE'),
|
||||
'username' => env('DB_USERNAME'),
|
||||
'password' => env('DB_PASSWORD'),
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => '',
|
||||
'strict' => false,
|
||||
],
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'host' => env('DB_HOST'),
|
||||
'database' => env('DB_DATABASE'),
|
||||
'username' => env('DB_USERNAME'),
|
||||
'password' => env('DB_PASSWORD'),
|
||||
'charset' => 'utf8',
|
||||
'collation' => 'utf8_unicode_ci',
|
||||
'prefix' => '',
|
||||
'strict' => false,
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => 'public',
|
||||
],
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'schema' => 'public',
|
||||
],
|
||||
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'prefix' => '',
|
||||
],
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'prefix' => '',
|
||||
],
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run in the database.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run in the database.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer set of commands than a typical key-value systems
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer set of commands than a typical key-value systems
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => [
|
||||
'redis' => [
|
||||
|
||||
'cluster' => false,
|
||||
'cluster' => false,
|
||||
|
||||
'default' => [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
],
|
||||
'default' => [
|
||||
'host' => '127.0.0.1',
|
||||
'port' => 6379,
|
||||
'database' => 0,
|
||||
],
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
return array(
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -26,12 +26,12 @@ return array(
|
|||
| can also be used. For PDO, run the package migrations first.
|
||||
|
|
||||
*/
|
||||
'storage' => array(
|
||||
'enabled' => true,
|
||||
'driver' => 'file', // redis, file, pdo
|
||||
'path' => storage_path() . '/debugbar', // For file driver
|
||||
'storage' => [
|
||||
'enabled' => true,
|
||||
'driver' => 'file', // redis, file, pdo
|
||||
'path' => storage_path().'/debugbar', // For file driver
|
||||
'connection' => null, // Leave null for default connection (Redis/PDO)
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -70,7 +70,7 @@ return array(
|
|||
|
|
||||
*/
|
||||
|
||||
'collectors' => array(
|
||||
'collectors' => [
|
||||
'phpinfo' => true, // Php version
|
||||
'messages' => true, // Messages
|
||||
'time' => true, // Time Datalogger
|
||||
|
|
@ -90,7 +90,7 @@ return array(
|
|||
'config' => false, // Display config settings
|
||||
'auth' => false, // Display Laravel authentication status
|
||||
'session' => false, // Display session data in a separate tab
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -101,33 +101,33 @@ return array(
|
|||
|
|
||||
*/
|
||||
|
||||
'options' => array(
|
||||
'auth' => array(
|
||||
'options' => [
|
||||
'auth' => [
|
||||
'show_name' => false, // Also show the users name/email in the debugbar
|
||||
),
|
||||
'db' => array(
|
||||
],
|
||||
'db' => [
|
||||
'with_params' => true, // Render SQL with the parameters substituted
|
||||
'timeline' => false, // Add the queries to the timeline
|
||||
'backtrace' => false, // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
|
||||
'explain' => array( // EXPERIMENTAL: Show EXPLAIN output on queries
|
||||
'explain' => [ // EXPERIMENTAL: Show EXPLAIN output on queries
|
||||
'enabled' => false,
|
||||
'types' => array('SELECT'), // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
|
||||
),
|
||||
'types' => ['SELECT'], // array('SELECT', 'INSERT', 'UPDATE', 'DELETE'); for MySQL 5.6.3+
|
||||
],
|
||||
'hints' => true, // Show hints for common mistakes
|
||||
),
|
||||
'mail' => array(
|
||||
'full_log' => false
|
||||
),
|
||||
'views' => array(
|
||||
],
|
||||
'mail' => [
|
||||
'full_log' => false,
|
||||
],
|
||||
'views' => [
|
||||
'data' => false, //Note: Can slow down the application, because the data can be quite large..
|
||||
),
|
||||
'route' => array(
|
||||
'label' => true // show complete route on bar
|
||||
),
|
||||
'logs' => array(
|
||||
'file' => null
|
||||
),
|
||||
),
|
||||
],
|
||||
'route' => [
|
||||
'label' => true, // show complete route on bar
|
||||
],
|
||||
'logs' => [
|
||||
'file' => null,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -142,4 +142,4 @@ return array(
|
|||
|
||||
'inject' => true,
|
||||
|
||||
);
|
||||
];
|
||||
|
|
|
|||
234
config/excel.php
234
config/excel.php
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
|
||||
return array(
|
||||
return [
|
||||
|
||||
'cache' => array(
|
||||
'cache' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -29,24 +29,24 @@ return array(
|
|||
| Cache settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'settings' => array(
|
||||
'settings' => [
|
||||
|
||||
'memoryCacheSize' => '32MB',
|
||||
'cacheTime' => 600
|
||||
'cacheTime' => 600,
|
||||
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Memcache settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'memcache' => array(
|
||||
'memcache' => [
|
||||
|
||||
'host' => 'localhost',
|
||||
'port' => 11211,
|
||||
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -54,10 +54,10 @@ return array(
|
|||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'dir' => storage_path('cache')
|
||||
),
|
||||
'dir' => storage_path('cache'),
|
||||
],
|
||||
|
||||
'properties' => array(
|
||||
'properties' => [
|
||||
'creator' => 'Maatwebsite',
|
||||
'lastModifiedBy' => 'Maatwebsite',
|
||||
'title' => 'Spreadsheet',
|
||||
|
|
@ -67,35 +67,35 @@ return array(
|
|||
'category' => 'Excel',
|
||||
'manager' => 'Maatwebsite',
|
||||
'company' => 'Maatwebsite',
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sheets settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'sheets' => array(
|
||||
'sheets' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default page setup
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'pageSetup' => array(
|
||||
'pageSetup' => [
|
||||
'orientation' => 'portrait',
|
||||
'paperSize' => '9',
|
||||
'scale' => '100',
|
||||
'fitToPage' => false,
|
||||
'fitToHeight' => true,
|
||||
'fitToWidth' => true,
|
||||
'columnsToRepeatAtLeft' => array('', ''),
|
||||
'rowsToRepeatAtTop' => array(0, 0),
|
||||
'columnsToRepeatAtLeft' => ['', ''],
|
||||
'rowsToRepeatAtTop' => [0, 0],
|
||||
'horizontalCentered' => false,
|
||||
'verticalCentered' => false,
|
||||
'printArea' => null,
|
||||
'firstPageNumber' => null,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -108,7 +108,7 @@ return array(
|
|||
|
||||
'creator' => 'Maatwebsite',
|
||||
|
||||
'csv' => array(
|
||||
'csv' => [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Delimiter
|
||||
|
|
@ -134,10 +134,10 @@ return array(
|
|||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'line_ending' => "\r\n"
|
||||
),
|
||||
'line_ending' => "\r\n",
|
||||
],
|
||||
|
||||
'export' => array(
|
||||
'export' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -210,7 +210,7 @@ return array(
|
|||
| Default sheet settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'sheets' => array(
|
||||
'sheets' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -245,8 +245,8 @@ return array(
|
|||
| Apply strict comparison when testing for null values in the array
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'strictNullComparison' => false
|
||||
),
|
||||
'strictNullComparison' => false,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -254,7 +254,7 @@ return array(
|
|||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'store' => array(
|
||||
'store' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -274,16 +274,16 @@ return array(
|
|||
| Whether we want to return information about the stored file or not
|
||||
|
|
||||
*/
|
||||
'returnInfo' => false
|
||||
'returnInfo' => false,
|
||||
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| PDF Settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'pdf' => array(
|
||||
'pdf' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -298,48 +298,48 @@ return array(
|
|||
| PDF Driver settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'drivers' => array(
|
||||
'drivers' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| DomPDF settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'DomPDF' => array(
|
||||
'path' => base_path('vendor/dompdf/dompdf/')
|
||||
),
|
||||
'DomPDF' => [
|
||||
'path' => base_path('vendor/dompdf/dompdf/'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| tcPDF settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'tcPDF' => array(
|
||||
'path' => base_path('vendor/tecnick.com/tcpdf/')
|
||||
),
|
||||
'tcPDF' => [
|
||||
'path' => base_path('vendor/tecnick.com/tcpdf/'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| mPDF settings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'mPDF' => array(
|
||||
'path' => base_path('vendor/mpdf/mpdf/')
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
'mPDF' => [
|
||||
'path' => base_path('vendor/mpdf/mpdf/'),
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'filters' => array(
|
||||
'filters' => [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register read filters
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'registered' => array(
|
||||
'chunk' => 'Maatwebsite\Excel\Filters\ChunkReadFilter'
|
||||
),
|
||||
'registered' => [
|
||||
'chunk' => 'Maatwebsite\Excel\Filters\ChunkReadFilter',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -347,10 +347,10 @@ return array(
|
|||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'enabled' => array()
|
||||
),
|
||||
'enabled' => [],
|
||||
],
|
||||
|
||||
'import' => array(
|
||||
'import' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -415,12 +415,12 @@ return array(
|
|||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'encoding' => array(
|
||||
'encoding' => [
|
||||
|
||||
'input' => 'UTF-8',
|
||||
'output' => 'UTF-8'
|
||||
'output' => 'UTF-8',
|
||||
|
||||
),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -466,7 +466,7 @@ return array(
|
|||
|
|
||||
*/
|
||||
|
||||
'dates' => array(
|
||||
'dates' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -490,15 +490,15 @@ return array(
|
|||
| Date columns
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'columns' => array()
|
||||
),
|
||||
'columns' => [],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Import sheets by config
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'sheets' => array(
|
||||
'sheets' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -509,16 +509,16 @@ return array(
|
|||
|
|
||||
*/
|
||||
|
||||
'test' => array(
|
||||
'test' => [
|
||||
|
||||
'firstname' => 'A2'
|
||||
'firstname' => 'A2',
|
||||
|
||||
)
|
||||
],
|
||||
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
'views' => array(
|
||||
'views' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -529,155 +529,155 @@ return array(
|
|||
|
|
||||
*/
|
||||
|
||||
'styles' => array(
|
||||
'styles' => [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Table headings
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'th' => array(
|
||||
'font' => array(
|
||||
'th' => [
|
||||
'font' => [
|
||||
'bold' => true,
|
||||
'size' => 12,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Strong tags
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'strong' => array(
|
||||
'font' => array(
|
||||
'strong' => [
|
||||
'font' => [
|
||||
'bold' => true,
|
||||
'size' => 12,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bold tags
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'b' => array(
|
||||
'font' => array(
|
||||
'b' => [
|
||||
'font' => [
|
||||
'bold' => true,
|
||||
'size' => 12,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Italic tags
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'i' => array(
|
||||
'font' => array(
|
||||
'i' => [
|
||||
'font' => [
|
||||
'italic' => true,
|
||||
'size' => 12,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading 1
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'h1' => array(
|
||||
'font' => array(
|
||||
'h1' => [
|
||||
'font' => [
|
||||
'bold' => true,
|
||||
'size' => 24,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading 2
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'h2' => array(
|
||||
'font' => array(
|
||||
'h2' => [
|
||||
'font' => [
|
||||
'bold' => true,
|
||||
'size' => 18,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading 2
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'h3' => array(
|
||||
'font' => array(
|
||||
'h3' => [
|
||||
'font' => [
|
||||
'bold' => true,
|
||||
'size' => 13.5,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading 4
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'h4' => array(
|
||||
'font' => array(
|
||||
'h4' => [
|
||||
'font' => [
|
||||
'bold' => true,
|
||||
'size' => 12,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading 5
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'h5' => array(
|
||||
'font' => array(
|
||||
'h5' => [
|
||||
'font' => [
|
||||
'bold' => true,
|
||||
'size' => 10,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Heading 6
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'h6' => array(
|
||||
'font' => array(
|
||||
'h6' => [
|
||||
'font' => [
|
||||
'bold' => true,
|
||||
'size' => 7.5,
|
||||
)
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Hyperlinks
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'a' => array(
|
||||
'font' => array(
|
||||
'a' => [
|
||||
'font' => [
|
||||
'underline' => true,
|
||||
'color' => array('argb' => 'FF0000FF'),
|
||||
)
|
||||
),
|
||||
'color' => ['argb' => 'FF0000FF'],
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Horizontal rules
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
'hr' => array(
|
||||
'borders' => array(
|
||||
'bottom' => array(
|
||||
'hr' => [
|
||||
'borders' => [
|
||||
'bottom' => [
|
||||
'style' => 'thin',
|
||||
'color' => array('FF000000')
|
||||
),
|
||||
)
|
||||
)
|
||||
)
|
||||
'color' => ['FF000000'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
)
|
||||
],
|
||||
|
||||
);
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,69 +2,69 @@
|
|||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default filesystem disk that should be used
|
||||
| by the framework. A "local" driver, as well as a variety of cloud
|
||||
| based drivers are available for your choosing. Just store away!
|
||||
|
|
||||
| Supported: "local", "s3", "rackspace"
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default filesystem disk that should be used
|
||||
| by the framework. A "local" driver, as well as a variety of cloud
|
||||
| based drivers are available for your choosing. Just store away!
|
||||
|
|
||||
| Supported: "local", "s3", "rackspace"
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => 'local',
|
||||
'default' => 'local',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cloud Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Many applications store files both locally and in the cloud. For this
|
||||
| reason, you may specify a default "cloud" driver here. This driver
|
||||
| will be bound as the Cloud disk implementation in the container.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cloud Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Many applications store files both locally and in the cloud. For this
|
||||
| reason, you may specify a default "cloud" driver here. This driver
|
||||
| will be bound as the Cloud disk implementation in the container.
|
||||
|
|
||||
*/
|
||||
|
||||
'cloud' => 's3',
|
||||
'cloud' => 's3',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure as many filesystem "disks" as you wish, and you
|
||||
| may even configure multiple disks of the same driver. Defaults have
|
||||
| been setup for each driver as an example of the required options.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure as many filesystem "disks" as you wish, and you
|
||||
| may even configure multiple disks of the same driver. Defaults have
|
||||
| been setup for each driver as an example of the required options.
|
||||
|
|
||||
*/
|
||||
|
||||
'disks' => [
|
||||
'disks' => [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => public_path().'/user_content',
|
||||
],
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => public_path().'/user_content',
|
||||
],
|
||||
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
'key' => 'your-key',
|
||||
'secret' => 'your-secret',
|
||||
'region' => 'your-region',
|
||||
'bucket' => 'your-bucket',
|
||||
],
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
'key' => 'your-key',
|
||||
'secret' => 'your-secret',
|
||||
'region' => 'your-region',
|
||||
'bucket' => 'your-bucket',
|
||||
],
|
||||
|
||||
'rackspace' => [
|
||||
'driver' => 'rackspace',
|
||||
'username' => 'your-username',
|
||||
'key' => 'your-key',
|
||||
'container' => 'your-container',
|
||||
'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
|
||||
'region' => 'IAD',
|
||||
],
|
||||
'rackspace' => [
|
||||
'driver' => 'rackspace',
|
||||
'username' => 'your-username',
|
||||
'key' => 'your-key',
|
||||
'container' => 'your-container',
|
||||
'endpoint' => 'https://identity.api.rackspacecloud.com/v2.0/',
|
||||
'region' => 'IAD',
|
||||
],
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
return array(
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
@ -15,6 +15,6 @@ return array(
|
|||
|
|
||||
*/
|
||||
|
||||
'driver' => 'gd'
|
||||
'driver' => 'gd',
|
||||
|
||||
);
|
||||
];
|
||||
|
|
|
|||
202
config/mail.php
202
config/mail.php
|
|
@ -2,123 +2,123 @@
|
|||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
|
||||
| sending of e-mail. You may specify which one you're using throughout
|
||||
| your application here. By default, Laravel is setup for SMTP mail.
|
||||
|
|
||||
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log"
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
|
||||
| sending of e-mail. You may specify which one you're using throughout
|
||||
| your application here. By default, Laravel is setup for SMTP mail.
|
||||
|
|
||||
| Supported: "smtp", "mail", "sendmail", "mailgun", "mandrill", "log"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('MAIL_DRIVER', 'mail'),
|
||||
'driver' => env('MAIL_DRIVER', 'mail'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may provide the host address of the SMTP server used by your
|
||||
| applications. A default option is provided that is compatible with
|
||||
| the Mailgun mail service which will provide reliable deliveries.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may provide the host address of the SMTP server used by your
|
||||
| applications. A default option is provided that is compatible with
|
||||
| the Mailgun mail service which will provide reliable deliveries.
|
||||
|
|
||||
*/
|
||||
|
||||
'host' => env('MAIL_HOST', 'smtp.sendgrid.net'),
|
||||
'host' => env('MAIL_HOST', 'smtp.sendgrid.net'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Port
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the SMTP port used by your application to deliver e-mails to
|
||||
| users of the application. Like the host we have set this value to
|
||||
| stay compatible with the Mailgun e-mail application by default.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Host Port
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This is the SMTP port used by your application to deliver e-mails to
|
||||
| users of the application. Like the host we have set this value to
|
||||
| stay compatible with the Mailgun e-mail application by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'port' => env('MAIL_PORT', 587),
|
||||
'port' => env('MAIL_PORT', 587),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => ['address' => env('MAIL_FROM_ADDRESS'), 'name' => env('MAIL_FROM_NAME')],
|
||||
'from' => ['address' => env('MAIL_FROM_ADDRESS'), 'name' => env('MAIL_FROM_NAME')],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the encryption protocol that should be used when
|
||||
| the application send e-mail messages. A sensible default using the
|
||||
| transport layer security protocol should provide great security.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| E-Mail Encryption Protocol
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the encryption protocol that should be used when
|
||||
| the application send e-mail messages. A sensible default using the
|
||||
| transport layer security protocol should provide great security.
|
||||
|
|
||||
*/
|
||||
|
||||
'encryption' => env('MAIL_ENCRYPTION','tls'),
|
||||
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your SMTP server requires a username for authentication, you should
|
||||
| set it here. This will get used to authenticate with your server on
|
||||
| connection. You may also set the "password" value below this one.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Username
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If your SMTP server requires a username for authentication, you should
|
||||
| set it here. This will get used to authenticate with your server on
|
||||
| connection. You may also set the "password" value below this one.
|
||||
|
|
||||
*/
|
||||
|
||||
'username' => env('MAIL_USERNAME'),
|
||||
'username' => env('MAIL_USERNAME'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Password
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the password required by your SMTP server to send out
|
||||
| messages from your application. This will be given to the server on
|
||||
| connection so that the application will be able to send messages.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| SMTP Server Password
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may set the password required by your SMTP server to send out
|
||||
| messages from your application. This will be given to the server on
|
||||
| connection so that the application will be able to send messages.
|
||||
|
|
||||
*/
|
||||
|
||||
'password' => env('MAIL_PASSWORD'),
|
||||
'password' => env('MAIL_PASSWORD'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sendmail System Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "sendmail" driver to send e-mails, we will need to know
|
||||
| the path to where Sendmail lives on this server. A default path has
|
||||
| been provided here, which will work well on most of your systems.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sendmail System Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "sendmail" driver to send e-mails, we will need to know
|
||||
| the path to where Sendmail lives on this server. A default path has
|
||||
| been provided here, which will work well on most of your systems.
|
||||
|
|
||||
*/
|
||||
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
'sendmail' => '/usr/sbin/sendmail -bs',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail "Pretend"
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When this option is enabled, e-mail will not actually be sent over the
|
||||
| web and will instead be written to your application's logs files so
|
||||
| you may inspect the message. This is great for local development.
|
||||
|
|
||||
*/
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mail "Pretend"
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When this option is enabled, e-mail will not actually be sent over the
|
||||
| web and will instead be written to your application's logs files so
|
||||
| you may inspect the message. This is great for local development.
|
||||
|
|
||||
*/
|
||||
|
||||
'pretend' => false,
|
||||
'pretend' => false,
|
||||
|
||||
];
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue