Category "laravel"

How to Make Laravel Eloquent "IN" Query?

I want to make query in Laravel Eloquent like here its raw MySQL query SELECT * from exampleTbl where id in(1,2,3,4) I have tried this in Laravel Eloquent

how to rename foreign key in Laravel

I want to rename the foreign key in Laravel. This is how, I have created it: Schema::create('holidays', function (Blueprint $table) { $table->increments(

Php artisan migrate no such file or directory

I created a make:migration when I try to run the migration I get the following error No such file or directory (SQL: select * from information_schema.tabl

Laravel lang slug in url

I've followed this article to add multi language into my app and it's working fine, the only issue i need to solve is that languages slug won't add to the url.

Laravel Displaying image from database

so i wanted to display the image not the image name in my views. i got this in my views <img src="{{$post->image}}" /> what i want is to display t

Is it necessary to avoid loops for updating models in laravel?

I'm trying to sort multiple records for a model based on a field and store their ranks in DB. Like below: $instances = Model::orderBy('field')->get(); $ran

How do I call Validator from a namespace with an already existing Validator class

I'm trying to test a function in phpspec which calls Laravel's Validator::make function (http://laravel.com/docs/4.2/validation) However, I'm trying to call th

(Laravel) How to delete multiple models including optional relationships?

Summary I'm trying to let my model controller delete multiple models (selected by an array of IDs) including their selected related models (selected by an arra

Eloquent insert id with sequence next value

I would like to create a new record in a PostgreSQL database table with Laravel eloquent but the table id is not auto incremented and it's make my life more dif

Laravel how to get query with bindings?

I have some query that I need to pass to another query using query builder $query = DB::table('table')->whereIn('some_field', [1,2,30])->toSql(); Model::

Respond with status code 401 on authentication failure using Laravel and Passport?

I'm configuring a Laravel project to use Passport token authentication. Everything seems to be working, but when the auth:api middleware fails, it responds to t

Store multiple fields in JSON column (Nova CMS)

I have a posts table that has a json column "read_more_section". And I want to store on that column the information regarding some fields on the NOVA CMS (title

Minify my css file in laravel [closed]

Is there any tool that helps me in organizing my css files.I have so many css files in my app and i have to include them one by one like {!! H

Laravel authorization policy not working on Show page

I have a laravel app using Policies to assign roles and permissions, i cant seem to access the show page and im not sure what im doing wrong? If i set return tr

How can i hide dt if dd got empty value

I need to hide dt if dd got empty value. how can i do that? <dt class="col-sm-6 text-dark" >Subject</dt> <dd class="col-sm-6">{{$course_

What is Passport in Laravel? [closed]

I am a starter of web services. I have to make APIs using Laravel for mobile application. In the Laravel documentation, I have got API Authent

How to use access_token to authenticate SPA with Laravel 5.4

I'm trying to authenticate my single page app (written in Marionette) with my Laravel 5.4 app. In my previous experience, an SPA would: send the username &

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

Laravel/ PHP: Order By Alphabetical with numbers in order [duplicate]

When ordering things by Alphabetical Order, I'm left with this: S1 Episode 1 S1 Episode 11 S1 Episode 12 S1 Episode 2 S1 Episode 3 S2 Episod

laravel migration best way to add foreign key

Simple question: I'm new to Laravel. I have this migration file: Schema::create('lists', function(Blueprint $table) { $table->increments('id'); $ta