biishmar

Web Developer at Srilanka

Experience

9,090

0 Best Reply Awards

  • Member Since 4 Months Ago
  • 88 Lessons Completed
  • 0 Favorites

12th January, 2018

biishmar left a reply on Help With SQL Query • 1 week ago

Transaction::whereBetween('updated_at', [$from, $to])
            ->selectRaw('count(id) as countIdAll ,sum(amount) as sumAmtAll,count(case when (updated_at >= date_sub(now(), interval 1 month) ) then id else 0 end) as countId6,sum(case when (updated_at >= date_sub(now(), interval 6 month) ) then amount else 0 end) as sumAmt6,
        count(updated_at) as countUpdate,')
        ->groupBy('customerAccount')
        ->orderBy('customerAccount');

biishmar left a reply on How Can I Save Multiple Columns In A 1:N Relationship • 1 week ago

$company->address()->createMany(array1, array2);

biishmar left a reply on How To Save Selected Checkbox Value To Database In Laravel? • 1 week ago

because you are using array_keys inside foreach use outside and dd it.

biishmar left a reply on Check If The Object Request Is Empty Before For Each • 1 week ago

This check the key request present or not

$request->has('contacts')

This checks the contacts empty or not

$request->filled('contacts')

biishmar left a reply on How Laravel Access Object Properties That Are Not Defined? • 1 week ago

Laravel using magic method to assign a class property by column name...

biishmar left a reply on Why I Am Not Getting Redirected To These Specified Pages After Login • 1 week ago

I dont see a login process here, just displaying a view according to role by email...

biishmar left a reply on How To Save Selected Checkbox Value To Database In Laravel? • 1 week ago

@foreach ($admin_report as $key => $report)
             <label class="container2">
                   <input type="checkbox" name="report[{{$report->id}}]"> {{$report-
            >admin_report}}
              <span class="checkmark"></span>
                  </label>

           @endforeach 

From Controller

public function store(Request $request)
{
    array_keys($request->report)
}

By this u get the checked report id, then use relation save or create method.. if its many to many then use relation sync

11th January, 2018

biishmar left a reply on Combine Collections • 1 week ago

If that helps marked as solved..

biishmar left a reply on Combine Collections • 1 week ago

Inside a user model create the static method and paste the above code inside it, so u can get all trade by calling

User::allTrade();

like that..

biishmar left a reply on Combine Collections • 1 week ago

nope, u seperated the Escrow Trade model as seller and buyer as a two foreign keys, so no way of getting it as one as a relation like i already told u. is there any problem to try that collection example i mentioned above?

biishmar left a reply on How To Check If A Username Exits Using Jquery Validation And Laravel • 1 week ago

the problem is you are using POST type of ajax call so laravel expect CSRF token from the request, so use GET type, if u dont want laravel to check the security of ajax request...

biishmar left a reply on Combine Collections • 1 week ago

Trying to merge this thing inside relation is hard, gotta do it from collection

$user->transform(function($user) {
$merged = $user->ownSellerTrades->merge($user->ownBuyerTrades)

$user->put('allTrades', $merged);

return $user;

});

biishmar left a reply on Increment Value When A Button Is Triggered • 1 week ago

html

<a href="/?date=next" data-count=1 > 

javascript

$('a').click(function() {
count = $(this).attr('data-count');

href = location.href + '&count=' + count;

location.href = href;
});

php

public function show(Hour $post){
        if(request()->has('date')){
            if(request('date') == 'next'){
                dd(request('count')); // This value is from javascript
            }
        }
    }

biishmar left a reply on Cannot Display Image From Local Storage • 1 week ago

use native php function

file_put_content($path, $filename)

OR use composer package Intervention/Image for more laravel like coding.

biishmar left a reply on Combine Collections • 1 week ago

Are u making a relation within the same model?

if you are, u can take a both seller and buyer as

EscrowTrades::all()

u can use where if u have constraints like active column or something

biishmar left a reply on Cannot Display Image From Local Storage • 1 week ago

You cannot access image or file directly from storage/app as a url, if u want to access the image from storage folder use public disk or save the image in public folder.

biishmar left a reply on How To Yield Title When I My Header.blade.php Is @include In The App.blade.php? • 1 week ago

// my main app
@include('header', ['title', 'some text'])
@yeild('content')
@include('footer')

Call title from header view

<head>
        <title>{{$title}}</title>
</head>

biishmar left a reply on How To Write Code In Laracast? • 1 week ago

~~~ test ~~~

biishmar left a reply on How To Write Code In Laracast? • 1 week ago

''' testing '''

biishmar left a reply on Can Anyone Please Tell Me The Font Name • 1 week ago

There is a extension called WhatFOnt for chrome, u should use that.

biishmar left a reply on Connection Could Not Be Established With Host Smtp.gmail.com • 1 week ago

Your .env file should be like this,

MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=gmailaddress MAIL_PASSWORD=yourpassword MAIL_ENCRYPTION=null

if u have enabled two factor authentication, create app key and use that as password..

if u face certificate error, paste the below code in config/mail.php at the end.

'stream' => [ 'ssl' => [ 'allow_self_signed' => true, 'verify_peer' => false, 'verify_peer_name' => false, ], ],

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.