Category "laravel"

Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs

I'm currently learning laravel and creating my first form. Everything is awesome until I want to use {{ old('') }} helper in my blade file for radio buttons. I'

Integer or String for a phone number?

I want to know if I have to use a string or an integer for a phone number? I have tried an integer but I have a problem in my validation. ... table->integ

Clients authentication and user authentication with laravel

I am working on api, where I have the following models. Merchant -> hasMany -> Shops Shop -> hasMany -> Customers Each merchant will have api tok

$trigger - error with <x-dropdown> in Laravel Breeze

<x-dropdown class="form-control" id="exampleFormControlSelect1"> <xd-item>1</xd-item> <xd-item>2</xd-item>

Laravel mix, webpack, terser - strip console log in production bundle

I'm trying to strip console log and console debugs from the production build of my laravel + react app. I found many different solutions but none seemed suitabl

How to to send mail using gmail in Laravel?

I try again and again to test sending an email from localhost but I still cannot. I don't know anymore how to do it. I try search to find solution but I cannot

Laravel get user data with profile

I have user and profile models with followers/following. What I want is to get the User data with the Profile data merged when calling Profile::followers. Now I

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

I made import data using Excel on Laravel Maatwebsite Excel 3.1. but when in the database there is the same data (Primary Key) then there is an error message

Tailwind is not working on a new laravel project

I just installed a clean Laravel project with the Jetstream starter kit, so it also installed Tailwind CSS. I then tried to use the sample code from Tailwind bu

Laravel Eloquent get() indexed by primary key id

I often find it very useful to index my results by the primary key id. Example: $out = []; $users = User::where('created_at', '>=', '2015-01-01')->get(

Handling expired token in Laravel

What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the pa

How to install bootstrap in laravel 8

All of the info I can find online says that you should install bootstrap by running composer require laravel/ui and then php artisan ui boostrap. However, in La

Laravel relationship belongsToMany with composite primary keys

I have 3 tables and I'm trying to make relations between order_products and order_products_status_names. I have transition/pivot table named order_product_statu

Laravel: Remove an attribute in returned result

I have the following code: $orders = Order::all(); return $orders; This returns something like this: [ { "id": 123, "qr_code": "foo.p

WHERE IN array binding in DB::raw laravel 5.4

I'm trying to bind an array in a raw WHERE IN query in the Laravel DB example: $arr = [1,2,3]; DB::select(DB::raw("select * from test1 WHERE id IN ? "), [$arr

How does this Facade works

I'm working with Laravel 5.8 and it's an Online Store project written by other programmers. Basically I have faced something weird that never seen before. Let's

Error: ENOENT: no such file or directory, open './node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&strict=false&minify=false'

I'm trying to make a JWT auth with laravel on my back and react-native (with expo) on my front. I have already set up my endpoint to get my token and is working

How To Create A New Database For Each Tenant on Laravel Sail, Docker

I'm developing a multi-tenant app first time by using Laravel 8, Tenancy For Laravel on Docker and WSL2. My issue occures when I try to create a tenant. I want

Why are some Tailwind classes not having effect in JetStream?

Some classes like text-green-500, rounded are having effect and the styling is updated. Ohter classes, like bg-black, don't have any effect on the styling. I am

How to update array value in Laravel

My controller code: $userBasicInfoId = $this->userBasicInfo->where('user_id', $userProfile['id'])->value('id'); if($userBasicInfoId) {