raw SQL to laravel query

Can anybody please help me to write a DB query version of the SQL statement below. I need a little help around the select statement and the partitioned joins. I have managed to do this so far. $query = DB::table(raw('SapakInAdminOrder a')) ->sel...
more »

2017-11-15 13:11 (1) Answers

Getting fields on Pivot table through laravel

I have a Pivot table M:N relationship in Laravel 5.5. Essentially my datastructure is; Table_A --------- id name Table_A_has_table_B <pivot> --------- table_a_id table_b_id other_field Table_B --------- id name In my Table_A Model I hav...
more »

2017-11-13 11:11 (1) Answers

Lessen Space between content and footer

I am making a homepage for a press release. There is a big space between my content and my footer, which I don't want. I tried using margin-top: 0px in css, but that doesn't help. I also tried a lot of other margin and padding settings, but I just ...
more »

2017-11-10 07:11 (1) Answers

Pass PHP array onto Vue component using props

Building a Laravel app with a few Vue components Want to pass a PHP array onto a Vue component using props Here's an example of such PHP array: ["Foo" => 100, "Bar" => 50] Great. Here's my attempt at passing them onto the Chart component: ...
more »

2017-11-10 00:11 (1) Answers

How does Reflection in Laravel work?

How does reflection in Laravel actually work? I tried to debug it to see how Laravel uses reflection in a controller's constructor or methods to resolve their dependencies and sub-dependencies and then and give it back to us. But I found it hard, a...
more »

2017-11-09 12:11 (2) Answers

PHP type hinting in Laravel

I was wondering if there is any difference in using type hint in method parameters, such as: function xyz (UserRepository $repo) and doing the same stuff with annotations: function xyz ($repo) /* @var UserRepository $repo */ ...
more »

2017-11-09 07:11 (2) Answers

Saving mutiple integer in mysql database laravel

when I try to save my data into the database, for some reason I can only save 1 integer and not multiple integer inside. Can anyone tell me why? I was thinking it might be because I am using FamilyAge as an integer in the database instead of a string...
more »

2017-11-07 01:11 (1) Answers

Dates on array in human readable format

I have a products and Ppurchases (stock details) two different tables in my database and using the following controller to fetch stock list. public function stockapi($id) { $data = Ppurchase::where('product_id',$id)->get(); $...
more »

2017-11-06 15:11 (1) Answers

Show custom error message

I'm trying to show errors in form validation. But these messages are always visible. <form name="user-form" method="POST" action="{{route('registrationUser')}}"> <div class="col-lg-8"> Логин <input type="text" n...
more »

2017-11-04 18:11 (1) Answers

Enable artisan command LARAVEL

Im trying to create a table through migration but I can't create because it gives me an error like this bash: php: command not found. I searched through the net but still cant find the solutions. I found some useful information that when '*' are next...
more »

2017-11-03 03:11 (3) Answers

Designing a database for personal project

I am pretty new to designing databases, and currently, I am working on a substantial big project of mine which requires a pretty big database. Here for I have a couple of questions to get my database ready for implementation. --Do have in mind that t...
more »

2017-11-02 18:11 (1) Answers

Custom Middleware - Too Many Redirects - Laravel

I want to create a custom middleware that only if the user is authenticated and the email is a certain email to access the /admin page. Although, when I specify my custom route and then a redirect it always says too many redirects.. Short Explanati...
more »

2017-11-02 17:11 (1) Answers

Search in laravel 5 with AppService Provider

In my template my search box is in the header and I need to make my function from AppServiceProvider so I can have access to it from all views. My problem is that I don't know how to do it! Here is my logic: Product has subcategory and subcategory...
more »

2017-11-02 07:11 (2) Answers

Laravel duplicated queries from blade directive

I am getting duplicated queries from using a Blade directive. I am checking a user's role, and then displaying data in a table, so the query repeats itself over and over, slowing down the app. I have registered a Blade service provider, and in the b...
more »

2017-11-01 23:11 (3) Answers