Laravel Unique keyword for particular Column

I'm using "unique" keyword for validating unique users for employee_id in controllers, in my database there is column called company_id , while adding new user they will be set us some company_id ,when i add new user for my company employee id will b...
more »

2017-09-16 10:09 (2) Answers

Laravel `with` issues

I've got 3 models defined as such: class Driver extends Model { public function provider(){ return $this->belongsTo(Provider::class); } } class DriverPhone extends Model { public function provider(){ return $this->...
more »

2017-06-26 17:06 (1) Answers

Laravel append URI in route

Hi I want to append the uri in laravel route function. e.g we have /search?type=listing //how do i can achieve this with route('search',['type'=>'listing']) Once the we are on the search. I want to have all the variable appended to search l...
more »

2017-06-19 11:06 (2) Answers

Laravel api route class to found error

I'm currently working on api jwt based authentication off a boiler plate on SitePoint. So far I've gotten everything working but I'm stuck on this point. My Controller looks like this: namespace App\Api\V1\Controllers; use Illuminate\Http\Request...
more »

2017-04-29 02:04 (1) Answers

How can I search with belongsto laravel?

My query to search for a username in a store listing is as follows: $data = Store::join('users AS b', 'b.id', '=', 'stores.user_id') ->where('b.name', 'like', '%hazard%') ->paginate(); It works. But I use join to do...
more »

2017-04-23 08:04 (2) Answers

Laravel functional testing ajax control

In laravel 5.4, I can see that there are methods such as: $browser->pause(1000); $browser->waitFor('.selector'); $browser->waitForLink('Create'); But I don't see these in Laravel 5.3. We have two chained select boxes where second select...
more »

2017-04-14 08:04 (2) Answers

How to append query string to url in laravel 5.3

I'm using laravel 5.3 and in postLogin method, I want to append api_token as query string to url as follows: http://localhost/Exams/student/dashboard?api_token=4ZtxTu7fAwYpcPYRu46GWmVfncPO0i My LoginController.php is: public function postStudentLo...
more »

2017-02-16 06:02 (2) Answers

Search in ElasticSearch

I have a problem in elasticsearch. In the console Kibana, I am executing this code, GET bounce_gmd/_search { "query": { "match_phrase": { "date_added": "2017-02-08" } }, "size": 0, "aggs": { "date_added": { "terms": { "field": "bo...
more »

2017-02-14 10:02 (1) Answers

Query into wordpress db from laravel

I have setup my main application in Laravel and set up WordPress for blog (CRUDE) operation. Installed WordPress inside public folder and configured database settings for 2nd database in config/database.php in Laravel. The trouble I'm having is how...
more »

2017-02-12 19:02 (2) Answers

Rating system implementation in Laravel

I'm already working in a web application in Laravel that needs a rating system between users. So, I've been reading the Laravel documentation and some posts here and there but I keep wondering which is the best way to accomplish what I want to do. I ...
more »

2017-02-06 10:02 (1) Answers

What happened to laravel's redirectTo() method?

We can override this property to redirect users after login: protected $redirectTo = '/'; And here is from documentation: If the redirect path needs custom generation logic you may define a redirectTo method instead of a redirectTo property...
more »

2017-02-03 13:02 (2) Answers

Laravel collections mapWithKeys

I have been trying to create an array using laravel's collection function called mapWithKeys, but I couldn't achieve what I need. Here is my code, $years = range(1900, date('Y')); return collect($years)->mapWithKeys(function($value){ return...
more »

2017-02-01 13:02 (1) Answers

Avoid repeated code in Laravel controller

In each controller in my Laravel application, I use all of this namespace: use App\User; use App\Http\Controllers\Controller; use Google\Auth\OAuth2; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades; use Illuminate\Support\Facade...
more »

2017-01-30 22:01 (2) Answers

Laravel passport installation error

I've just downloaded the latest laravel 5.3 and I'm trying to install passport, but I'm getting the following composer error: Your requirements could not be resolved to an installable set of packages. Problem 1 - laravel/passport v2.0...
more »

2017-01-27 04:01 (2) Answers

Laravel testing undefinied method

I try to write tests in laravel, but I can't even run example test, bcs I get error: λ phpunit PHP Fatal error: Uncaught Error: Call to undefined method PHPUnit_Util_Configuration::getTestdoxGroupConfiguration() in E:\www\ikcms\vendor\phpunit\phpu...
more »

2017-01-24 13:01 (3) Answers

%like% query not giving result as expected

i'm working on search functionality, i'm querying based on the user input but i'm not getting the result as expected //if user searches walter getting proper response http://localhost:8000/api/v1/search/walter { "data": [ { "id": 1,...
more »

2017-01-21 13:01 (1) Answers