Category "laravel-5"

how to get name from url dynamically

How to get a part of the url? query to be made: $name = 'LeSant'; // (from url dinamic) // $event = Dias::where('name', $name)->first(); How can I get name

yield inside section in Laravel 8

I am trying to yield a section inside another section which is itself yielded in master.blade.php, but it does not work. master.blade.php <!DOCTYPE html>

How to get array values using foreach in laravel

I am new to laravel and php. I have this code in one of my controllers: $group_by_precedence = array("true", "false"); And this code in the view: @foreach ($gr

Is it possible to change the table name in the migration file-laravel

I created a migration file using php artisan make:migration create_todoapps_table. The migration file was created with the table name as to_do_apps (Schem

Laravel print last executed SQL query with Query log

DB::enableQueryLog(); $mines = Cranks::where([['crank_id', '=', $this->crank_id], ['mine_id', 'like', '%'.$script_value->mine_id.'%'] ])->get(); $query

With html2pdf in generated pdf as all css styles are lost

In my laravel 5.7 / bootstrap 4.4 app I use spatie/browsershot 3.37 and spipu/html2pdf 5.2 to generate pdf file and for my generated pdf file want I set layout

Laravel installer throws error when creating new project

I am trying to create new Laravel application. I have installed XAMPP and Composer. With Composer ( composer global require laravel/installer ) I have installed

Get name of Language instead of Locale name (in Laravel)?

How do I fetch name of locale (language) not just a locale string, but rather the name of that language in LARAVEL? {{ app()->getLocale() }}

Laravel MSSQL Server Connection not working

Laravel version:7.13, SqlServer:2019 SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: An existing connection was forcibly closed by

How to stop the GET method is not supported for this route from showing?

I have a working Laravel project with loads of different routes. I'm currently testing it and one of my tests was to check if a user were to use a delete or pos

What will the best solution for this multiple optional filter?

These are all optional fields, so will I have to write multiple queries with conditions or is there any way to handle this using Laravel? What will be the query

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

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 order by eager loaded relationship in Laravel 5.5?

The code below works perfectly and displays all products with discounts in JSON Format for my API. But I want the result ordered by id in the discounts table. S

Fresh Laravel install deletes server.php on artisan serve

I'm a bit fresh to Laravel. I installed it via composer in the xampp/htdocs file. I installed the latest version 5.6. The install works with no errors, and the

Failed when put cache to file in laravel

When i run Cache::put('max_age','100',60)); Then the error said that file_put_contents(storage/framework/cache/data/8f/87/8f87426f74633c0fa8f717150f13e8fc04

Sendgrid 550 unauthenticated senders not allowed laravel swiftmailer

When I'm using SendGrid to send email in Laravel, it results in the following error: "550 unauthenticated senders not allowed" I couldn't find out why thi

Stripe exception is not working .giving laravel errors instead of exception errors

I am using stripe payment gateway in my project. I am trying to display exception errors when a user entered expired card number. but instead of showing me erro

Required field only if another field has a value, must be empty otherwise

My question is about Laravel validation rules. I have two inputs a and b. a is a select input with three possible values: x, y and z. I want to write this rule

set mail driver dynamically from database for different email in notification

I want to set the following setting dynamically before I notify the user. MAIL_DRIVER= MAIL_HOST= MAIL_PORT= MAIL_USERNAME= MAIL_PASSWORD= MAIL_SENDER_EMAIL= M