Category "laravel"

How to change the "Maximum execution time screen" on Laravel and show a custom message instead

My application has a complex script that when some type of error happens it exceeds the maximum execution time instead of returning the error, that It's okay fo

Laravel display validation error

I try use this code: @foreach($errors->all() as $error) <li>{!! $error !!}</li> @endforeac

Using spatie/media-library, how to rename a collection of uploaded files?

I would like to rename a collection of uploaded files, but when I use addAllMediaFromRequest() I can't retrieve information from the files. In this example; I

Laravel Carbon get start + end of last week?

I have laravel carbon for get start + end of current week : $startofcurrentweek =Carbon::now()->startOfWeek(); //2020-02-17 00:00:00 $endofcurrentweek =Carb

Laravel having column name in where clause static method

Recently I just realized that Laravel generates a static method with column name when joined in a where clause using camel case example $user = User::whereN

Laravel Blade checkbox not checked

I'm passing variables into the blade from controller. This is my code from controller: $offerConditionsData = Offercondition::where('offerId', $id)->where('

Symfony\Component\Debug\Exception\FatalErrorException Trait not found in Laravel project [closed]

I have create a new trait within my Laravel project, but it doesn't work. First I have created a folder called App\Traits and my trait filenam

Laravel Eloquent relationships with 3 Table

Laravel 3 Table table_user id name table_barang id iduser name statusbarang_id table_statusbarang id name My code UserModels: public function BarangModels()

Laravel relationship hasMany not working

I want to print the name of the user by finding it with 'finished_by' column where id of user is stored. but i get this error: Trying to get property 'name

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

I moved my project from desk to another. When I run php artisan it does not work. I tried to run composer update, but it returns the error Script @php a

How in Laravel run JavaScript code stored in php variable?

In the livewire component, I have the script tag: <script> {!! $script !!} </script> Let's say the $script variable contains console.log('test'); I

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

I am working on Razorpay integration and after succesful payment when I try to save the details to the database I get an error. I am sending t

How to convert a carbon into string, to take the date only?

i have an collection like this 0 => array:4 [ "so" => "SO-1" "product_name" => "EXTREME FORTE - BP" "created_at" => Carbon @1527481346 {#628

Laravel SQL query midnight time not showing

I am making a schedule display system and it shows the schedules of ferries. my problem is if I dont put midnight time in order then query skips midnight time a

Copy to clipboard code in JavaScript doesn't work

I'm trying to write in javascript and I want to understand why it doesn't work? sample order code that I want to copy: 593004485164756431 when I copy to clipboa

PHP using str_starts_with for array to exclude same as with wildcard

This is my ignore list which i have some item that i don't into that $ignoreRoutes = [ 'administrator', 'attachImage', 'login', 'logout', 'l

Laravel: Schedule a job or an artisan command?

I have a Product model with id,name,price. The price value is stored in an external API and i need to fetch it every minute in order to update it in the databas

Laravel component constructor method is only working in local environment

My component looks like this: namespace App\View\Components; use Illuminate\View\Component; use App\Http\Controllers; use Illuminate\Http\Request; class shop

Laravel 5.5 file_put_contents permissions issue

I have a new Laravel project, with Passport and basic authentication installed, and I am getting this error when I try to call the built in /api/register endpo

[laravel][npm] I can't use swiper error Uncaught TypeError: Swiper is not a constructor

Today I try swiper but not working. I install Swiper with npm npm install swiper this is my code index.blade.php <div class="swiper-container">