Category "laravel-5"

Laravel 5 - change default log location, move log file outside the app

How can I change default log file location <project-name>/storage/logs/laravel.log to something like /var/logs/<project-name>/laravel.log?

Laravel 5.1 refresh and seed a single table

I'm looking to refresh and seed a single table in Laravel 5.1. Is this even possible? I have tried the below, but it gives an error (incorrect syntax). php ar

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttp\Psr7\Request

When posting form I am getting this exception Unresolvable dependency resolving [Parameter #0 [ $method ]] in class GuzzleHttp\Psr7\Request Searched and trie

Laravel 5.1 xmlHttpRequest AJAX POST TokenMismatchException

The relevant code is shown below: var csrfToken = "{{ csrf_token() }}"; xmlhttp.open("POST", "/internal/v1/create/strategy", true); xmlhttp.setRequestHeader('X

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

How to validate a file type in laravel

I need to validate that a user only uploads a .jpg I have the following request class. I made the image required but don't know how to check that it is only .

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

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

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

Laravel Migrate Specific File(s) from Migrations

Hi read all the included documentation here in https://laravel.com/docs/5.4/migrations. Is there a way on how to migrate a certain migration file (1 migration

php artisan queue:flush does not flush the queues

Our log is blowing up due to non-stop retries by the queue workers despite having the retries set to 1 only. This is literally caused by 3 different failed job

Artisan, creating tables in database

I am trying to create mysql tables in Laravel 5. I created a file in /project/database/migrations called users.php: [...] public function up() { Schema::cr

Access denied for user 'homestead'@'localhost' (using password: YES)

I'm on a Mac OS Yosemite using Laravel 5.0. While in my local environment, I run php artisan migrate I keep getting : Access denied for user 'homestead'@'local

Laravel 5 issue with wherePivot

I am working with Laravel 5 and I am having issue getting ->wherePivot() to work on a Many-to-Many relationship. When I dd() the SQL it looks like Eloquent i

Add Metadata, headers (Expires, CacheControl) to a file uploaded to Amazon S3 using the Laravel 5.0 Storage facade

I am trying to find out how to add in Metadata or headers (Expires, CacheControl etc.) to a file uploaded using the Laravel 5.0 Storage facade. I have use the p

CONCAT columns with Laravel 5 eloquent

Consider me as laravel beginner The goal is: I have two colums, now I need the id to be prefixed with the component name of same row in the table. For Exampl

How do I enable error reporting in Laravel?

I'm using Laravel 5.2 and I'm trying to import an excel sheet which contains more than 18000 records. the error below appeared. The localhost page isn’t w

How to make Laravel 5 return 404 status code

I am trying to get Laravel 5 (5.1.31) to return a http status response of 404 when a page is not found. I have tried several things and it always returns 200.

make links active in laravel

I have this list of links in Laravel 5.3 @foreach($categories as $category) <li class="list-group-item text-right"><a href="{{url('/product/'.$ca