Category : php

I’ve problem on refreshing model collection after detach on Laravel livewire. I want to remove detached item from view without refresh full page, but it seem not work. it need to refresh full page to re render the view. I have tried to $model->refresh() after detach(), and its work but $model->refresh() duplicate already loaded relationship ..

Read more

I want to install SQL server driver for php on laravel sail, after building containers Docker cannot install sql server driver. I’m getting trying to access array offset error .. docker-compose.yml version: ‘3’ services: laravel.test: build: context: ./vendor/laravel/sail/runtimes/7.4 dockerfile: Dockerfile args: WWWGROUP: ‘${WWWGROUP}’ image: sail-7.4/app extra_hosts: – ‘host.docker.internal:host-gateway’ ports: – ‘${APP_PORT:-80}:80’ environment: WWWUSER: ‘${WWWUSER}’ LARAVEL_SAIL: ..

Read more

I using laravel api resource for my FRONT-END site. Actually i using also laravel pagination to handle paginate in FRONT-END. The api resource structure like this: { "data": […], "links": […], // handle pagination "meta": […] // handle pagination } But i want to send count of query results without considering paginating .For example i ..

Read more

I have articles witch can have one single category that’s Main category with category_id. and additional multi categories with pivot table everything working it’s stores but i can’t get data on web i’m only getting articles with single category how can i get articles with single and with multi categories in one variable? article model: ..

Read more

I have an error in my Middleware that I’m not managing to solve. Does anyone know what it could be? ErrorException: Trying to access array offset on value of type null File "/app/Http/Middleware/Tracking.php", line 47, in AppHttpMiddlewareTracking::handle return $next($request); <?php namespace AppHttpMiddleware; use Closure; use IlluminateHttpRequest; use IlluminateSupportFacadesCookie; class Tracking { /** * Handle an ..

Read more

I need to read special configuration for my app in Laravel 8, all my settings are stored in a single filename naned mydata.php inside folder/config inside mydata.php return [ ‘setting1’ => 99, ]; I have tried to read it using dd(config(‘mydata.setting1’)); but always return null, I need to get setting1 value so, I have cleared ..

Read more

I am trying to implement Logout functionality on my Laravel app with TALL stack, I am firing logout event from my blade via Livewire wire:click but it doesn’t seem to fire any method from its own component. Loading my component in app.blade.php layout: <li class="flex"> @livewire(‘logout’) </li> logout.blade.php <a wire:click="logout" class="some-classes" > <svg class="w-4 h-4 ..

Read more

@throws IlluminateContractsContainerBindingResolutionException @throws IlluminateContractsContainerCircularDependencyException */ public function build($concrete) { // If the concrete type is actually a Closure, we will just execute it and // hand back the results of the functions, which allows functions to be // used as resolvers for more fine-tuned resolution of these objects. if ($concrete instanceof Closure) { return $concrete($this, ..

Read more

I’m trying to run the application jobs on a shared host in the scheduler function using: $schedule->command(‘queue:restart’)->everyFiveMinutes(); $schedule->command(‘queue:work’)->everyMinute(); but I get this error: production.ERROR: The Process class relies on proc_open, which is not available on your PHP installation. I have already published the flare.php and did set collect_git_information to false (I also re-cached the application) ..

Read more

I have Articles table and it haves category_id witch is related to Categories table. But now i added + articles_categories pivot table. Now i added one category with category_id and multi categories with pivot table but i can’t appearance pivot table data in categories blade. public function category($slug) { $category = AllCategory::bySlug($slug); if (!$category) { ..

Read more

I installed the algolia package, and I configured it, it works well, there is just one problem, it’s the image, it displays one and the same image for each product. <div class="aa-input-container" id="aa-input-container"> <input type="search" id="aa-search-input" class="aa-input-search" placeholder="cherche annonces …" name="search" autocomplete="off" /> </div> <script type="text/template" id="hits-temp"> @{{ __highlightResult.h1 }} <div class="row song"> <a class="song-link" ..

Read more