Category : php

After intalling Docker on windows and setting some settings for that. after opening firefox and locating localhost its take a long time to opening my web application which i should see on browser. as far i installed Ubuntu linux from windows store i’m not sure my projects should be placed on that or not. without ..

Read more

I host an Apache PHP server on which there’s a couple of websites. Let’s call these X and Y. After I cleared the cache (and made some changes) on both my laravel websites, I get the following error often: [previous exception] [object] (PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘Y.events_ip’ doesn’t ..

Read more

I am currently trying to setup the Twinfield API, it should be pretty straight forward when using the php-twinfield/twinfield library. But there is one thing I don’t fully understand. Here is my code: $provider = new OAuthProvider([ ‘clientId’ => ‘someClientId’, ‘clientSecret’ => ‘someClientSecret’, ‘redirectUri’ => ‘https://example.org/’ ]); $accessToken = $provider->getAccessToken("authorization_code", ["code" => …]); $refreshToken = ..

Read more

my web.php like that Route::group([‘middleware’ => [‘auth’, ‘admin’], ‘domain’ => config(‘app.domain_admin’)], function() { Route::get(‘/’, [AppHttpControllersAdminTranslationController::class, ‘info’])->name(‘index’); Route::get(‘/paymentSys’, [AppHttpControllersAdminAdminController::class, ‘paymentSys’])->name(‘paymentSys’); Route::post(‘destroy’, [AppHttpControllersAdminAdminController::class, ‘destroy’])->name(‘destroy’); Route::get(‘index’, [AppHttpControllersAdminAdminController::class, ‘index’])->name(‘index’); Route::post(‘update/{news}’, [AppHttpControllersAdminAdminController::class, ‘update’])->name(‘update’); }); config(‘app.domain_admin’) equals to admin.paysys.ssd.uz. My admin middleware has this: public function handle(Request $request, Closure $next) { if (Auth::user() && Auth::user()->user_role == "admin") { return $next($request); } ..

Read more

[enter image description here][1]I’m using Laravel 7x and flysystem-google-drive. i want get body to report bugs to api instead of reporting the error directly. code error i want to get: [2021-05-06 10:28:31] local.ERROR: { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "File not found: 1S1QYxpypWItSTx8gSUVHDq-PeQeqyKt.", "locationType": "parameter", "location": "fileId" } ], "code": ..

Read more

I’m working on create a Parapharser with PHP, laravel and Vuejs, like (https://smodin.me/free-english-rewriter-and-spinner) I’m trying using a Traductor, for example, passing the introduced text from spanish to russian and return to spanish. But if i have 1 000 000 000 characters by day it’s expensive with google traductor api. Also i’ve trying to user a ..

Read more

Ok. I have three tables products –product_id –product_name –product_type_id –price –description –bonus_points –image productTypes –product_type_id –product_type_name productQuantities –id –product_id –warehouse_id –quantity Products are placed in different warehouses so I have to keep tracks of its numbers And has relationships are like this class Product extends Model { public function productType() { return $this->belongsTo(‘AppModelsProductType’,’product_type_id’,’product_type_id’); } public ..

Read more

I have a "jobdesk.dat" file in the "{myproject} /media/jobdesk.dat" directory Content on jobdesk.dat: Jobdesk=Andy:Desktop Programmer|Michael:Web Designer|Felix:Graphic Designer How to import this .dat file into the project and how to read or parse the content I tried with the code it didn’t work <?php $file = fopen("media/jobdesk.dat", "r") or die ("Unable to open file!"); echo fread ..

Read more

My application has the following entities: Locations Disciplines Instructors Disciplines and Instructors should be a many to many relationship, so in my Discipline model I have the following: public function instructors() { return $this->belongsToMany( Instructor::class, ‘location_discipline_instructors’, ‘discipline_id’, ‘id’ )->withPivot([‘location_id’]); } My pivot table contains the following fields: location_id discipline_id instructor_id To get a list of ..

Read more

My policy for an API controller seems to be working fine for view, but returns ‘This action is unauthorized.’ for viewAll, both while sending an admin api token. Using Laravel 7 with Spatie Roles/Permissions. AppBaseController extends IlluminateRoutingController. I’ve tried it without the middleware, just to be sure. Tried commenting out the ‘before’ function, to make ..

Read more

I want to use broadcast to understand when does the job finish and use pusher,laravel-echo and redis. When I run "php artisan queue:listen redis" dd in broadcast works but nothing happens in livewire component. showMessage method not working. Broadcast public function broadcastOn() { return new Channel(‘product-channel’); } Livewire component class ProjectActions extends Component { protected ..

Read more

I try to do decrypt value ? But it is giving this error. The payload is invalid. use IlluminateSupportFacadesCrypt; use IlluminateContractsEncryptionDecryptException; $identity_no = "eyJpdiI6Inhzakt4SE10Mk1TbGVNakZKb29nc2c9PSIsInZhbHVlIjoiaW9tWGVhOXZaQWlCYzhBbmNrbTV3dXdQYmNrTmt1S3dHKzdqelNLcFppbVJoR2s3NmptaVlKaU4rc1NSU3F2MW1oSVlJdU9OTEJuT05w ▶"; $decrypted_identityno = Crypt::decryptString($identity_no); dd($decrypted_identityno); die(); Sourc..

Read more

Hello I am going to create a project with laravel, I am using composer global installer, with the php version I am using is php 8. but I have a problem when I do the laravel installation. What should I do? Warning: require_once(phar://C:/composer/composer.phar/vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8): Failed to open stream: phar error: "vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8" is not a file in ..

Read more

When I start seeding my database with db:seed, I got this error: Call to a member function count() on null at P:<folderName><folderName>srcvendorlaravelframeworksrcIlluminateDatabaseEloquentFactoriesHasFactory.php:18 14▕ { 15▕ $factory = static::newFactory() ?: Factory::factoryForModel(get_called_class()); 16▕ 17▕ return $factory ➜ 18▕ ->count(is_numeric($parameters[0] ?? null) ? $parameters[0] : null) 19▕ ->state(is_array($parameters[0] ?? null) ? $parameters[0] : ($parameters[1] ?? [])); 20▕ } ..

Read more