After adjusting Route::resource in web.php happing Missing parameter error

Advertisements I’m studying Laravel CRUD routing. Yesterday I post my problem, and many people helped me. In my case, I use Mr.Dasun Tharanga’s answer and solved. Is there easyest way to change 'resouce' name in web.php [Laravel9] It works really nicely, but at edit page I got this error. Missing required parameter for [Route: ddd.update]… Read More After adjusting Route::resource in web.php happing Missing parameter error

Non-static method Illuminate\Http\Request::url() cannot be called statically

Advertisements I’m using Laravel 9 and I want to redirect user to same page url, so I tried this: if(!$status){ alert()->error(‘Wrong code!’); return redirect(Request::url()); } And I have included as well the Request but don’t know why get this error: Non-static method Illuminate\Http\Request::url() cannot be called statically So what’s going wrong here? How can I… Read More Non-static method Illuminate\Http\Request::url() cannot be called statically

Laravel 9 foreignId [Foreign key constraint is incorrectly formed]

Advertisements I am getting an error while using foreign keys. Products migration Schema::create(‘product’, function (Blueprint $table) { $table->id(); // Ürün adı $table->string(‘name’); //Ürün adı //$table->unsignedBigInteger(‘category_id’); $table->foreignId(‘category_id’)->constrained(‘category’); $table->timestamps(); }); Category migration Schema::create(‘category’, function (Blueprint $table) { $table->id(); $table->integer(‘main_category’)->nullable(); $table->string(‘name’); $table->integer(‘commission’); }); Error General error: 1005 Can’t create table laravel.product (errno: 150 "Foreign key constraint is incorrectly… Read More Laravel 9 foreignId [Foreign key constraint is incorrectly formed]

Laravel update only refreshes a page

Advertisements My update page isn’t working, when I’m submitting a form it only refreshes a page and adds some stuff to my URL, for example: http://127.0.0.1:8000/admin/employees/102/edit?_method=PUT&_token=mj3lrHqoYm1wiLwWiNQ8OX0kNRjmW4QVRuLpgZxY&image_path=&name=Libbie+Ebert&phone_number=380324244497&email=brekke.lola%40example.org&position_id=7&payment=186799&head=Asia+Frami&recruitment_date=2022-01-10. I already cleared route cache and its still not working, and also tried to use dd function but it’s not showing up. What can be wrong? My model: class… Read More Laravel update only refreshes a page

Laravel can't Delete data, it can enter on destroy() function but it parameter return null

Advertisements So i’m try to delete data on laravel using resource route. but the data remain and still return the function. Im also try to delete the Greens from destroy() parameter, it make $greens containing ‘id’. but still, i want to keep destroy() parameter to be (Greens $greens), not just ($greens) Controller : public function… Read More Laravel can't Delete data, it can enter on destroy() function but it parameter return null

How to split words of an input by space

Advertisements I have a Laravel 9 forum project and I have added this form field: <div class="create__section"> <label class="create__label BMehrBold" for="tags">Tags (separate each one by [space])</label> <input type="text" class="form-control BKoodakBold" id="tags" placeholder="Enter the keywords here"> <span id="tagshow"></span> </div> So as you can see I have said that Each tag should be separated by space. So… Read More How to split words of an input by space