diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php index c56b089..0426669 100644 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ b/app/Http/Controllers/Auth/ResetPasswordController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Auth; +use Illuminate\Support\Str; use App\Http\Controllers\Controller; use Illuminate\Foundation\Auth\ResetsPasswords; @@ -42,7 +43,7 @@ class ResetPasswordController extends Controller { $user->forceFill([ 'password' => $password, - 'remember_token' => str_random(60), + 'remember_token' => Str::random(60), ])->save(); $this->guard()->login($user); diff --git a/app/Http/Controllers/InstallationController.php b/app/Http/Controllers/InstallationController.php index 21531fe..3ad2c1d 100755 --- a/app/Http/Controllers/InstallationController.php +++ b/app/Http/Controllers/InstallationController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use DB; use Auth; +use Illuminate\Support\Str; use App\Entities\Users\User; use App\Http\Requests\Accounts\RegisterRequest; @@ -47,7 +48,7 @@ class InstallationController extends Controller $adminData = $request->only('name', 'email', 'password'); - $adminData['api_token'] = str_random(32); + $adminData['api_token'] = Str::random(32); $adminData['password'] = bcrypt($adminData['password']); $admin = User::create($adminData); diff --git a/app/Http/Controllers/Users/UsersController.php b/app/Http/Controllers/Users/UsersController.php index 085f191..bab6edc 100755 --- a/app/Http/Controllers/Users/UsersController.php +++ b/app/Http/Controllers/Users/UsersController.php @@ -2,6 +2,7 @@ namespace App\Http\Controllers\Users; +use Illuminate\Support\Str; use App\Entities\Users\User; use Illuminate\Http\Request; use App\Http\Controllers\Controller; @@ -43,7 +44,7 @@ class UsersController extends Controller $userData['password'] = bcrypt(\Option::get('password_default', 'member')); } - $userData['api_token'] = str_random(32); + $userData['api_token'] = Str::random(32); $user = User::create($userData); diff --git a/app/Services/InvoiceDraft/InvoiceDraftCollection.php b/app/Services/InvoiceDraft/InvoiceDraftCollection.php index e5adf6e..23fe3cf 100644 --- a/app/Services/InvoiceDraft/InvoiceDraftCollection.php +++ b/app/Services/InvoiceDraft/InvoiceDraftCollection.php @@ -2,6 +2,7 @@ namespace App\Services\InvoiceDrafts; +use Illuminate\Support\Str; use Illuminate\Support\Collection; /** @@ -68,7 +69,7 @@ class InvoiceDraftCollection public function add(InvoiceDraft $draft) { $content = $this->getContent(); - $draft->draftKey = str_random(10); + $draft->draftKey = Str::random(10); $content->put($draft->draftKey, $draft); $this->session->put($this->instance, $content); diff --git a/database/factories/BankAccountFactory.php b/database/factories/BankAccountFactory.php index 917dac3..83e6ede 100644 --- a/database/factories/BankAccountFactory.php +++ b/database/factories/BankAccountFactory.php @@ -1,12 +1,13 @@ define(BankAccount::class, function (Faker $faker) { return [ - 'name' => 'Bank '.strtoupper(str_random(4)), - 'number' => str_random(10), + 'name' => 'Bank '.strtoupper(Str::random(4)), + 'number' => Str::random(10), 'account_name' => $faker->name, ]; }); diff --git a/database/factories/ModelFactory.php b/database/factories/ModelFactory.php index dcedcca..fe32540 100644 --- a/database/factories/ModelFactory.php +++ b/database/factories/ModelFactory.php @@ -1,5 +1,6 @@ define(User::class, function (Faker\Generator $faker) { 'name' => $faker->name, 'email' => $faker->unique()->email, 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret - 'remember_token' => str_random(10), - 'api_token' => str_random(32), + 'remember_token' => Str::random(10), + 'api_token' => Str::random(32), 'lang' => 'en', ]; }); diff --git a/database/factories/SubscriptionFactory.php b/database/factories/SubscriptionFactory.php index c8afc96..31a4c24 100644 --- a/database/factories/SubscriptionFactory.php +++ b/database/factories/SubscriptionFactory.php @@ -1,6 +1,7 @@ define(Subscription::class, function (Faker $faker) { $startDate = Carbon::parse($faker->dateTimeBetween('-1 year', '-1 month')->format('Y-m-d')); return [ - 'project_id' => function () { + 'project_id' => function () { return factory(Project::class)->create()->id; }, 'type_id' => 1, 'status_id' => 1, - 'name' => 'www.'.str_random(10).'.com', + 'name' => 'www.'.Str::random(10).'.com', 'price' => 125000, 'start_date' => $startDate->format('Y-m-d'), 'due_date' => $startDate->addYears(1)->format('Y-m-d'), 'customer_id' => function () { return factory(Customer::class)->create()->id; }, - 'vendor_id' => function () { + 'vendor_id' => function () { return factory(Vendor::class)->create()->id; }, ]; diff --git a/resources/views/projects/payments.blade.php b/resources/views/projects/payments.blade.php index 59d61d0..8bdbb88 100755 --- a/resources/views/projects/payments.blade.php +++ b/resources/views/projects/payments.blade.php @@ -7,8 +7,8 @@