Category : laravel-5

I want to insert " [email protected]#$%^&*()?<>:| " this string into my table but when I hit save it inserts only this much in table [email protected]#$%^, rest of the characters doesn’t store in the table. Here is my laravel controller code public function store(Request $request) { $x = $request->get(‘task_name’); DB::insert(‘insert into tasks (task_name) values (?)’, [$x]); ..

Read more

My Laravel application (version 5.0.33) has suddenly started throwing the following error: local.ERROR: exception ‘PDOException’ with message ‘SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.’ ..

Read more

I have a legacy application in laravel 5.2 and we use queues to process jobs. We observed that the queue can sometimes get too many jobs which leads to duplicate jobs getting dispatched because the previous jobs don’t complete processing and the cron that dispatches such jobs runs again and ends up dispatching them over ..

Read more

i have the next query with two subequery how can convert it to eloquent, i have some troubles with eloquent conversion :S. Thanks select * from (select * from ( select * from "public"."tabla_procesados" where "state" LIKE ‘%Failed%’ and id_execution = (select max(id_execution) from public.tabla_procesados) order by public.tabla_procesados.ts_start_processing desc ) a limit 1) b where ..

Read more

This is my Ajax Query function updateTask() { var task_id = document.getElementById(‘edit’).getAttribute(‘edit_task_id’); var newTask = document.getElementById(‘edit_task’).value; var csrf = document.querySelector(‘meta[name="csrf-token"]’).content; var close = document.getElementById(‘close’); var editob = new XMLHttpRequest(); editob.open(‘POST’, ‘/{task_id}/{newTask}’, true); editob.setRequestHeader(‘X-CSRF-Token’, csrf); editob.setRequestHeader(‘Content-type’, ‘application/x-www-form-urlencoded’); editob.send("task_id=" + task_id, "newTask=" + newTask); console.log(newTask); console.log(task_id); } This is y Controller public function editTask($id, $newTask){ //$x = ..

Read more

when I make save in (admin/settings) I got (local.ERROR: Undefined index: utubelink) error it is just in (admin/settings) other admin pages work fine. I can not make any changes like changing the logo or name of the site. laravel.log [2022-01-08 15:46:38] local.ERROR: Undefined index: utubelink {"exception":"[object] (ErrorException(code: 0): Undefined index: utubelink at /home/u0462672/new.maxtella.net/app/Http/Controllers/Admin/Settings.php:44) Settings.php namespace ..

Read more

please help me fix my code. I have an initial function is as follows: public function chart(){ DB::enableQueryLog(); $chartKategori = DB::table("ms_pengaduan_kategori as mpk") ->leftJoin(‘tr_pengaduan as t’, ‘t.kategori_id’, ‘mpk.kategori_id’) ->select(DB::raw(‘count(t.pengaduan_id) jumlah’), "mpk.nama_kategori", "mpk.kategori_id") ->groupBy(["kategori_id", ‘nama_kategori’]) ->orderBy(‘kategori_id’) ->get(); $faqs = [DB::getQueryLog(), $chartKategori]; return response()->json($faqs); } The result is: [ [ { "query":"select count(t.pengaduan_id) jumlah, `mpk`.`nama_kategori`, `mpk`.`kategori_id` from ..

Read more

i dont know why it is going to store in mkstudent.classes_student table , i mean i created many to many table class_student and when i tray to store a a student that have a class this error is happening any one who can help me please? the code is here student controller public function store(createstudentrequest ..

Read more

here is my Classes model class Classes extends Model { protected $fillable = [ ‘name’,’course_catagory_id’,’teacher_id’ ]; public function coursecatagory() { return $this->belongsTo(CourseCatagory::class); } public function teacher() { return $this->belongsToMany(Teacher::class); } } and migrations public function up() { Schema::create(‘classes’, function (Blueprint $table) { $table->bigIncrements(‘id’); $table->string(‘name’); $table->integer(‘course_catagory_id’); $table->integer(‘teacher_id’); $table->timestamps(); }); } and create classes page <div class="card-body"> ..

Read more

i got this error when i load any get url or login or register it gives this error SymfonyComponentHttpFoundationResponse::setContent(): Argument #1 ($content) must be of type ?string, IlluminateRoutingRedirector given, called in C:xampphtdocsAppcorevendorlaravelframeworksrcIlluminateHttpResponse.php on line 72 laravel 8 any resolve here Sourc..

Read more

This question is asked before but non of the answers work for me. This is the Kernel.php <?php namespace AppConsole; use AppConsoleCommandsTestRunKernel; use AppLog; use IlluminateConsoleSchedulingSchedule; use IlluminateFoundationConsoleKernel as ConsoleKernel; class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. * * @var array */ protected $commands = [ TestRunKernel::class ]; ..

Read more

I’m using Laravel 5.4 and I have added this Migration: public function up() { Schema::create(‘episodes’, function (Blueprint $table) { $table->increments(‘id’); $table->integer(‘course_id’)->unsigned(); $table->foreign(‘course_id’)->references(‘id’)->on(‘courses’)->onDelete(‘cascade’); $table->string(‘type’, 10); $table->string(‘title’); $table->string(‘slug’); $table->text(‘description’); $table->text(‘body’); $table->string(‘videoUrl’); $table->string(‘tags’); $table->string(‘time’, 15)->default(’00:00:00′); $table->integer(‘number’); $table->integer(‘viewCount’)->default(0); $table->integer(‘commentCount’)->default(0); $table->integer(‘downloadCount’)->default(0); $table->timestamps(); }); } Now when I run php artisan migrate, I get this error: SQLSTATE[HY000]: General error: 1005 Can’t ..

Read more

I’m working with Laravel 5.4 and I wanted to install Laravel Sluggable package but I got this error on the Terminal: Your requirements could not be resolved to an installable set of packages. Problem 1 – cviebrock/eloquent-sluggable[8.0.0, …, 8.0.8] require illuminate/config ^8.0 -> found illuminate/config[v8.0.0, …, v8.77.1] but these were not loaded, li kely because ..

Read more