skip to Main Content

Laravel not validate html select box

I have problem with validating html select. I put rules and all other form controls work fine but only select not show validate message. Model class Post extends Model { protected $table = 'post'; static $rules = [ 'title' =>…

VIEW QUESTION

Laravel api bypass auth api for specific ip address

Below is my laravel 8 api route and middleware that I use Route::group(['middleware'=>['auth:api', 'StripScript'],'prefix' => 'v1'], function(){ Route::get('/list', [ListController::class, 'list']); }); I this I want to bypass middleware 'auth:api' if I get request from specific ip address so user doesn't…

VIEW QUESTION

unlink(): Invalid argument this error is occurred while update image in laravel

I am trying to update image to image/brand/ folder but unexpectedly error is occurred. public function update(Request $request,$id){ $validated = $request->validate([ 'brand_name' => 'required|max:4', // 'brand_image' => 'required|mimes:jpg,jpeg,png', ]); $old_image=$request->old_image; $brandimage=$request->file('brand_image'); $image_gen=hexdec(uniqid()); $image_exten=strtolower($brandimage->getClientOriginalExtension()); $image_name=$image_gen.'.'.$image_exten; $image_location='image/brand/'; $image_uplioad= $image_location.$image_name; $brandimage->move($image_location,$image_name); unlink($old_image); Brand::find($id)->update([…

VIEW QUESTION

Laravel: Column 'category_slug' cannot be null

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'category_slug' cannot be null (SQL: update products set category_slug = ?, products.updated_at = 2022-12-23 12:06:26 where id = 1) How I get product category_slug colmun from category slug table. Categories Table: |id|name|slug | |4…

VIEW QUESTION
Back To Top
Search