Category : list

Got myself tangled up trying to put a statement into a ::raw query: $rawStatement = "DISTINCT Product"; $product_codes = DB::table(‘Chemical’) ->JOIN(‘ChemicalTarget’, ‘Chemical.ChemicalID’, ‘=’ , ‘ChemicalTarget.ChemicalID’) ->select(DB::raw(function($query) with ($rawStatement) { $query->select(DB::raw($rawStatement)); }) ->orderBy(‘Product’, ‘asc’) ->groupBy(‘Product’) ->lists(‘Product’); //<– This is required for existing front end. Eventually I’m going to try to put this into that statement: CONCAT(Product, ..

Read more

$students = Student::elect(‘students.*’, ‘users.email’)->join(‘users’, ‘students.user_id’, ‘users.id’)->orderBy("id", "desc")->skip($page * $pageSize)->take($pageSize); if (request(‘se’) != "" || request(‘se’) != null) { $se = request(‘se’); $se = str_replace("+", " ", $se); $students = $students ->where(function ($q) use ($se) { $q->where(‘students.student_number’, ‘like’, ‘%’ .$se. ‘%’) ->orWhere(DB::raw("CONCAT(`first_name`, ‘ ‘, `last_name`)"), ‘LIKE’, ‘%’ . $se . ‘%’) ->orWhere(‘students.gender’, $se) ->orWhere(‘students.phone’, ‘like’, ‘%’ ..

Read more

In my laravel application when ever I am running the command php artisan route:list its given me the following error: IlluminateContractsContainerBindingResolutionException : Unresolvable dependency resolving [Parameter #0 [ <required> $methods ]] in class IlluminateRoutingRoute at <PROJECT_LOCATION>LaravelvendorlaravelframeworksrcIlluminateContainerContainer.php:977 973| protected function unresolvablePrimitive(ReflectionParameter $parameter) 974| { 975| $message = “Unresolvable dependency resolving [$parameter] in class {$parameter->getDeclaringClass()->getName()}”; 976| > ..

Read more