Skip to content
Advertisement

Tag: laravel

Insert an array using seeders with laravel

Hi I want to insert this array using seeders into Laravel framework: I read that I can do it this way: But I want to insert these countries in the column name of my table: I don’t want to do it manually, I want to insert the array of above completely. Thank you so much. Answer Try this solution

Laravel 8: Symbolic Link not appearing in public

I have a problem with symlink. after I run this command php artisan storage:link the uploaded images are showing in the public and storage folder. I can display my img by using this code but after a day the shortcut of the images folder in public has gone and when I run the php artisan storage:link it says it has

How to add a link to route to another page in laravel

I have a view page which i need to add a link to redirect the user to a booking page. I’m not so familiar with PHP so any guides would be helpful. This is the table i have, and i need to add a link next to the of Available to redirect to another page called “quickbookingmodal.blade.php”. This file is

Custom validation not calling the passes() function

I am trying to make a validation that will check whether at least one item is provided in an array following the steps in Custom Validation Rules Routes.php ValidateArrayElementRule.php ExamPaperQuestionsController.php In my test file I have ExamPaperQuestionStoreRequest.php The test is failing Expected status code 422 but received 201. I can see the text “HERE” is logged but “there” is not.

How to solve the @json Blade directive red underline on VSC?

This variables are working perfectly, I wonder why are they with a red underline. Anyone knows how to correct this? Error msg Answer Since VSCode doesn’t ship intellisense for [blade] template files in default, we need to install extra extensions for correct grammar checking and snippets support for .blade.php files. Here are some of them onecentlin.laravel-blade * works best for

Laravel 8: How to validate entering dimensions

I have a form and there is a field in this form called dimensions and users MUST enter a value like this: 10x10x10 So I am separating length, width and height by x. But now I don’t know how to make this validation with Laravel: So the question is: How can I force users to separate each dimensions by writing

How to redirect a user to different dashboards based on a level field in the ”’users”’ table in Laravel Breeze?

Please forgive me if my question is too generic but I am at my wits end. I have a users table with a level field as shown given below: $table->unsignedSmallInteger(‘level’)->after(‘password’); I want to redirect the user to different dashboards based on the value of the level field. For example for level 0 user admindashboard for level 1 user userdashboard I

Unique validation with 2 columns – Laravel 8.x

I’ve been trying make my validation so that an extension must be unique to it’s own company but not to other companies. Here is my DB table: And my validation rule looks like this: But still I got errors saying that the extension number is already taken. It seems that the Unique rule doesn’t accept multiple columns, only one. Is

Advertisement