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
Tag: laravel
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
Laravel doubles the route when navigating between navbar links
I have a problem with laravel routes. I have a navbar with the urls /products and /employee. I manage to switch between perfectly perfectly without giving error. However, when I access the link /products/new and from there I try to go back to /products or go to /employees through the navbar, the link is /products/products or /employee/employee. How do I
How to show array data form controller in blade file (html table)? Laravel
Since I am completely new in Laravel, I have a problem pretty complicated for me. I have controller file ApiHandlerController like this: myview.blade.php as a view file: And web.php file with route: My question is: How to show result of todos from jsonplaceholder.typicode.com in this blade (view) file? Currently, it’s not possible, and every time I try this is an
How to schedule an email at a specific date and time, with the gmail api?
I want to ask if anyone knows how to schedule an email with the gmail API. I am using laravel 8. What I need is, for example, to schedule an email to be sent on a specific day and at a specific time. I already have the function to send mail normally but now I also need the function to
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,
Server-side testing forms laravel [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I don’t know if this can be done but I want to test through a cron job or but the laravel schedule forms from other websites,
How to send mail if TO address is blank in laravel
i am trying to send mail with CC address and without TO address. My code is bellow. I am trying above code and get the bellow error. local.ERROR: Address in mailbox given [] does not comply with RFC 2822, 3.6.2. Answer You Can try with array arguments.
Laravel custom component parameter parsing issue
In my Laravel (7.x) application. I am trying to create a component for links: Component: And getting this issue: However, if I do this, then it works: I am not a fan of declaring the variables just for single use, I like to pass the value directly. Therefore, I prefer the first method. Why is this simple code not working..?