diff --git a/app/Abstracts/Export.php b/app/Abstracts/Export.php index 42ee10d06..9b640281a 100644 --- a/app/Abstracts/Export.php +++ b/app/Abstracts/Export.php @@ -2,8 +2,8 @@ namespace App\Abstracts; +use App\Utilities\Date; use Illuminate\Support\Str; -use Jenssegers\Date\Date; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\ShouldAutoSize; use Maatwebsite\Excel\Concerns\WithHeadings; diff --git a/app/Abstracts/Import.php b/app/Abstracts/Import.php index 4e639ceeb..8adeade53 100644 --- a/app/Abstracts/Import.php +++ b/app/Abstracts/Import.php @@ -3,9 +3,9 @@ namespace App\Abstracts; use App\Traits\Import as ImportHelper; +use App\Utilities\Date; use Illuminate\Support\Arr; use Illuminate\Support\Str; -use Jenssegers\Date\Date; use Maatwebsite\Excel\Concerns\Importable; use Maatwebsite\Excel\Concerns\ToModel; use Maatwebsite\Excel\Concerns\SkipsOnError; diff --git a/app/Abstracts/Widget.php b/app/Abstracts/Widget.php index ac7a4e766..3484da0f2 100644 --- a/app/Abstracts/Widget.php +++ b/app/Abstracts/Widget.php @@ -3,7 +3,7 @@ namespace App\Abstracts; use App\Traits\Charts; -use Date; +use App\Utilities\Date; abstract class Widget { diff --git a/app/Listeners/Auth/Login.php b/app/Listeners/Auth/Login.php index a2dce9c74..e73bdd9d0 100644 --- a/app/Listeners/Auth/Login.php +++ b/app/Listeners/Auth/Login.php @@ -2,7 +2,7 @@ namespace App\Listeners\Auth; -use Date; +use App\Utilities\Date; use Illuminate\Auth\Events\Login as ILogin; class Login @@ -18,13 +18,13 @@ class Login { // Get first company $company = $event->user->companies()->enabled()->first(); - + // Logout if no company assigned if (!$company) { app('App\Http\Controllers\Auth\Login')->logout(); - + flash(trans('auth.error.no_company'))->error(); - + return; } diff --git a/app/Utilities/Date.php b/app/Utilities/Date.php new file mode 100644 index 000000000..11b488275 --- /dev/null +++ b/app/Utilities/Date.php @@ -0,0 +1,60 @@ + Illuminate\Support\Facades\Config::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class, 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'Date' => App\Utilities\Date::class, 'DB' => Illuminate\Support\Facades\DB::class, 'Eloquent' => Illuminate\Database\Eloquent\Model::class, 'Event' => Illuminate\Support\Facades\Event::class, diff --git a/config/language.php b/config/language.php index 914f6dc77..7b404b27a 100644 --- a/config/language.php +++ b/config/language.php @@ -51,7 +51,7 @@ return [ | This option the language of jenssegers/date library. | */ - 'date' => true, + 'date' => false, /* |-------------------------------------------------------------------------- diff --git a/database/factories/Bill.php b/database/factories/Bill.php index a1b5b7dce..372b40eec 100644 --- a/database/factories/Bill.php +++ b/database/factories/Bill.php @@ -8,9 +8,9 @@ use App\Models\Auth\User; use App\Models\Common\Contact; use App\Models\Common\Item; use App\Models\Purchase\Bill; -use Faker\Generator as Faker; -use Jenssegers\Date\Date; use App\Models\Setting\Tax; +use App\Utilities\Date; +use Faker\Generator as Faker; $user = User::first(); $company = $user->companies()->first(); diff --git a/database/factories/Invoice.php b/database/factories/Invoice.php index b60961e51..4d8f1ede4 100644 --- a/database/factories/Invoice.php +++ b/database/factories/Invoice.php @@ -10,8 +10,8 @@ use App\Models\Common\Contact; use App\Models\Common\Item; use App\Models\Sale\Invoice; use App\Models\Setting\Tax; +use App\Utilities\Date; use Faker\Generator as Faker; -use Jenssegers\Date\Date; $user = User::first(); $company = $user->companies()->first(); diff --git a/tests/Feature/Commands/BillReminderTest.php b/tests/Feature/Commands/BillReminderTest.php index c61706b0d..dbff11869 100644 --- a/tests/Feature/Commands/BillReminderTest.php +++ b/tests/Feature/Commands/BillReminderTest.php @@ -5,8 +5,8 @@ namespace Tests\Feature\Commands; use App\Jobs\Purchase\CreateBill; use App\Models\Purchase\Bill; use App\Notifications\Purchase\Bill as BillNotification; +use App\Utilities\Date; use Illuminate\Support\Facades\Notification as Notification; -use Jenssegers\Date\Date; use Tests\Feature\FeatureTestCase; class BillReminderTest extends FeatureTestCase diff --git a/tests/Feature/Commands/InvoiceReminderTest.php b/tests/Feature/Commands/InvoiceReminderTest.php index 1b46d96b0..183855a43 100644 --- a/tests/Feature/Commands/InvoiceReminderTest.php +++ b/tests/Feature/Commands/InvoiceReminderTest.php @@ -5,8 +5,8 @@ namespace Tests\Feature\Commands; use App\Jobs\Sale\CreateInvoice; use App\Models\Sale\Invoice; use App\Notifications\Sale\Invoice as InvoiceNotification; +use App\Utilities\Date; use Illuminate\Support\Facades\Notification; -use Jenssegers\Date\Date; use Tests\Feature\FeatureTestCase; class InvoiceReminderTest extends FeatureTestCase