Skip to content
Advertisement

Tag: laravel

how to modify user table

I would like to add two fields to the table user. the first name and a key. on RegisterController On user model table migration I have no errors, but the registration does not go to the database and I stay on the registration page Answer Remove this line ‘cle’ => [‘required’, ‘string’, ‘unique:users’], from your validator() method, as you’re generating

Laravel Duplicate Route names

I’m using same route name for the get & post methods in route. those routes are using for the same purpose. ex : I’m calling to load add view form using get route Route::get(‘add’, ‘UserController@addView’)->name(‘user.add’); then, I’m calling to store data in that form using post route Route::post(‘add’, ‘UserController@store’)->name(‘user.add’); is there any issue , If I use the same route

How to save data to db using laravel import?

I have prepared code below, and I’m using the dump to trace if it passed to models’ create function. When I checked in the database there is no data added, I’m just wondering why it does not have when it is already passed in User::create function (verified by string “created” below in the picture). These are the dump datas returned

Replace all non printable characters except newline characters

I want to replace all non printable characters, especially emojis from a text but want to retain the newline characters like n and r I currently have this for escaping the non printable characters but it escapes n and r also: Answer [:print:] is a POSIX character class for printable chars. If you use it in a negated character class,

Advertisement