Category : spatie

I am using laravel spatie for filtering the model i have following filters in allowed filter array $this->allowedFilters = [ ‘name’, AllowedFilter::exact(‘company_id’), ‘location’, ‘summary’, ‘client_name’, ]; when I make request like past-projects?filter[company_id]=${companyId}&filter[name]=${search}&filter[summary]={company_id} it searches for the data which exactly contains all the passed search params with AND condition and returns no results if any of ..

Read more

If i make a request like this in spatie analytics: $analyticsData = Analytics::performQuery( Period::days(1), ‘ga:sessions’, [ ‘metrics’ => ‘ga:sessions, ga:pageviews’, ‘dimensions’ => ‘ga:yearMonth’ ] ); what does "days(1) refer to ? is it from 00:00 to 23:59 or from 24 hour ago until now? i tried reading the start and end time in the result ..

Read more

I want to convert my existing app to multi-tenant and don’t want to use multiple databases. just read that the given package is allowing that. https://github.com/spatie/laravel-multitenancy I have read the single database documentation here: https://spatie.be/docs/laravel-multitenancy/v2/installation/using-a-single-database But what’s next ?? Let’s say right now users are storing into users’ tables, and by using this package I ..

Read more

Hello There im new to laravel and want to use spatie’s query builder package for filtering and sorting but this issue occurs while installing. Problem 1 – spatie/laravel-query-builder[3.5.0, …, v3.x-dev] require illuminate/database ^6.20.13|^7.30.4|^8.22.2 -> found illuminate/database[v6.20.13, …, 6.x-dev, v7.30.4, 7.x-dev, v8.23.1, …, 8.x-dev] but it conflicts with another require. – Root composer.json requires spatie/laravel-query-builder ^3.5 ..

Read more

I am new to Laravel and I am having modify an existing Laravel application to only give some permission to a guard. When I use the command php artisan permission:show, I see the following: Guard: admin +—————————————+—————+ | | Administrator | +—————————————+—————+ | admin | ✔ | | admin.admin-user.create | ✔ | | admin.admin-user.delete | ..

Read more

I try to create a new laravel app via the laravel installer with laravel new <appname>. This works without a problem. Once I try to install the spatie/medialibrary I get the following error that I cannot explain: $ composer require "spatie/laravel-medialibrary:^9.0.0" ./composer.json has been updated Running composer update spatie/laravel-medialibrary Loading composer repositories with package information ..

Read more

I’m saving images from local disk to cloud (DO storage) disk by following codes in controller $claim->addMediaFromDisk($front_image, ‘public’)->usingFileName("front-image")->toMediaCollection(‘claim-images’, ‘do_spaces’); $claim->addMediaFromDisk($right_image, ‘public’)->usingFileName("right-image")->toMediaCollection(‘claim-images’, ‘do_spaces’); $claim->addMediaFromDisk($left_image, ‘public’)->usingFileName("left-image")->toMediaCollection(‘claim-images’, ‘do_spaces’); this trick works but saving those images in 3 different directory in cloud storage. But I want all three images in same directory. I see there is built in method ..

Read more

When I try to do this php artisan migrate –path=database/migrations/landlord –database=landlord I get the following error: PS C:laragonwwwcommerce> php artisan migrate –path=database/migrations/landlord –database=landlord ************************************** * Application In Production! * ************************************** Do you really wish to run this command? (yes/no) [no]: > y Dropped all tables successfully. IlluminateDatabaseQueryException SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect ..

Read more

I use Laravel v8 with spatie/laravel-feed v4 with this codes: routes/web.php Route::get(‘feed’, ‘[email protected]’)->name("feeds.main"); config/feed.php <?php return [ ‘feeds’ => [ ‘main’ => [ /* * Here you can specify which class and method will return * the items that should appear in the feed. For example: * [AppModel::class, ‘getAllFeedItems’] * * You can also pass ..

Read more

In laravel I have used spatie/data-transfer-object to cast one of my column as protected $casts = [ ‘details’ => ProductDetails::class, ]; In my ProductDetails DTO I further want to cast two of my date fields class ProductDetails extends CastableDataTransferObject { use HasDates; public int $number #[CastWith(ProductDateCaster::class)] public int $start_date; //est DD/MM/YY #[CastWith(ProductDateCaster::class)] public int $end_date; ..

Read more

strong textI am getting different google api results when running this function on locally in comparison to my server. public static function debug(){ $date = Carbon::now(‘Europe/Berlin’); $date->setISODate(2021,25); $start = $date->copy()->startOfWeek(); $end = $date->copy()->endOfWeek(); $ga= Analytics::performQuery( Period::create($start , $end), ‘ga:pageviews’, [ ‘metrics’ => ‘ga:pageviews’, ‘dimensions’ => ‘ga:date’, ‘filters’ => ‘ga:pagePath=~/page1*,ga:pagePath=~/page2*,ga:pagePath=~/page3*,ga:pagePath=~/page34,ga:pagePath=~/page5*’ ] ); return $ga; } Results ..

Read more

I am using this library : https://github.com/spatie/laravel-analytics I am trying to figure out how to do a User Activity request as documented here: https://developers.google.com/analytics/devguides/reporting/core/v4/user-reporting. I know that you can make custom reports with laravel analytics with ‘Analytics::perfomQuery’. I cant seem to find the right metrics and dimensions to get the request right. I have tried ..

Read more

I have been using spatie media library for over a year and a half and over the last month have encountered the folloing error: SymfonyComponentProcessExceptionRuntimeExceptionSpatieMediaLibraryJobsPerformConversions The provided cwd "" does not exist. SymfonyComponentProcessExceptionRuntimeException · The provided cwd "" does not exist. vendor/symfony/process/Process.php:344 SymfonyComponentProcessProcess::start } if (!is_dir($this->cwd)) { throw new RuntimeException(sprintf(‘The provided cwd "%s" does not ..

Read more