Our Black Friday sale is now live! All individual subscriptions are 50% OFF. This week only!

coder72

coder72

Member Since 1 Month Ago

Experience Points
1,550
Total
Experience

3,450 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 1
1,550 XP
Nov
10
1 week ago
Activity icon

Replied to How To Convert String To Interger Number ?

@sergiu17

Worked Thanks. can you please explain after else code ? and if my name doesn't match then NaN is coming instead of null or 0. I will try to find it Thanks a million

Activity icon

Replied to How To Convert String To Interger Number ?

@sergiu17 error say

Invalid left-hand side in assignment expression
Activity icon

Replied to How To Convert String To Interger Number ?

Yes Exactly so how should i do it ? like this ? or ?

parseInt(results[element.name].kill) += element.kill;
      parseInt(results[element.name].knock) += element.knock;
Activity icon

Replied to How To Convert String To Interger Number ?

Yeah I tried that,but didnot work.I mean it giving same result

Activity icon

Started a new Conversation How To Convert String To Interger Number ?

There are two array.I want to merge two array and sume thei data if name matches.But My kill number are coming in string.Whenever add 1+1 = 11 result will come like this

var demo = {
    "key1": [{"id": 1, "name": "Robbie", "kill": "12" , "knock": "1"}, 
                   {"id": 2, "name": "Mohamand", "kill": "12" , "knock": "4"},
                   {"id": 3, "name": "Jebisha", "kill": "8" , "knock": "4"}],

    "key2": [
                 {"id": 1, "name": "Robbie", "kill":"12 " , "knock": "4"}, 
                 {"id": 2, "name": "Mohamand", "kill": "13" , "knock": "3"},
                 {"id":3, "name": "Jebisha", "kill": "5" , "knock": "1"},
                 {"id":4, "name": "Alvida", "kill": "8" , "knock": "5"}]
};

I have iterate over both arrays. If in the new array a property already exists.you sum the values, if not you create it.But due to kill and knock are both string,how should i make integer and sume their data ?

const results = {};

Object.keys(demo).forEach(function(arrayToInspect) {
  demo[arrayToInspect].forEach(function(element) {
    if (results[element.name]) {
      results[element.name].kill += element.kill;
      results[element.name].knock += element.knock;
    }
    else {
      results[element.name] = element;
    }
  });
Nov
08
2 weeks ago
Activity icon

Started a new Conversation How To Get Last Id Or Row From Table Through ID

I want to get last row or last data from table of id. Product Table

id  |  dealer_id      |  name       |  created_at           |
1   |      1000       |   ABC       | 2020-11-06 06:27:58  |
2   |      1001       |   Tripathi  |  2020-11-06 07:09:39  |
3   |      1002       |   Leaptrig  |  2020-11-06 07:09:39 |
4   |      1003       |   Falcon    | 2020-11-06 07:55:36  |

From Above table ,I want to get dealer Id of last id so i can save by incrementing by +1 Controller

 public function store(){
   $lastProduct=Product::pluck('dealer_id')->sortByDesc('id')->last();
   dd($lastProduct);
// Or dores this work ?

    $lastProduct=Product::latest()->first();
}

But result are not coming from last id.So is there any problem with my query ?

1002
Nov
06
2 weeks ago
Activity icon

Started a new Conversation How To Write Sql Statement For Auto Generate Starting From 1000

This is my seller database. Here i want to store dealer_id in this format.I want store from 1000 and it should be increment

id  |  dealer_id      |  name       |  
1   |      1000       |   ABC       |
2   |      1001       |   Tripathi  |
3   |      1002       |   Leaptrig  |
4   |      1003       |   Falcon    |
5   |      1004       |   Savillan  |
6   |      1005       |  Molt       |
7   |      1006       |   Falt      |

But i have data in my database like this


id  |  dealer_id      |  name       |  
1   |      25         |   ABC       |
2   |      450        |   Tripathi  |
3   |      980        |   Leaptrig  |
4   |      782        |   Falcon    |
5   |       234       |   Savillan  |
6   |      250        |  Molt       |
7   |      45         |   Falt      |
............................................
900|   2321      |     Tolem

I have data up to 900.So how can i write SQL statement that update dealer_id start from 1000 and end 1900

Nov
05
2 weeks ago
Activity icon

Started a new Conversation How To Sort This Array According To Month ?

I want to sort this array according to month and day ? Is there any way ?

["Month", "Apple", "Banana", "Mango"]
1: (4) ["Apr-08", 30, 0, 0]
2: (4) ["Apr-16", 26, 0, 21]
3: (4) ["Jul-08", 16.25, 9.25, 0]
4: (4) ["Feb-07", 58, 0, 0]
5: (4) ["Feb-08", 11, 0, 0]
6: (4) ["Jun-07", 4, 0, 0]
7: (4) ["Jul-07", 2.25, 0, 0]
["Month", "Apple", "Banana", "Mango"]
1: (4) ["Feb-07", 58, 0, 0]
2: (4) ["Feb-08", 11, 0, 0]
3: (4) ["Apr-08", 30, 0, 0]
4: (4) ["Apr-16", 26, 0, 21]
5: (4) ["Jun-07", 4, 0, 0]
6: (4) ["Jul-08", 16.25, 9.25, 0]


7: (4) ["Jul-07", 2.25, 0, 0]
Activity icon

Replied to Is There Any Way To Create Array Or Array Of Object Like This?

@automica yeah ! and thank you for response .my problem solved.

console.log({key1: response[0].userDetails, key2: response[1].userDetails});
Activity icon

Started a new Conversation Is There Any Way To Create Array Or Array Of Object Like This?

This is where i had fetch multiple GET URLs at once and then put the fetched JSON data

  Promise.all([
     fetch('http://127.0.0.1:8000/api/chartTable').then((response) => response.json()),
     fetch('http://127.0.0.1:8000/api/chartTable1').then((response) => response.json()),
  ]).then(function (response) {
    console.log(...response.map((res) => res['userDetails']));
  });

and when i do console.log(...response.map((res) => res['userDetails'])); .Data will come like this in Inscpect

(3) [{…}, {…}, {…}]
             0 : {"id": 1, "name": "Robbie", "kill": 12 , "knock": 1}, 
             1 : {"id": 2, "name": "Mohamand", "kill": 12 , "knock": 4},
             2 :{"id": 3, "name": "Jebisha", "kill": 8 , "knock": 4}

          (3) [{…}, {…}, {…}]
                  {"id": 1, "name": "Robbie", "kill":12  , "knock": 4}, 
                 {"id": 2, "name": "Mohamand", "kill": 13 , "knock": 3},
                 {"id":3, "name": "Jebisha", "kill": 5 , "knock": 1}

but i want to convert this like this

"key1": [{"id": 1, "name": "Robbie", "kill": 12 , "knock": 1}, 
                   {"id": 2, "name": "Mohamand", "kill": 12 , "knock": 4},
                   {"id": 3, "name": "Jebisha", "kill": 8 , "knock": 4}],

    "key2": [
                 {"id": 1, "name": "Robbie", "kill":12  , "knock": 4}, 
                 {"id": 2, "name": "Mohamand", "kill": 13 , "knock": 3},
                 {"id":3, "name": "Jebisha", "kill": 5 , "knock": 1}]
Nov
04
2 weeks ago
Activity icon

Replied to How To Avoid Duplicate Name ?

Can you give me example please ?

Activity icon

Replied to How To Avoid Duplicate Name ?

@michaloravec So is there any way ?

Activity icon

Replied to How To Avoid Duplicate Name ?

@michaloravec What if there 0,1,2 something

var demo = {
    "0": [{"id": 1, "name": "Robbie", "kill": 12 , "knock": 1}, 
                   {"id": 2, "name": "Mohamand", "kill": 12 , "knock": 4},
                   {"id": 3, "name": "Jebisha", "kill": 8 , "knock": 4}],

    "1": [
                 {"id": 1, "name": "Robbie", "kill":12  , "knock": 4}, 
                 {"id": 2, "name": "Mohamand", "kill": 13 , "knock": 3},
                 {"id":3, "name": "Jebisha", "kill": 5 , "knock": 1}]
};
var res = demo.0.map(function(item, idx) {    //i think i canot use like this demo.0 like this
    return Object.keys(item).reduce(function(obj, key) {
        if (key == 'name') {
            obj[key] = item[key];
        } else {
            obj[key] = item[key] + demo.key2[idx][key];
        }

        return obj;
    }, {});
});
Activity icon

Replied to How To Avoid Duplicate Name ?

@michaloravec No only kill and knock only i want to sum

and What if key1 and another key1 is same ?

var demo = {
    "0": [{"id": 1, "name": "Robbie", "kill": 12 , "knock": 1}, 
                   {"id": 2, "name": "Mohamand", "kill": 12 , "knock": 4},
                   {"id": 3, "name": "Jebisha", "kill": 8 , "knock": 4}],

    "1": [
                 {"id": 1, "name": "Robbie", "kill":12  , "knock": 4}, 
                 {"id": 2, "name": "Mohamand", "kill": 13 , "knock": 3},
                 {"id":3, "name": "Jebisha", "kill": 5 , "knock": 1}]
};
Activity icon

Started a new Conversation How To Avoid Duplicate Name ?

var demo = {
    "key1": [{"id": 1, "name": "Robbie", "kill": 12 , "knock": 1}, 
                   {"id": 2, "name": "Mohamand", "kill": 12 , "knock": 4},
                   {"id": 3, "name": "Jebisha", "kill": 8 , "knock": 4}],

    "key2": [
                 {"id": 1, "name": "Robbie", "kill":12  , "knock": 4}, 
                 {"id": 2, "name": "Mohamand", "kill": 13 , "knock": 3},
                 {"id":3, "name": "Jebisha", "kill": 5 , "knock": 1}]
};


var res = demo.key1.map(function(item, idx) { 
   return Object.keys(item).reduce(function(obj,key) {
        obj[key] = item[key] + demo.key2[idx][key];
        return obj;
    },{});  

When i do console.log(res)

The result is coming like this console.log(res); });

0: {id: 2, name: "RobbieRobbie", "kill: 24 , knock: 5}
1: {id: 4, name: "MohamandMohamand","kill: 25 , knock: 7}
2: {id: 2, name: "JebishaJebisha", "kill: 13 , knock: 5}

The result should be like this

0: {id: 2, name: "Robbie", "kill: 24 , knock: 5}
1: {id: 4, name: "Mohamand","kill: 25 , knock: 7}
2: {id: 2, name: "Jebisha", "kill: 13 , knock: 5}
Nov
02
3 weeks ago
Activity icon

Replied to How To Sum All Sold Column Where Product_id Is Same

@xtremer360 @michaloravec i am getting this error

Object of class Illuminate\Database\Eloquent\Collection could not be converted to number 
Activity icon

Started a new Conversation How To Sum All Sold Column Where Product_id Is Same

This is my ProductSold Table

id  |  product_id      |      sold_year    |  sold  | created_at   |
*---*------------------*-------------------*--------*-----------------*
1   |        2         |      2018/19      |   12  |    2020-11-01 04:17:02
2   |        1         |      2018/19      |   10  |   2020-11-01 04:17:02
3   |        3         |      2018/19      |    8  |    2020-11-01 04:17:02
4   |        2         |      2018/19      |    6  |    2020-11-01 04:17:02
5   |        3         |      2018/19      |   15  |   2020-11-01 04:17:02
6   |        1         |      2018/19      |    5  |   2020-11-01 04:17:02

This is function in my Model

public function productSold(){
     $product = ProductSold::where('product_id', $this->id)
               ->where('sold_year',  '2018/19')
                ->pluck('sold')
                ->first();

            return $product ?? 0;
}

I want to sum all sold column of same product_id.Example I want to sum all sold column where product_id is 1

product_id | sold
    1              |  15
    2              | 18
    3              |  23

But i am getting result like this

product_id | sold
    1              |  10
    2              | 12
    3              |  8
Nov
01
3 weeks ago
Activity icon

Replied to Invalid Argument Supplied For Foreach()

@sergiu17 @kingmaker_bgp

This is my actualy real data

"["2451","2453","2463","2457","2456","2470","2467","2468","2488","2472","2482","2469","2480","2462","2464","2461","2476","2479","2471","2489","2506","2493","2477","2496","2481","2494","2505","2492","2474","2504","2478","2484","2487","2486","2465","2466","2 ◀"
Activity icon

Replied to Invalid Argument Supplied For Foreach()

No Not working :/ but i locally it working fine but in live i donot why

Activity icon

Started a new Conversation Invalid Argument Supplied For Foreach()

When i do check dd($order->customer_id) result will come like this

"["2451","2453","2463","2457","2456","2470","2467","2468","2488","2472","2482","2469","2480","2462","2464","2461","2476","2479","2471","2489","2506","2493","2477","2496","2481","2494","2505","2492","2474","2504","2478","2484","2487","2486","2465","2466","2 ◀"]

i used foreach loop like this

  @foreach(json_decode($order->customer_id) as $key => $value)
	 <input name="customer_id[]" value="{{ json_decode($order->customer_id)[$key] ?? null }}" class="form-     control">
  @endforeach

But its giving error

Oct
30
3 weeks ago
Activity icon

Replied to How To Undo A Push In Git?

@lxberger Thanks but

i execute git reset --hard
git pull origin master 
git revert commit-id
Activity icon

Started a new Conversation How To Undo A Push In Git?

I accidentally push branch instead of master So is there any way to revert that push so that i can bring master code ? I am supposed to push master but i push git push origin branch name ? I was in master and i supposed to hit this code and go another branch from master

 "git checkout ProductBranch"

but i accidentally

 git push ProductBranch 

.So i donot want to revert that git push ProductBranch

Oct
21
1 month ago
Activity icon

Replied to How To Limit Data/Option In Select2 Jquery?

@marianomoreyra so i need to put data 1000 of data in select box ? so is it good method to use AJAX ?

 fetch('http://ims.rarait.com/api/filterCountries')
        .then(response => response.json()
        .then(data => {
            data.countries.forEach(function (country) {
            	$("#countries").select2({
            	 });
          	  var newOption = new Option(country.name, country.id, false, false);
           	 $('#countries').append(newOption).trigger('change');
	});

Is it right method ?

$("#countries").select2({
        ajax: {
            url:"http://ims.rarait.com/api/filterCountries",
            dataType: 'json',
            results: function (data) {
             return {
                  results: data.countries.forEach(function (country) {
                        return {
                            text: country.name,
                            id: country.id
                        }
                    })
                };
              
            }
        }
    })
Activity icon

Started a new Conversation How To Limit Data/Option In Select2 Jquery?

This is my script file

I am using this https://select2.org/ select2 for select box. So there may be many data so i want to limit some few country at first.But when i start search i can get any country i want.so How should do ?

 data.countries.forEach(function (country) {
            $("#countries").select2({
             
           });
            var newOption = new Option(country.name, country.id, false, false);
            $('#countries').append(newOption).trigger('change');

        });

Example

<select>
   <option>USA</option>
   <option>UK</option>
   <option>China</option>
   <option>Russia</option>
   <option>Mexico</option>
   <option>Bangladesh</option>
   <option>Pakistan</option>
   <option>India</option>
   <option>Bhutan</option>
   <option>France</option>
   <option>Portugual</option>
   <option>Uruguay</option>
   <option>Argentina</option>
   <option>Wales</option>
   <option>Finland</option>
   <option>Thailan</option>
</select>

From All these country i want to show only 4 country at first but when user search country name like India then it should return result .

<select>
   <option>USA</option>
   <option>UK</option>
   <option>China</option>
   <option>Russia</option>
</select>
Activity icon

Replied to My Path For CSS And Javascript Is Not Working ?

@jlrdw

Yes this works

<link href="http://http://127.0.0.1:8000/backend/dist/css/yourfile.css" rel="stylesheet">

but how to give proper URL if i need to host this project ?

Activity icon

Replied to My Path For CSS And Javascript Is Not Working ?

@jlrdw my all css file are in inside public folder like this

public /backend/dist/css
Activity icon

Replied to My Path For CSS And Javascript Is Not Working ?

@jlrdw yeah i tried to put your method but in console like this will come

 http://127.0.0.1:8000/%7B%7B%20asset('assets/js/jquery.js')%20%7D%7D 
Activity icon

Started a new Conversation My Path For CSS And Javascript Is Not Working ?

This is my route for main/index.html

Route::get('main-index', function () {
    return view('main.index');
});

i tried to give css path like this

     <link href="{{ URL::asset('backend/dist/css/tabler.min.css') }}">
     //and this also 
    <link href="{{ asset('backend') }}/dist/css/tabler.min.css">

But its nor working and in console table.min.css not found

when i open view-sources of that page and click that link

http://127.0.0.1:8000/%7B%7B%20URL::asset('backend/dist/css/tabler.min.css')%20%7D%7D

So how to solve this ?

Oct
19
1 month ago
Activity icon

Replied to How To Make Users Column Empty From SQL Statement ?

@rodrigo.pedra i was trying your method and it works thank you so much

Activity icon

Replied to How To Make Users Column Empty From SQL Statement ?

@saurav77 but this will add null data isnot it ? i want to update column only

Activity icon

Started a new Conversation How To Make Users Column Empty From SQL Statement ?

Like yesterday, This is my users table and i want to make coursable_id and coursable_type empty ?

id |  name   |  email            | coursable_id | coureable_type | created_at 
 1 |   John  |  [email protected]   |	2        |	App/Science        |
 2 |   Anni  |  [email protected]   |	3        |	App/Commerce   |
 3 |   Fela  |  [email protected]   |	6        |	App/Commerce    |
4  |   Sita  |  [email protected]   |	7        |      App/Science                |
5  |   Syam  |  [email protected]   |	9        |	App/Commerce     |
6  |   Anup  |  [email protected]   |	4        |	App/Science           |

SELECT "coursable_id", "coureable_type " FROM `users`;
Oct
18
1 month ago
Activity icon

Replied to How To Delete Users From SQL Statement

@sinnbeck yes this works

SELECT * FROM `users` WHERE coursable_type='App\Science';
Activity icon

Replied to How To Delete Users From SQL Statement

@sinnbeck No I am getting empty even i have data where coursable_type="App/Science"

MySQL returned an empty result set 
Activity icon

Started a new Conversation How To Delete Users From SQL Statement

My users database look like this I want to cleany database data so i am cleaning from localhost.

id |  name   |  email            | coursable_id | coureable_type | created_at 
 1 |   John  |  [email protected]   |	2        |	App/Science        |
 2 |   Anni  |  [email protected]   |	3        |	App/Commerce   |
 3 |   Fela  |  [email protected]   |	6        |	App/Commerce    |
4  |   Sita  |  [email protected]   |	7        |      App/Science                |
5  |   Syam  |  [email protected]   |	9        |	App/Commerce     |
6  |   Anup  |  [email protected]   |	4        |	App/Science           |

I want to delete all user whose coursable_type is App/Science

DELETE FROM `users` WHERE coursable_type='App/Science';

but its not working.

Oct
14
1 month ago
Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@michaloravec i am using Spatie role and permission where role has Super Admin, Admin,Contractor,Hakim and i want to send notification to only Admin which type is Entry.So Thank you for recommanding documentation

Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@michaloravec Hey Thanks for recommanding documentation.. I think it worked

Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@michaloravec User::role(2) have only managable models have type column .User::role(1) & User::role(3) doesnot have type colum

Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@automica @michaloravec I tried this

 $users = User::role(2)->with(['managable' => function ($query) {
            $query->where('type', '=', 'Entry');
        }])->get();

But it show all user of role id -> 2 with both Entry and non-entry

Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@michaloravec

Column not found: 1054 Unknown column 'type' in 'where clause'
Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@automica

Instantiation of 'Closure' is not allowed
Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@automica @michaloravec I have defined relation like this

 public function managable()
    {
        return $this->morphTo();
    }

But when i use this

$users = User::role(2)->whereHas('managable' , function (Builder $query) {
        $query->where('type', 'Entry');
})->get();

Now error is

Please use whereHasMorph() for MorphTo relationships.
Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@michaloravec My relation in User Model like this

 public function managable()
    {
        return $this->morphTo();
    }
Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@automica From Above data there are two users John Cena and UnderTaker which role id is 2 and again i need data from role id is 2 and which type is "Entry" only

I am sorry but bad explaining

Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@automica Suppose There are 3 role

id-1 Super-Admin
id-2  Admin           
id-3  Contractor

and there table suppose Contractor table

id |   name              | type      | 
1  |  Branch Office      | Entry     |
2  | Branch office        | Non-Entry |

If i do this,it will bring result all Contractor data but i need to bring All COntractor data which type="Entry"

User::role(3)->get();
Activity icon

Replied to How To Find User Role If Role -> Contactor Type Is Entry Only ?

@automica I need all user which

manageable ->type ="Entry "

.There could be many data which has managable->type=="Entry" So i need only user which has

[managable]=>type="Entry"
Activity icon

Started a new Conversation How To Find User Role If Role -> Contactor Type Is Entry Only ?

if i do

 $users = User::role(2)->get();
 $users=json_decode(json_encode($users));
  echo "<pre>"; print_r($users); die;

   

My Result will come like this all user of role->id is 2 but i need only which [managable] type is "Entry"

Array
(
    [0] => stdClass Object
        (
            [id] => 2
            [name] => John Cena
            [email] => [email protected]
            [phone] => 57742563335
            [managable_type] => App\Contactor
            [managable_id] => 3
            [roles] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => 2
                            [name] => Branch Office Tekul
                            [guard_name] => web
                            [manager] => Contactor
                             [pivot] => stdClass Object
                                (
                                    [model_id] => 2
                                    [role_id] => 2
                                    [model_type] => App\User
                                )

                        )

                )

            

            [managable] => stdClass Object
                (
                    [id] => 3
                    [name] => Tekul Entry Point
                    [type] => Entry  // I need to find all user which type is "entry" 
                )

        )

    [1] => stdClass Object
        (
            [id] => 4
            [name] => UnderTaker
            [email] =>[email protected]
            [phone] => 9851122730
            [managable_type] => App\Contactor
            [managable_id] => 4
            
            [roles] => Array
                (
                    [0] => stdClass Object
                        (
                            [id] => 2
                            [name] => Branch Office Pakal
                            [guard_name] => web
                            [manager] => Contractor
                            [pivot] => stdClass Object
                                (
                                    [model_id] => 4
                                    [role_id] => 2
                                    [model_type] => App\User
                                )

                        )

                )

           
            [managable] => stdClass Object
               (
                    [id] => 4
                    [name] => Pakal Office, Rajbiraj
                    [type] => Non-Entry // I donot need user name ="undertaker" because it type is non-entry so
                   
                )

        )

)

So how to find User::role(2)->get(); if managable->id =Entry only

Oct
13
1 month ago
Activity icon

Replied to How To Prevent Tab Button Form Button And Jump Another Field ?

@kinomej there are lot of field in one form and there are lot of form in project.So