Skip to content

Commit

Permalink
Merge pull request #262 from ladybirdweb/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
arindam85 authored Mar 5, 2018
2 parents 971db1e + c6493f8 commit 08fa3ac
Show file tree
Hide file tree
Showing 7,378 changed files with 1,288,830 additions and 132,485 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/nbproject/private/
.env

bootstrap/cache/services.php

/node_modules
/public/hot
/public/storage
/storage/*.key

/.idea
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env


6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ language: php

# Versions of PHP you want your project run with.
php:
- 5.5
- 5.6
- 7.0
- hhvm

# Commands to be run before your environment runs.
Expand All @@ -14,12 +13,11 @@ before_script:

# Commands you want to run that will verify your build.
script: phpunit

# allow_failures: Allow this build to fail under the specified environments.
# fast_finish: If your build fails do not continue trying to build, just stop.
matrix:
allow_failures:
- php: 5.6
- php: '5.6'
- php: hhvm
fast_finish: true

Expand Down
66 changes: 43 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,51 @@
<h3>About Agora Invocing</h3>
<p align="center"><img src="https://laravel.com/assets/img/components/logo-laravel.svg"></p>

<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/d/total.svg" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/v/stable.svg" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://poser.pugx.org/laravel/framework/license.svg" alt="License"></a>
</p>

<a href="https://styleci.io/repos/51429040"><img src="https://styleci.io/repos/51429040/shield" alt="StyleCI"></a>&nbsp;<img src="https://img.shields.io/badge/License-OSL-blue.svg">&nbsp;<img src="https://scrutinizer-ci.com/g/ladybirdweb/agorainvoicing/badges/quality-score.png?b=master" alt="scrutinizerCI">&nbsp;<img src="https://travis-ci.org/ladybirdweb/agorainvoicing.svg?branch=master">&nbsp;&nbsp;<a href="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/agorainvoicing/index.html" target="_blank"><img src="http://squizlabs.github.io/PHP_CodeSniffer/analysis/ladybirdweb/agorainvoicing/grade.svg"></a>&nbsp;
## About Laravel

Billing and subscription management for SaaS & other billing businesses. Handling signups, provisioning, billing and support
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in the majority of web projects, such as:

Agora can also be customised according to requirement and we do undertake such request.
- [Simple, fast routing engine](https://laravel.com/docs/routing).
- [Powerful dependency injection container](https://laravel.com/docs/container).
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
- [Robust background job processing](https://laravel.com/docs/queues).
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).

Agora is designed & developed by <a href="http://www.ladybirdweb.com/" target="_blank">Ladybird Web Solution Pvt Ltd</a>, and launched in March 2016.
Laravel is accessible, yet powerful, providing tools needed for large, robust applications. A superb combination of simplicity, elegance, and innovation give you tools you need to build any application with which you are tasked.

<h4>To run Agora your host just needs a couple of things:</h4>
<ul>
<li> Web Server: Apache or IIS or Nginx</li>
<li> PHP Version: 5.5+</li>
<li> PHP Extensions: Mcrypt, OpenSSL, Mbstring, Tokenizer</li>
<li> Database: MySQL(5.0+) or Postgres or SQLite or SQL Server</li>
<li> Web Server Extension: Pretty URLs or Search Engine Friendly URL's have to be enabled in your web server configuration</li>
</ul>
<h4>Credits</h4>
<ul>
<li>Laravel Framework</li>
<li>Admin LTE Theme</li>
</ul>
## Learning Laravel

<h4>Agora Features</h4>
https://github.com/ladybirdweb/agorainvoicing/wiki/Agora-Features
Laravel has the most extensive and thorough documentation and video tutorial library of any modern web application framework. The [Laravel documentation](https://laravel.com/docs) is thorough, complete, and makes it a breeze to get started learning the framework.

<h3>Faveo Probe:</h3>
<p>Helps verify whether your server can run Agora or not.
<a href="https://github.com/ladybirdweb/faveo-probe" target="_blank">Download here</a></p>
If you're not in the mood to read, [Laracasts](https://laracasts.com) contains over 900 video tutorials on a range of topics including Laravel, modern PHP, unit testing, JavaScript, and more. Boost the skill level of yourself and your entire team by digging into our comprehensive video library.

## Laravel Sponsors

We would like to extend our thanks to the following sponsors for helping fund on-going Laravel development. If you are interested in becoming a sponsor, please visit the Laravel [Patreon page](http://patreon.com/taylorotwell):

- **[Vehikl](http://vehikl.com)**
- **[Tighten Co.](https://tighten.co)**
- **[British Software Development](https://www.britishsoftware.co)**
- **[Styde](https://styde.net)**
- [Fragrantica](https://www.fragrantica.com)
- [SOFTonSOFA](https://softonsofa.com/)

## Contributing

Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](http://laravel.com/docs/contributions).

## Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell at [email protected]. All security vulnerabilities will be promptly addressed.

## License

The Laravel framework is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).
45 changes: 45 additions & 0 deletions app/Console/Commands/ExpiryCron.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace App\Console\Commands;

use App\Http\Controllers\Common\CronController;
use Illuminate\Console\Command;

class ExpiryCron extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'expiry:notification';

/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';

/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}

/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$controller = new CronController();
$controller->eachSubscription();
$this->info('expiry:notification Command Run successfully!');
}
}
16 changes: 15 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
'App\Console\Commands\Inspire',
//
'App\Console\Commands\Inspire',
\App\Console\Commands\Install::class,
'App\Console\Commands\ExpiryCron',
];

/**
Expand All @@ -28,5 +30,17 @@ protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')
->hourly();

$schedule->command('expiry')->hourly();
}

/**
* Register the Closure based commands for the application.
*
* @return void
*/
protected function commands()
{
require base_path('routes/console.php');
}
}
134 changes: 21 additions & 113 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
namespace App\Exceptions;

use Exception;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Foundation\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\HttpException;

class Handler extends ExceptionHandler
{
Expand All @@ -17,144 +14,55 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
];

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @param \Exception $exception
*
* @return void
*/
public function report(Exception $e)
public function report(Exception $exception)
{
return parent::report($e);
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @param \Exception $exception
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
public function render($request, Exception $exception)
{
//dd($e);
switch ($e) {

case $e instanceof ModelNotFoundException:
return $this->renderException($e);
default:
return $this->common($request, $e);
}
}

protected function renderException($e)
{
switch ($e) {

case $e instanceof ModelNotFoundException:
return redirect('/')->with('fails', 'Please configure '.$e->getMessage());
break;

default:
return (new SymfonyDisplayer(config('app.debug')))
->createResponse($e);
}
}

/**
* Function to render 500 error page.
*
* @param type $request
* @param type $e
*
* @return type mixed
*/
public function render500($request, $e)
{

//$this->mail($request, $e);
if (Config('app.debug') == true) {
return parent::render($request, $e);
}

return view('errors.500');
return parent::render($request, $exception);
}

/**
* Function to render 404 error page.
* Convert an authentication exception into an unauthenticated response.
*
* @param type $request
* @param type $e
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
*
* @return type mixed
*/
public function render404($request, $e)
{
if (config('app.debug') == false) {
return parent::render($request, $e);
}
//dd('yes');
return view('errors.404');
}

/**
* Common finction to render both types of codes.
*
* @param type $request
* @param type $e
*
* @return type mixed
* @return \Illuminate\Http\Response
*/
public function common($request, $e)
protected function unauthenticated($request, AuthenticationException $exception)
{
switch ($e) {
case $e instanceof HttpException:
return $this->render404($request, $e);
case $e instanceof NotFoundHttpException:
return $this->render404($request, $e);
case $e instanceof \Illuminate\Session\TokenMismatchException:
if ($request->ajax()) {
return response()->json(['error' => 'Session timeout, refresh the page'], 500);
}

return redirect()->back()->with('fails', 'Session time out');

}

return $this->render500($request, $e);
}

public function mail($request, $e)
{
return $this->mailReport($request, $e);
}

public function mailReport($request, $e)
{
$setting_controller = new \App\Http\Controllers\Common\TemplateController();
$mail = $setting_controller->smtp();
$set = new \App\Model\Common\Setting();
$setting = $set->find(1);

if ($setting->error_log == 1 && $setting->error_email != '') {
$s = \Mail::send('errors.report', ['e' => $e], function ($m) use ($setting) {
$m->from($setting->email, $setting->company);

$m->to($setting->error_email, 'Agora Error')->subject('Agora Invoicing Error');
});
//dd($s);
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}

return 'success';
return redirect()->guest(route('login'));
}
}
Loading

0 comments on commit 08fa3ac

Please sign in to comment.