Category : laravel

This is Laravel 8. I’m extending IlluminateMailTransportTransport class to create a custom mail transport in order to utilize the company’s custom mail API with IlluminateMailMailable. I got most of it working, including file attachments, however the Swift_Mime_SimpleMimeEntity and the classes deriving from it contain getBody(), getFilename(), getSize(), and getContentType() but no methods to extract file ..

Read more

Laravel (currently 8.12 | php 7.4.14) started throwing errors a few days ago when I try to execute a seeder in a subdirectory via Artisan::call. On bash this command works fine: php artisan db:seed –class=DatabaseSeedersTestingStagingTestDataSeeder But I want to execute it as: Artisan::call("db:seed –class=DatabaseSeedersTestingStagingTestDataSeeder"); The result is: Target class [DatabaseSeedersDatabaseSeedersTestingStagingTestDataSeeder] does not exist. Which is ..

Read more

how do I enable the button if I select 2 from my two separate select options? {{– 1st Select Option –}} <label class="up-label">Language</label> <select id="language" class="language" name="language" onchange="changebutton()"> <option value="" selected disabled>language</option> @foreach( $languages as $language ) <option value="{{ $language->id }}">{{ $language->language }}</option> @endforeach </select> {{– 2nd Select Option –}} <label class="up-label">Level</label> <select id="level" class="level" ..

Read more

I have this code for chart to get the users report for each month of current year: $numbers_months = [’01’, ’02’, ’03’, ’04’, ’05’, ’06’, ’07’, ’08’, ’09’, ’10’, ’11’, ’12’]; $users = []; foreach ($numbers_months as $value) { // dd(date("Y") . ‘-‘ . $value); $users[] = User::where(DB::raw("DATE_FORMAT(created_at, ‘%Y %m’)"), date("Y") . ‘-‘ . $value)->count(); ..

Read more

SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘image’ (SQL: create table products (id bigint unsigned not null auto_increment primary key, name varchar(255) not null, slug varchar(255) not null, short_description varchar(255) null, description text not null, regular_price decimal(8, 2) not null, sale_price decimal(8, 2) null, SKU varchar(255) not null, stock_status enum(‘instock’, ‘outofstock’) not null, feature ..

Read more

I’m running a laravel application with php-7.4 and I’m getting a warning Uncaught IlluminateContractsFilesystemFileNotFoundException: File does not exist at path storage/framework/cache/data/15/36/15366428b9c84adca5876bab69b2a350ab6f22d1. in /sources/sympou/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:54 However this exception only occurs when xdebug is enabled. Then php starts doing the error stack trace until it overflows memory and doesn’t stop. I using PHP 7.4, Laravel 7 and xdebug ..

Read more

I’m running a Laravel application with php-7.4 and I’m getting a warning: Uncaught IlluminateContractsFilesystemFileNotFoundException: File does not exist at path storage/framework/cache/data/15/36/15366428b9c84adca5876bab69b2a350ab6f22d1. in /sources/sympou/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:54 However this exception only occurs when Xdebug is enabled. Then PHP starts doing the error stack trace until it overflows memory and doesn’t stop. I’m using PHP 7.4, Laravel 7 and Xdebug ..

Read more

email verification is not working in laravel 8. when a user is registered, email verification is not sent to user and also it does not generate any error Route::get(‘/verify-email’, [EmailVerificationPromptController::class, ‘__invoke’]) ->middleware(‘auth’) ->name(‘verification.notice’); Route::get(‘/verify-email/{id}/{hash}’, [VerifyEmailController::class, ‘__invoke’]) ->middleware([‘auth’, ‘signed’, ‘throttle:6,1’]) ->name(‘verification.verify’); Route::post(‘/email/verification-notification’, [EmailVerificationNotificationController::class, ‘store’]) ->middleware([‘auth’, ‘throttle:6,1’]) ->name(‘verification.send’); Sourc..

Read more

While I click delete button to remove a data from laravel blade datatable it passes data with url but in controller it shows empty data. Delete button in laravel blade <button class="btn btn-outline-danger" data-toggle="modal" data-target="#destroyModal{{ $data->id }}">Delete</button> delete modal <div class="modal fade" id="destroyModal{{ $data->id }}" tabindex="-1" role="dialog" aria-labelledby="destroyModal{{ $data->id }}" aria-hidden="true"> <div class="modal-dialog modal-dialog-centered" role="document"> ..

Read more

I installed the algolia package, and I configured it, it works well, there is just one problem, it’s the image, I want when it finds image it displays it, if not it displays image img/not-found.jpg.i try this code but not work . suggestion: function(suggestion) { const markup = ` <div class="algolia-result"> <a href="annonces/${suggestion.id}"><span> <img src="${ ..

Read more

Problem Following Laracasts tutorial for Laravel 8 (and to be specific: Chapter 58 – Mailchimp API Tinkering, Section 11 – Newsletters and APIs), I ran into an issue which seemed to be pretty common. After creating a Mailchimp account and using a newly generated API key in Laravel 8, you would test it by Making ..

Read more

In laravel 8 I create a new component with command : php artisan make:component Frontend/Nomination and I use it in my blade.php file as : <x-frontend.nomination :defaultNomination="$defaultNomination" /> but as functionality has ajax requests I try to put some methods inside of this component and returning json But adding line in routes/web.php: Route::get(‘/get_nominated_photos/{nomination_id}/{current_page?}’, ViewComponentsFrontendNomination::class)->name(‘get_nominated_photos’); I ..

Read more

hey guys i have a problem. im trying to eagerload my basket items by defining a scope: { $builder->with([‘product’]); } and my product relation inside basket model is like below: public function product() { if ($this->used_product_id) { return $this->belongsTo(UsedProduct::class, ‘used_product_id’, ‘id’); } else { return $this->belongsTo(Product::class, ‘product_id’, ‘id’); } } but the problem is when ..

Read more