arslan2037

arslan2037

Member Since 2 Years Ago

Experience Points 2,890
Experience Level 1

2,110 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 1
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

04 Jun
9 months ago

arslan2037 left a reply on Want To Get Result Between Time Range In Laravel

basically i tried both, i have result in first and last and also have data in other hours

03 Jun
9 months ago

arslan2037 left a reply on Want To Get Result Between Time Range In Laravel

this looks fine to me but not work, it gives all result

$other_hour_trade = DB::table('finaltrade')
        ->join('exchanges', 'finaltrade.exchange_id', '=', 'exchanges.id')
        ->select('finaltrade.*')
        ->where('finaltrade.user_id', $user_id)
        ->whereTime('finaltrade.created_at', '>', DB::raw("ADDTIME(exchanges.start_time, '01:00:00')"))
        ->whereTime('finaltrade.created_at', '<', DB::raw("SUBTIME(exchanges.close_time, '01:00:00')"))
        ->get();

is there any mistake in this ?

arslan2037 left a reply on Want To Get Result Between Time Range In Laravel

@Cronix yes you are right, how i use whereTime to achieve this result ?

arslan2037 started a new conversation Want To Get Result Between Time Range In Laravel

I have some records, i want to get records from them where item is not between given time range, here is my code that i already tried but no success

$other_hour_trade = DB::table('finaltrade')
    ->join('exchanges', 'finaltrade.exchange_id', '=', 'exchanges.id')
    ->select('finaltrade.*')
    ->where('finaltrade.user_id', $user_id)
    ->whereNotBetween('finaltrade.created_at', [DB::raw('exchanges.start_time'), DB::raw("ADDTIME(exchanges.start_time, '01:00:00')")])
    ->whereNotBetween('finaltrade.created_at', [DB::raw('exchanges.close_time'), DB::raw("SUBTIME(exchanges.close_time, '01:00:00')")])
    ->get();

'finaltrade.created_at' is a datetime field and 'exchanges.start_time' and 'exchanges.close_time' is a only time field

I have join two tables to get results

arslan2037 left a reply on Getting Error While Fetching Data From Db

I have answer now

    $first_hour_trade = DB::table('finaltrade')
        ->join('exchanges', 'finaltrade.exchange_id', '=', 'exchanges.id')
        ->select('finaltrade.*')
        ->where('finaltrade.user_id', $user_id)
        ->whereTime('finaltrade.created_at', '>=', DB::raw('exchanges.start_time'))
        ->whereTime('finaltrade.created_at', '<=', DB::raw("ADDTIME(exchanges.start_time, '01:00:00')"))
        ->get();
02 Jun
9 months ago

arslan2037 left a reply on Issue In Laravel Query

THANKS every one :) this works for me

    ->whereTime('finaltrade.created_at', '<=', DB::raw("ADDTIME(exchanges.start_time, '01:00:00')"))

arslan2037 started a new conversation Issue In Laravel Query

I want to display records from 2 table using join, I have time column in which i want to add 1 hour and after that compare it to other table time column, but no success...

    $final_trade = DB::table('finaltrade')
                ->join('exchanges', 'exchanges.id', '=', 'finaltrade.exchange_id')
                ->where('finaltrade.user_id', $user_id)
                ->select('finaltrade.id', 'exchanges.start_time', 'finaltrade.created_at')
                ->whereTime('finaltrade.created_at', '>=', DB::raw('exchanges.start_time'))
                ->whereTime('finaltrade.created_at', '<=', date('H:i:s', strtotime("+1 hours", strtotime('exchanges.start_time'))))
        ->get();

i am not sure if i am doing write or wrong, need to change second whereTime clause. Without it, it gives results but i want result from within range after adding 1 hour to exchanges.start_time

arslan2037 left a reply on Getting Error While Fetching Data From Db

i am not sure, that is why i ask question here

arslan2037 left a reply on Getting Error While Fetching Data From Db

exchanges. start_time is a time column

arslan2037 left a reply on Getting Error While Fetching Data From Db

@Snapey actually i want result between time range from 2 tables

arslan2037 left a reply on Getting Error While Fetching Data From Db

when i add '09:30:00' instead of exchanges.start_time it gives correct results

arslan2037 left a reply on Getting Error While Fetching Data From Db

here is my actual query

        $final_trade = DB::table('finaltrade')
        ->join('exchanges', function($join)
        {
            $join->on('exchanges.id', '=', 'finaltrade.exchange_id')
                ->where('finaltrade.user_id', '=', Auth::user()->id)
                ->whereTime('finaltrade.created_at', '=', 'exchanges.start_time');
        })
        ->get();

i can see result in db but this gives empty

arslan2037 left a reply on Getting Error While Fetching Data From Db

@lostdreamer_nl can i add column name instead of exact time ?

arslan2037 left a reply on Getting Error While Fetching Data From Db

is there is any possibility i can get only time from datetime and compare it to time ?

arslan2037 started a new conversation Getting Error While Fetching Data From Db

I am trying to get data that match with my giving time, i pass time as a string for now but it gives error,

here is my code

$final_trade = FinalTrade::where('user_id', $user_id)
        ->where(Carbon::parse('created_at')->format('h:i:s'), '9.30.00')
        ->first();
18 Jan
1 year ago

arslan2037 left a reply on Error In Array In View File

i think @RamjithAp solution should work, but its not, maybe error is somewhere else

15 Jan
1 year ago

arslan2037 left a reply on Error In Array In View File

it has syntax error i try to remove it but no success

arslan2037 left a reply on Error In Array In View File

@jestins your solution has syntax error

arslan2037 left a reply on Error In Array In View File

i need only media from that list

arslan2037 left a reply on Error In Array In View File

@RamjithAp not work, i have error, trying to get a property of non object

arslan2037 left a reply on Error In Array In View File

i am little away, i'll try this soon

arslan2037 left a reply on Error In Array In View File

how ? can't share screen shot here

arslan2037 started a new conversation Error In Array In View File

I want to show data from array, but i have error and i am not able to find out why it gives me error, this is what i have in controller file, $url = 'https://www.instagram.com/'. $username . '/?__a=1'; $json = file_get_contents($url);

            return view('store.show', compact('json'));

and this is in view file

    <?php 
    $leads = json_decode($json, true);

    $media = $leads['user']['media']['nodes'];

    dd($media);
    ?>

this code show data but when i try to show it using loop it gives me error

17 Sep
1 year ago

arslan2037 started a new conversation How To Select Images From Instagram

I have only a field in which user enter its instagram username, when user hit enter it will see box with images to select an image to upload it on its profile. How i can achieve this? i see few methods using api, but i am not sure how i can give user access to select image from that list

02 Feb
2 years ago

arslan2037 started a new conversation I Want To Link A Button With File In Typescript

I have menu that is coming from typescript (.ts) file like this, { html: (item) => Edit Event, click: (item) => $("#inventory-ticket").modal() }, button name is Edit Event, right now is linked with popup and its working fine, i want to link it with file not popup, how i do it? I have no idea about typescript. I am using Angular2

31 Jan
2 years ago

arslan2037 left a reply on How To Append Html File In Javascript

clone can copy all the data in input fields from previous element to current element?

arslan2037 left a reply on How To Append Html File In Javascript

remove is working fine, i am on clone now

arslan2037 left a reply on How To Append Html File In Javascript

can we add copy and delete button also on each import?

arslan2037 left a reply on How To Append Html File In Javascript

.append works for me :) , only one thing left in it

arslan2037 left a reply on How To Append Html File In Javascript

i want how many time user click this button, this file import here that many times

arslan2037 left a reply on How To Append Html File In Javascript

my code is like this now,

    $(document).ready(function(){
            var max_fields = 10; //maximum input boxes allowed
            var x = 1; //initlal text box count

            if (x < max_fields) {
                x++;
                $('.button').click(function(){
                    $.get('profile.html', function(result){
                        $('.import').html(result);
                    });
                });
            }
        });

but its importing it only one time

arslan2037 left a reply on How To Append Html File In Javascript

right now its importing it one time, can i do it multiple time? like on click event

arslan2037 left a reply on How To Append Html File In Javascript

thanks for help, now its working, its a problem of link

arslan2037 left a reply on How To Append Html File In Javascript

give it a complete path but not working

    $.get( "C:\Users\Arslan\Desktop\JQuery-Practice\profile.html", function( data ) {
    $( ".result" ).html( data );
    alert( "Load was performed." );
    });

arslan2037 left a reply on How To Append Html File In Javascript

absolute link? not know about it, please help :(

arslan2037 left a reply on How To Append Html File In Javascript

both files are in same folder

arslan2037 started a new conversation How To Append Html File In Javascript

I want to append html onclick and i know how o do it, but i want to add file path instead of html code in append method, here is my code

    <!DOCTYPE html>

Home $(function () { $.get("profile.html", function (data) { $("#appendToThis").append(data); }); });

22 Oct
2 years ago

arslan2037 left a reply on How To Print Document On Click Using Javascript

right now i am just testing

arslan2037 started a new conversation How To Print Document On Click Using Javascript

I save all documents path in table and actual files are saved in directory, when i display that document i display only icons for that means if file is docx or doc, word icon displayed there. When i click on that document it download and save in download directory, Now i want when user click on that icon a print of that documents is taken and save in users computer.

here is how i display icon there

                <h4 style="margin-bottom:15px">Documents</h4>
            
            <?php
                $document = \App\Models\Company_Document_Group::where('id', $bid->document_group_id)->first();
                    echo '<p> Group Title: '.$document->title.'</p>';
                $p = explode(",", $document->documents);
            ?>
            @for( $i = 0; $i < count($p); $i++ )
                <?php $doc = \App\Models\Company_Document::where('id', $p[$i])->first(); ?>
                <p>Document Title: {{ $doc->title }}</p>
                <p>
                    @if(
                                substr($doc->media, strpos($doc->media, ".") + 1) == 'doc' ||
                                substr($doc->media, strpos($doc->media, ".") + 1) == 'docx' ||
                                substr($doc->media, strpos($doc->media, ".") + 1) == 'docx' ||
                                substr($doc->media, strpos($doc->media, ".") + 1) == 'docx'
                                )
                        Document:
                        <a style="display:inline-block; margin-left: 7px;" href="{{url(url() . '/uploads/companies/documents/' . $doc->media)}}" target='_blank' >
                            <img style="width: 50px; height:50px" class="img-circle" src="{{url(url() . '/imgs/file_icons/word.png/')}}" alt="company logo"
                            ></a>

                    @elseif(
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'jpeg' ||
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'jpg' ||
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'png' ||
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'gif' ||
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'tif' ||
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'tiff'
                            )

                        Document:
                        <a style="display:inline-block; margin-left: 7px;" href="{{url(url() . '/uploads/companies/documents/' . $doc->media)}}" target='_blank' >
                            <img style="width: 50px; height:50px" class="img-circle" src="{{url(url() . '/imgs/file_icons/img.png/')}}" alt="company logo">
                        </a>

                    @elseif(
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'xls' ||
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'xlsx'
                            )
                        Document:
                        <a style="display:inline-block; margin-left: 7px;" href="{{url(url() . '/uploads/companies/documents/' . $doc->media)}}" target='_blank' >
                            <img style="width: 50px; height:50px" class="img-circle" src="{{url(url() . '/imgs/file_icons/excel.png/')}}" alt="company logo">
                        </a>

                    @elseif(substr($doc->media, strpos($doc->media, ".") + 1) == 'pdf')

                        Document: <a style="display:inline-block; margin-left: 7px;" href="{{url(url() . '/uploads/companies/documents/' . $doc->media)}}" target='_blank' >
                            <img style="width: 50px; height:50px" class="img-circle" src="{{url(url() . '/imgs/file_icons/pdf.png/')}}" alt="company logo">
                        </a>

                    @elseif(
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'txt' ||
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'rtf' ||
                            substr($doc->media, strpos($doc->media, ".") + 1) == 'rt'
                            )

                        Document:
                        <a style="display:inline-block; margin-left: 7px;" href="{{url(url() . '/uploads/companies/documents/' . $doc->media)}}" target='_blank' >
                            <img style="width: 50px; height:50px" class="img-circle" src="{{url(url() . '/imgs/file_icons/txt.png/')}}" alt="company logo">
                        </a>
                    @else
                        Document: <a style="display:inline-block; margin-left: 7px;" href="{{url(url() . '/uploads/companies/documents/' . $doc->media)}}" target='_blank' >
                            <img style="width: 50px; height:50px" class="img-circle" src="{{url(url() . '/imgs/file_icons/txt.png/')}}" alt="company logo">
                        </a>
                    @endif

I want to print that document as well

11 Oct
2 years ago

arslan2037 left a reply on Get An Error When Trying To Get Data From Array

        foreach($results->payload as $res)
            {
                echo    $res->id;
            }

this one is working for me

arslan2037 left a reply on Get An Error When Trying To Get Data From Array

This error occure now Cannot use object of type stdClass as arry

arslan2037 left a reply on Get An Error When Trying To Get Data From Array

i am new in laravel, $data->caption->text

what i change in it in my case?

arslan2037 left a reply on Get An Error When Trying To Get Data From Array

            FatalErrorException in b5957949272d7eeab42b57eb43f59352 line 31:
            Cannot use object of type stdClass as array

arslan2037 left a reply on Get An Error When Trying To Get Data From Array

like this

        {#271 ▼

+"metadata": {#272 ▶} +"payload": array:25 [▼ 0 => {#276 ▶} 1 => {#277 ▶} 2 => {#278 ▶} 3 => {#279 ▶} 4 => {#280 ▶} 5 => {#281 ▶} 6 => {#282 ▶} 7 => {#283 ▶} 8 => {#284 ▶} 9 => {#285 ▶} 10 => {#286 ▶} 11 => {#287 ▶} 12 => {#288 ▶} 13 => {#289 ▶} 14 => {#290 ▶} 15 => {#291 ▶} 16 => {#292 ▶} 17 => {#293 ▶} 18 => {#294 ▶} 19 => {#295 ▶} 20 => {#296 ▶} 21 => {#297 ▶} 22 => {#298 ▶} 23 => {#299 ▶} 24 => {#300 ▶} ] }

arslan2037 left a reply on Get An Error When Trying To Get Data From Array

i am getting data from an api

        $list_id = ''; // Set your List ID here
                    // Instantiate Ongage Object
                    $ongage = new RfgOngage\Ongage('[email protected]', 'Prospectr121494', 'prospectr_marketing3');

                    // Instantiate Contacts Object
                    $contacts = new RfgOngage\Campaign\Mailings();

                    // Get Contacts for a list
                    $contacts->get($list_id);

                    // Send Request
                    $results = $ongage->send($contacts);

arslan2037 left a reply on Get An Error When Trying To Get Data From Array

i getting data from an api

            [7:58:42 AM] Ahmed Mustafa: stdClass Object

( [metadata] => stdClass Object ( [error] => [total] => 25 )

[payload] => Array
    (
        [0] => stdClass Object
            (
                [id] => 50619189
                [name] => Sept'16Newsletter_SalesData912_1
                [schedule_date] => 1474570196
                [type] => campaign
                [split_type] => 
                [status] => 60004
                [list_id] => 29594
                [status_desc] => Completed
                [status_date] => 1474602710
                [scheduled_by] => 9318
                [has_quota] => 0
                [split_subject_content_email_id] => 
                [created_by] => 9318
                [favorite] => 0
                [created] => 1474570182
                [modified] => 1474602710
                [deleted] => 0
                [is_test] => 0
                [progress] => 100
                [manager] => Hannah 
                [targeted] => 8477
                [cannot_resume] => 0
                [cannot_resume_reason] => 
                [original_email_message_id] => 
                [report] => 1
                [test] => 0
                [cancel] => 0
                [schedule] => delivered
                [esps] =>  SparkPost - Prospectrs_Travis
                [comment] => 

A total of 672 contacts had been suppressed from this campaign. This campaign was chosen to be throttled over 10 hours and is expected to finish around 2016-09-22 23:49:56

                [email_id] => 1837636
                [email_name] =>  Sept '16 Newsletter (copy)
                [message_type] => email_message
                [is_email_designer] => 0
            )

[7:59:10 AM] Ahmed Mustafa: $list_id = ''; // Set your List ID here // Instantiate Ongage Object $ongage = new RfgOngage\Ongage('[email protected]', 'Prospectr121494', 'prospectr_marketing3');

                    // Instantiate Contacts Object
                    $contacts = new RfgOngage\Campaign\Mailings();

                    // Get Contacts for a list
                    $contacts->get($list_id);

                    // Send Request
                    $results = $ongage->send($contacts);