Dev0ps

Experience

4,470

0 Best Reply Awards

  • Member Since 2 Months Ago
  • 1 Lesson Completed
  • 0 Favorites

21st May, 2018

20th May, 2018

Dev0ps left a reply on How To Get 1 If Checkbox Is Checked Otherwise Get 0 If Checkbox Is Unchecked • 2 days ago

my problem is almost solved just tell me how to use has() in array

Dev0ps left a reply on How To Get 1 If Checkbox Is Checked Otherwise Get 0 If Checkbox Is Unchecked • 2 days ago

this is the response

{_token: "J5LENAzcijGcRjuda2eZj3U3esrtw5eOjMSYseqA", ProfileAccess: Array(9)}
ProfileAccess
:
Array(9)
0
:
"Friends"
1
:
"Family"
2
:
"Clients"
3
:
"Classmates"
4
:
"Coworkers"
5
:
"Colleagues"
6
:
"Buddies"
7
:
"Acquaintances"
8
:
"Nobody"
length
:
9
__proto__
:
Array(0)
_token
:
"J5LENAzcijGcRjuda2eZj3U3esrtw5eOjMSYseqA"
__proto__
:
Object

i try

$a = $request->has('Friends')?1:0;

output 0

Dev0ps left a reply on How To Get 1 If Checkbox Is Checked Otherwise Get 0 If Checkbox Is Unchecked • 2 days ago

@Snapey bro, consider there are 4 checkboxes

A, B, C, D

and only two was selected

C, D

now I plan to create an array

{A, B, C, B} and compare it to request array {C, D }

so we got A and B as unselected :)

is there any methods which do this kind of work

Dev0ps left a reply on How To Get 1 If Checkbox Is Checked Otherwise Get 0 If Checkbox Is Unchecked • 2 days ago

@jlrdwI checked it. but I don't look for this. I require a way that allows me both unchecked or checked checkboxes name

actually, I have a group of checkboxes

Dev0ps started a new conversation How To Get 1 If Checkbox Is Checked Otherwise Get 0 If Checkbox Is Unchecked • 2 days ago

my code

<div class="checkbox group">
                                                <label>
                                                    <input type="checkbox" name="ProfileAccess[]" value="Acquaintances" checked>
                                                </label>

output if checked; Acquaintances if unchecked; " "

16th May, 2018

Dev0ps started a new conversation How To Check Which Users Birthday In MAY Month • 6 days ago

i found this code

User::whereNotNull('birth_date')
    ->where('birth_date', '<=', $endDate)
    ->whereIn(DB::raw("to_char(birth_date, 'MMDD')"), Carbon::range($startDate, $endDate)->map(function ($date) {
        return $date->format('md');
    }))->get();

is there any alternative. i don't want to use DB::

11th May, 2018

Dev0ps left a reply on How To Access Json Data • 1 week ago

thank you :)

Dev0ps started a new conversation How To Access Json Data • 1 week ago

i need TITLE

{#936 ▼
  +"kind": "youtube#video"
  +"etag": ""DuHzAJ-eQIiCIp7p4ldoVcVAOeY/AGYQnbqW0uU4eDK7aTxNmHuBtPo""
  +"id": "apFfnzkgEII"
  +"snippet": {#937 ▼
    +"publishedAt": "2017-07-18T21:54:14.000Z"
    +"channelId": "UC9OrEgBZfjj2FDPmn9wgd0g"
    +"title": "Doctor Strange | Believer"
    +"description": """
      Loved this movie! Choose 1080p for best quality!\n
      \n
      // Song: Believer by Imagine Dragons.\n
      Software: Ol' school Windows Movie Maker. //\n
      \n
      "Copyright Disclaimer Under Section 107 of the Copyright Act 1976, allowance is made for "fair use" for purposes such as criticism, comment, news reporting, tea ▶
      """
    +"thumbnails": {#939 ▶}
    +"channelTitle": "Amarita"
    +"tags": array:20 [▶]
    +"categoryId": "1"
    +"liveBroadcastContent": "none"
    +"localized": {#944 ▶}
  }
  +"contentDetails": {#945 ▶}
  +"status": {#946 ▶}
  +"statistics": {#947 ▶}
  +"player": {#948 ▶}
}

10th May, 2018

Dev0ps started a new conversation How To Append Data Dynamically Using Isotope • 1 week ago

I am using isotope when data loads on page load time its work fine but whenever I append it dynamically for adding more posts it overlaps my previous data :(

isotope function

APP.IsotopeSort = function () {
    var $containerSort = $('.sorting-container');
    $containerSort.each(function () {
        var $current = $(this);
        var layout = ($current.data('layout').length) ? $current.data('layout') : 'masonry';
        $current.isotope({
            itemSelector: '.sorting-item',
            layoutMode: layout,
            percentPosition: true
        });

        $current.imagesLoaded().progress(function () {
            $current.isotope('layout');
        });

        var $sorting_buttons = $current.siblings('.sorting-menu').find('li');

        $sorting_buttons.on('click', function () {
            if ($(this).hasClass('active')) return false;
            $(this).parent().find('.active').removeClass('active');
            $(this).addClass('active');
            var filterValue = $(this).data('filter');
            if (typeof filterValue != "undefined") {
                $current.isotope({filter: filterValue});
                return false;
            }
        });
    });
};

Ajax function

function loadMoreData(page){
        $.ajax(
            {
                url: '/LoadGlobalNewsfeedPosts',
                type: "post",
                data: {page: page},
                beforeSend: function()
                {
                    $('.ajax-load').show();
                }
            })
            .done(function(data)
            {
                
                if(data.html == "ERRDNA"){
                    $('#post-data').append("  <br>  <div class=\"header-spacer-small crumina-module crumina-heading with-title-decoration NoPostFound\">\n" +
                        "        <h6 class=\"align-center heading-title\">No more posts to show. Let's make one!</h6>\n" +
                        "    </div>");
                    $('.ajax-load').hide();
                    $(window).off('scroll');
                    isActive = false;
                    return;
                }
                else
                    console.log(data);
                    $('.ajax-load').hide();
                $("#post-data").isotope( 'appended', data.html.view )
                isActive = true;

            })
            .fail(function(jqXHR, ajaxOptions, thrownError)
            {
                alert('server not responding...');
            });
    }

Thanks in Advance friends

6th May, 2018

Dev0ps left a reply on How To Fetch Latest 4 Posts And In Next Request Get Next 4 Requests • 2 weeks ago

actually, i am using infinity scrolling plugin.

Dev0ps left a reply on How To Fetch Latest 4 Posts And In Next Request Get Next 4 Requests • 2 weeks ago

@SnapeyI try to use paginate from early morning but it shows the same result again and again

how to show next 10 records in paginate()

Dev0ps started a new conversation How To Fetch Latest 4 Posts And In Next Request Get Next 4 Requests • 2 weeks ago

consider we have 20users. I like to show only 4 users. and then on the next page. I wanna show 4 users in every page.

how to build this query

Dev0ps started a new conversation When I Increment Data By One It Save Increment By 3or4 In Database • 2 weeks ago

my code

$description = "hello @sqs3XxNVlV @ff #hhh #bannana";

    //User Hashtags
        preg_match_all('/(^|\s)(#\w+)/', $description, $hashtags);
        foreach ($hashtags[2] as $value) {
            $timeline = Timeline::where('username', str_replace('@', '', $value))->first();
            $hashtag = Hashtag::where('tag', str_replace('#', '', $value))->first();
            if ($hashtag) {
                $hashtag->increment('count', 1);
        // $hashtag->count = $hashtag->count + 1;
                $hashtag->save();
            } else {
                Hashtag::create(['tag' => str_replace('#', '', $value), 'count' => 1]);
            }
        }
        return 'done';

5th May, 2018

Dev0ps left a reply on How To Check Birthday Of User Using Carbon::now() • 2 weeks ago

Thanks all for your valuable time :)

Dev0ps left a reply on How To Fetch Those Records Which Are Not Fetched In First Query • 2 weeks ago

how to find what id's already fetched

Dev0ps started a new conversation How To Fetch Those Records Which Are Not Fetched In First Query • 2 weeks ago

i am working on newsfeed section of my website. in the load time i soo 10 records which are fetched randomly from the database.

i create an infinity scrolling now how to fetch other records

3rd May, 2018

Dev0ps left a reply on How To Check Birthday Of User Using Carbon::now() • 2 weeks ago

not working

$user_birthday = User::find(1)->birthday;  //2000-05-03
       return $required_age = Carbon::now()->toDateString();;
        if (Carbon::today()->diffInYears($user_birthday) > $required_age) {
            return "happy birthday";
        }
        else {
            return "no birthday";
        }

Dev0ps started a new conversation How To Check Birthday Of User Using Carbon::now() • 2 weeks ago

is there any way to findout

28th April, 2018

Dev0ps left a reply on Foreach Is Show Only First Record • 3 weeks ago

thank you soo much!

Dev0ps left a reply on Foreach Is Show Only First Record • 3 weeks ago

@Cronix

Please give me example

Dev0ps left a reply on Foreach Is Show Only First Record • 3 weeks ago

how to solve this issue

Dev0ps left a reply on How To Use Itunes Api • 3 weeks ago

So, how can i solve this problem

Dev0ps started a new conversation Foreach Is Show Only First Record • 3 weeks ago

hey, guys, i have a data of 2 rows but for each show only first row plz help

$users = Friend::where('user_id', '=', Auth::id())->where('status', '=', 2)->get();
        $data = [];
        
//        foreach ($users as $user) {
//            $data['uid'] = Timeline::whereUserId($user->friend_id)->first()->user_id;
//            $data['username'] = Timeline::whereUserId($user->friend_id)->first()->username;
//            $data['name'] = Timeline::whereUserId($user->friend_id)->first()->name;
//        }

        foreach ($users as $user) {
            $data = [$data['uid'] = Timeline::whereUserId($user->friend_id)->first()->user_id,
            $data['username'] = Timeline::whereUserId($user->friend_id)->first()->username,
            $data['name'] = Timeline::whereUserId($user->friend_id)->first()->name
            ];
        }

        return json_encode(array($data));

26th April, 2018

Dev0ps started a new conversation How To Use Itunes Api • 3 weeks ago

whenever I request they download a file of request how to use it

i want to use autocomplete api

i try https://github.com/atomescrochus/laravel-itunes-search-api

but when i return value

 return $results = ItunesSearch::lookup(902122445);

error The Response content must be a string or object implementing __toString(), "object" given.

25th April, 2018

Dev0ps left a reply on Make A Foreach With A JSON Array • 3 weeks ago

i paste its code on my controller error in this line

  $model = "\App\Models\SMVC" . "\" . substr($class, $slh, -10) . 

please tell me where i need to add it

Dev0ps left a reply on Make A Foreach With A JSON Array • 3 weeks ago

i don't understand plz give me example

Dev0ps started a new conversation Make A Foreach With A JSON Array • 3 weeks ago

code

array:51 [▼
  0 => {#925 ▼
    +"year": "404 BC"
    +"text": "Peloponnesian War: Lysander's Spartan armies defeated the Athenians and the war ends."
    +"html": "<a href="https://wikipedia.org/wiki/Peloponnesian_War" title="Peloponnesian War">Peloponnesian War</a>: <a href="https://wikipedia.org/wiki/Lysander" title="Lys ▶"
    +"links": array:4 [▶]
  }
  1 => {#930 ▼
    +"year": "775"
    +"text": "The Battle of Bagrevand puts an end to an Armenian rebellion against the Abbasid Caliphate. Muslim control over Transcaucasia is solidified and its Islamization ▶"
    +"html": "The <a href="https://wikipedia.org/wiki/Battle_of_Bagrevand" title="Battle of Bagrevand">Battle of Bagrevand</a> puts an end to an <a href="https://wikipedia.or ▶"
    +"links": array:6 [▶]
  }
  2 => {#937 ▶}
  3 => {#943 ▶}
  4 => {#945 ▶}
  5 => {#949 ▶}
  6 => {#953 ▶}
  7 => {#956 ▶}
  8 => {#960 ▶}
  9 => {#964 ▶}
  10 => {#968 ▶}
  11 => {#971 ▶}
  12 => {#975 ▶}
  13 => {#982 ▶}
  14 => {#984 ▶}
  15 => {#992 ▶}
  16 => {#994 ▶}
  17 => {#1001 ▶}
  18 => {#1003 ▶}
  19 => {#1005 ▶}
  20 => {#1009 ▶}
  21 => {#1011 ▶}
  22 => {#1016 ▶}
  23 => {#1019 ▶}
  24 => {#1023 ▶}
  25 => {#1025 ▶}
  26 => {#1033 ▶}
  27 => {#1040 ▶}
  28 => {#1042 ▶}
  29 => {#1045 ▶}
  30 => {#1051 ▶}
  31 => {#1054 ▶}
  32 => {#1057 ▶}
  33 => {#1060 ▶}
  34 => {#1064 ▶}
  35 => {#1070 ▶}
  36 => {#1074 ▶}
  37 => {#1078 ▶}
  38 => {#1081 ▶}
  39 => {#1085 ▶}
  40 => {#1090 ▶}
  41 => {#1093 ▶}
  42 => {#1097 ▶}
  43 => {#1101 ▶}
  44 => {#1104 ▶}
  45 => {#1108 ▶}
  46 => {#1112 ▶}
  47 => {#1116 ▶}
  48 => {#1120 ▶}
  49 => {#1124 ▶}
  50 => {#1126 ▶}
]

i tried

 foreach($TimeQuoute['year']['text'][0]['html'] as $group) {
        echo $group['year'][0]['text'];

24th April, 2018

Dev0ps left a reply on Godaddy Hosting Is Good For Big Laravel Projects • 4 weeks ago

100M+

Dev0ps started a new conversation How To Send Mail Using Gmail Account • 4 weeks ago

I am currently using mailgun its work but I do not send emails to other user mail address. It only sent mail to mailing registered email address.

Dev0ps started a new conversation Godaddy Hosting Is Good For Big Laravel Projects • 4 weeks ago

Guys I am working on social networking platform I'm confused to choose to host.

Dev0ps started a new conversation How To Deploy Laravel On Hostenger Hosting • 4 weeks ago

i purchase hosting where i need to upload data in /public??

Dev0ps started a new conversation I Am Using GuzzleHttp For Using Get Apis But Encase Of Error Entire Web Page Is Not Load • 4 weeks ago

my code

$client = new \GuzzleHttp\Client();
        $request = $client->get('https://history.muffinlabs.com/date', ['connect_timeout' => 3.14, 'http_errors' => false]);
//         $response = $request->getBody();

        if($request->getStatusCode() == 200){
            $json = $request->getBody()->getContents();
            $content = json_decode($json);
            $births = $content->data->Events;
            $TimeQuoute= $births[rand(1, 30)];
        }
        return $TimeQuoute;

how to check this before sending request

23rd April, 2018

Dev0ps left a reply on How To Access Single Record From Big API Data • 4 weeks ago

Thank you its work :)

      $client = new \GuzzleHttp\Client();
        $request = $client->get('https://history.muffinlabs.com/date');
//         $response = $request->getBody();
        $json = $request->getBody()->getContents();
           $content = json_decode($json);
        $births = $content->data->Births;

        foreach ($births as $birth){
            return $birth;
        }

i am try to use foreach it again error

The Response content must be a string or object implementing __toString(), "object" given.

Dev0ps left a reply on How To Access Single Record From Big API Data • 4 weeks ago

return $births = $response->date->Births;

output No value for date

Dev0ps left a reply on How To Access Single Record From Big API Data • 4 weeks ago

dd output

Stream {#913 ▼
  -stream: stream resource @293 ▼
    wrapper_type: "PHP"
    stream_type: "TEMP"
    mode: "w+b"
    unread_bytes: 0
    seekable: true
    uri: "php://temp"
    options: []
  }
  -size: null
  -seekable: true
  -readable: true
  -writable: true
  -uri: "php://temp"
  -customMetadata: []
}

these both show blank screen

$births = $response->data->Births;

// or more failsafe in case the structure changes
$births = data_get($response,'data.Births');

Dev0ps left a reply on How To Access Single Record From Big API Data • 4 weeks ago

data format

{
  "date": "February 14",
  "url": "http://wikipedia.org/wiki/February_14",
   "data":{
    "Events":[ // data here // ],
    "Births":[ // data here // ],
    "Deaths":[ // data here // ]
  }
}

how can i access Births

i tried

   $client = new \GuzzleHttp\Client();
        $request = $client->get('https://history.muffinlabs.com/date');
        $response = $request->getBody();
         return $response->Births   ;

Dev0ps started a new conversation How To Use GET XML Data APIs • 4 weeks ago

source: http://api.hiztory.org/aviation/04/23/1/15/api.xml

want to store data in variable convert into the collection and sent to the view

Dev0ps left a reply on Is There Any Way To Forget Some Id's Of Eloquent Collection • 4 weeks ago

output

{"1":{"id":2,"timeline_id":2,"first_name":"Lucky","last_name":"Nema","username":"3JBURKbT9K","email":"[email protected]","email_verified":null,"birthday":"2018-02-28","gender":"Male","active":1,"last_logged":"2018-04-23 09:27:13","created_at":"2018-04-20 12:18:58","updated_at":"2018-04-23 09:13:01","deleted_at":null}}

Why "1": in the front

Dev0ps started a new conversation How To Select Only User Id Those Are Not A Friend Of Auth::user • 4 weeks ago

my code

 $users = User::all();
         $blocks = [1, 3];
        $blocks = collect();
         foreach ($blocks as $block){
            echo $block;
             return $users->reject(function ($user) {
                 return  $user->id == $block;
             });
         }

error Undefined variable: block

Dev0ps left a reply on Is There Any Way To Forget Some Id's Of Eloquent Collection • 4 weeks ago

hi please take a look at

 $users = User::all();
         $blocks = [1,3];
         foreach ($blocks as $block){
            echo $block;
             return $users->reject(function ($user) {
                 return  $user->id == $block;
             });
         }

error Undefined variable: block

Dev0ps left a reply on Is There Any Way To Forget Some Id's Of Eloquent Collection • 4 weeks ago

return nothing

$users = User::all();
        $users->reject(function ($user) {
          return  $user->id == 3; // or whatever id you want to remove
        });

in echo print 1

Dev0ps left a reply on Is There Any Way To Forget Some Id's Of Eloquent Collection • 4 weeks ago

Any one there??

Dev0ps left a reply on Is There Any Way To Forget Some Id's Of Eloquent Collection • 4 weeks ago

$users = User::all(); return $users->reject(function ($user) { $user->id == 3; // or whatever id you want to remove });

same issue bro. I got all 3users records

Dev0ps left a reply on Is There Any Way To Forget Some Id's Of Eloquent Collection • 4 weeks ago

this query User::find(1)->all(); genrate alll user records

Dev0ps left a reply on How To Remove Some Ids From Array $blockedUserId • 4 weeks ago

is there any way in collection because it saves time to cover collection to the array

Dev0ps left a reply on Is There Any Way To Forget Some Id's Of Eloquent Collection • 4 weeks ago

my array

[{"id":1,"timeline_id":1,"first_name":"Pratyush","last_name":"ss","username":"yMgWumQdRY","email":"[email protected]","email_verified":null,"birthday":"2018-03-08","gender":"Male","active":1,"last_logged":"2018-04-22 18:03:31","created_at":"2018-04-20 11:58:51","updated_at":"2018-04-20 11:58:51","deleted_at":null},{"id":2,"timeline_id":2,"first_name":"cc","last_name":"Nema","username":"3JBURKbT9K","email":"[email protected]","email_verified":null,"birthday":"2018-02-28","gender":"Male","active":1,"last_logged":"2018-04-23 09:27:13","created_at":"2018-04-20 12:18:58","updated_at":"2018-04-23 09:13:01","deleted_at":null},{"id":3,"timeline_id":3,"first_name":"cs","last_name":"ss","username":"ZihAuPIJpf","email":"[email protected]","email_verified":null,"birthday":"1995-02-10","gender":"Female","active":1,"last_logged":"2018-04-23 15:27:53","created_at":"2018-04-23 15:27:53","updated_at":"2018-04-23 15:27:53","deleted_at":null}]
Edit Your Profile
Update

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