Laravel searching for Arabic string inside Json
Hello I have a project table which has a field name in my db which is multi lang so I stored it as json so I can store each lang value the problem is that the arabic lang is being…
Hello I have a project table which has a field name in my db which is multi lang so I stored it as json so I can store each lang value the problem is that the arabic lang is being…
I have a example of cascade delete but it looks too big and complicated, is there a way to shorten this code? protected static function boot() { parent::boot(); static::deleted(function ($parent) { // $versions = $parent->game_versions(); $versions = $parent->game_versions; foreach($versions as…
I am working on a project and I needed to retrieve data from an Table A to Table C with a Table B as an intermediate using the HasManyThrough from Laravel Doc Has Many Through. I have three Tables Categorie…
In my Controller, I need to check if a session has expired, and if so, update the value: public function some_method(Request $request) { $session_expiry_date = session('session_expiry_date'); if ($session_expiry_date < now()) { $some_value = Str::random(30); session(['some_value' => $some_value]); } else {…
i had a problem with Laravel 10. I need to scroll to next element by pressing a button. I have already tried with myelement.scrollIntoView() and window.scrollTo() functions with no success, what is wrong? My js: import {polyfill, scrollIntoView} from "seamless-scroll-polyfill";…
I am trying to find best practices for deeply integrating with an external API. I currently create services that can make calls to APIs, but when receiving data from these APIs I find myself having to validate and sanitize this…
In our project, we used the latest version of maatwebsite which is 3.1 We want to set the first value for example in E1. In lower version, they have the setcellValue. Question: Does 3.1 have the equivalent setCellValue? Note: I…
I have data that I'm trying to groupBy a field on index function public function index() { abort_if(Gate::denies('workstep_access'), Response::HTTP_FORBIDDEN, '403 Forbidden'); $thisUser = Auth::user(); $worksteps = Workstep::with(['site_id'])->where('site_id', $thisUser->site_id)->get(); return view('admin.worksteps.process', compact('worksteps')); } Adding ->groupBy('subprocess_id'); before->get(); As below $worksteps = Workstep::with(['site_id'])->where('site_id',…
I'm tring to check if null with @if for data in show.blade <li id="step6"><strong>Schritt 6<br>@foreach($dbQuery as $query){{$query->sixth_step}}@endforeach</strong></li> if sixth_step is null to remove the <li> list item element tried the following but not working @foreach($dbQuery as $query){{$query->sixth_step}} if({{$query->sixth_step}} !=null) <li…
I am having problems summing specific data from an array based on an ID list in another array. Let's say I have an array like this: [ [ "student_id" => "1", "score" => "10", ], [ "student_id" => "1", "score"…