Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpanjwani committed Jun 24, 2021
1 parent a0898a1 commit f5c23b3
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 27 deletions.
4 changes: 2 additions & 2 deletions app/Console/Commands/CreateTemplateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function handle()
$templateName = $this->argument('name');
$type = $this->option('type');

if (!$type) {
if (! $type) {
$type = $this->choice('Create a template for?', ['invoice', 'estimate']);
}

Expand All @@ -56,7 +56,7 @@ public function handle()

$path = resource_path("app/pdf/{$type}/{$templateName}.blade.php");
$type = ucfirst($type);
$this->info("{$type} Template created successfully at ". $path);
$this->info("{$type} Template created successfully at ".$path);

return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Crater\Http\Controllers\V1\Estimate;

use Crater\Http\Controllers\Controller;
use Crater\Models\EstimateTemplate;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace Crater\Http\Controllers\V1\Invoice;

use Crater\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Illuminate\Http\Request;

class InvoiceTemplatesController extends Controller
{
Expand Down
3 changes: 0 additions & 3 deletions app/Http/Controllers/V1/Mobile/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
namespace Crater\Http\Controllers\V1\Mobile;

use Crater\Http\Controllers\Controller;
use Crater\Http\Requests\DomainEnvironmentRequest;
use Crater\Models\User;
use Crater\Space\EnvironmentManager;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\ValidationException;
Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/V1/Onboarding/AppDomainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Crater\Http\Controllers\Controller;
use Crater\Http\Requests\DomainEnvironmentRequest;
use Crater\Space\EnvironmentManager;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;

class AppDomainController extends Controller
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/V1/Onboarding/FinishController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
namespace Crater\Http\Controllers\V1\Onboarding;

use Crater\Http\Controllers\Controller;
use Crater\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class FinishController extends Controller
{
Expand Down
5 changes: 1 addition & 4 deletions app/Models/Estimate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

namespace Crater\Models;

use Crater\Models\Company;
use Crater\Models\Tax;
use Illuminate\Database\Eloquent\Model;
use Crater\Models\CompanySetting;
use App;
use Barryvdh\DomPDF\Facade as PDF;
use Carbon\Carbon;
use Crater\Mail\SendEstimateMail;
use Crater\Traits\GeneratesPdfTrait;
use Crater\Traits\HasCustomFieldsTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
Expand Down
7 changes: 1 addition & 6 deletions app/Models/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@

namespace Crater\Models;

use Crater\Models\Company;
use Crater\Models\CompanySetting;
use Crater\Models\Currency;
use Crater\Models\Tax;
use Illuminate\Database\Eloquent\Model;
use Crater\Models\Payment;
use App;
use Barryvdh\DomPDF\Facade as PDF;
use Carbon\Carbon;
use Crater\Mail\SendInvoiceMail;
use Crater\Traits\GeneratesPdfTrait;
use Crater\Traits\HasCustomFieldsTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
Expand Down
1 change: 1 addition & 0 deletions app/Rules/UniqueNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public function passes($attribute, $value)
public function message()
{
$type = str_replace('_', ' ', $this->type);

return "{$type} is already used.";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ class RemoveTemplateIdFromInvoicesAndEstimatesTable extends Migration
*/
public function up()
{
if (Schema::hasColumn('invoices', 'invoice_template_id'))
{
if (Schema::hasColumn('invoices', 'invoice_template_id')) {
$invoices = Invoice::all();

$invoices->map(function ($invoice) {
$invoice->template_name = 'invoice'.$invoice->invoice_template_id;
$invoice->save();
Expand All @@ -31,9 +30,8 @@ public function up()
$table->dropColumn('invoice_template_id');
});
}

if (Schema::hasColumn('estimates', 'estimate_template_id'))
{

if (Schema::hasColumn('estimates', 'estimate_template_id')) {
$estimates = Estimate::all();

$estimates->map(function ($estimate) {
Expand All @@ -48,7 +46,7 @@ public function up()
$table->dropColumn('estimate_template_id');
});
}

Schema::dropIfExists('invoice_templates');
Schema::dropIfExists('estimate_templates');
}
Expand Down

0 comments on commit f5c23b3

Please sign in to comment.