Using get() with Laravel 5How do I get PHP errors to display?Get the first element of an arrayHow do I get a YouTube video thumbnail from the YouTube API?Get the full URL in PHPLaravel/Ardent - on save(), error: Relationship method must return an object of type IlluminateAuth::user() returns nullLaravel Logging in userMenu in laravel 5 Multiple levels?Laravel Socialite Package ErrorLaravel 5.7 - “orderBy” Not Sorting Results

Meaning and structure of headline "Hair it is: A List of ..."

Why do aircraft leave cruising altitude long before landing just to circle?

May the tower use the runway while an emergency aircraft is inbound?

Can planar set contain even many vertices of every unit equilateral triangle?

Designing a prison for a telekinetic race

What exactly happened to the 18 crew members who were reported as "missing" in "Q Who"?

How to render "have ideas above his station" into German

Trying to understand how Digital Certificates and CA are indeed secure

Regression when x and y each have uncertainties

Subgroup generated by a subgroup and a conjugate of it

Why can't I see 1861 / 1871 census entries on Freecen website when I can see them on Ancestry website?

Did Michelle Obama have a staff of 23; and Melania have a staff of 4?

Output the list of musical notes

Combinatorial Argument for Exponential and Logarithmic Function Being Inverse

How does the illumination of the sky from the sun compare to that of the moon?

Can anybody tell me who this Pokemon is?

Expressing a chain of boolean ORs using ILP

The Lucky House

Programming a recursive formula into Mathematica and find the nth position in the sequence

Are unaudited server logs admissible in a court of law?

Is a suspension needed to do wheelies?

What's a good pattern to calculate a variable only when it is used the first time?

Number of matrices with bounded products of rows and columns

How do the Durable and Dwarven Fortitude feats interact?



Using get() with Laravel 5


How do I get PHP errors to display?Get the first element of an arrayHow do I get a YouTube video thumbnail from the YouTube API?Get the full URL in PHPLaravel/Ardent - on save(), error: Relationship method must return an object of type IlluminateAuth::user() returns nullLaravel Logging in userMenu in laravel 5 Multiple levels?Laravel Socialite Package ErrorLaravel 5.7 - “orderBy” Not Sorting Results






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a Laravel 5 app that I'm trying to get data from two different tables: Endpoint table and Audits table. They are referencing each other by Endpoints.id and Audits.endpoint_id. I'm trying to get the audits for that specific endpoint but keep running into errors like Too few arguments to function IlluminateSupportCollection::get()



Here are my files:



OnDemandController.php



public function index()


$endpoints = auth()->user()->endpoints->where('is_ondemand', true);

$endpoint = $endpoints->get();

$mobileAudits = $endpoint->audits()->where('strategy', 'mobile')->first();
$desktopAudits = $endpoint->audits()->where('strategy', 'desktop')->first();

return view('ondemand.index', compact('endpoints', 'mobileAudits', 'desktopAudits'));




index.blade.php



 @forelse($endpoints as $endpoint)
$desktopAudits->id - $mobileAudits->id
@empty
nope
@endforelse


Endpoint Model



protected $guarded = [];

protected $requestedAudits = null;

public function audits()

return $this->hasMany(Audit::class);



Any help would be greatly appreciated.



Thanks!










share|improve this question



















  • 2





    ->endpoints returns a collection, while ->endpoints() returns the query builder. $endpoints may already have what you want, but if not, use ->endpoints()

    – aynber
    Mar 27 at 13:36











  • @aynber not quite sure I understand, can you provide an example please?

    – Trey Copeland
    Mar 27 at 14:03











  • What are you trying to accomplish with get()? $endpoints should already have what you need.

    – aynber
    Mar 27 at 14:10












  • Is "is_ondemand" from User? If yes, you could try auth()->user()->where('is_ondemand', true)->endpoints()->get()

    – JoaoGRRR
    Mar 27 at 14:12











  • @JoaoGRRR is_ondemand is from endpoints

    – Trey Copeland
    Mar 27 at 14:19

















0















I have a Laravel 5 app that I'm trying to get data from two different tables: Endpoint table and Audits table. They are referencing each other by Endpoints.id and Audits.endpoint_id. I'm trying to get the audits for that specific endpoint but keep running into errors like Too few arguments to function IlluminateSupportCollection::get()



Here are my files:



OnDemandController.php



public function index()


$endpoints = auth()->user()->endpoints->where('is_ondemand', true);

$endpoint = $endpoints->get();

$mobileAudits = $endpoint->audits()->where('strategy', 'mobile')->first();
$desktopAudits = $endpoint->audits()->where('strategy', 'desktop')->first();

return view('ondemand.index', compact('endpoints', 'mobileAudits', 'desktopAudits'));




index.blade.php



 @forelse($endpoints as $endpoint)
$desktopAudits->id - $mobileAudits->id
@empty
nope
@endforelse


Endpoint Model



protected $guarded = [];

protected $requestedAudits = null;

public function audits()

return $this->hasMany(Audit::class);



Any help would be greatly appreciated.



Thanks!










share|improve this question



















  • 2





    ->endpoints returns a collection, while ->endpoints() returns the query builder. $endpoints may already have what you want, but if not, use ->endpoints()

    – aynber
    Mar 27 at 13:36











  • @aynber not quite sure I understand, can you provide an example please?

    – Trey Copeland
    Mar 27 at 14:03











  • What are you trying to accomplish with get()? $endpoints should already have what you need.

    – aynber
    Mar 27 at 14:10












  • Is "is_ondemand" from User? If yes, you could try auth()->user()->where('is_ondemand', true)->endpoints()->get()

    – JoaoGRRR
    Mar 27 at 14:12











  • @JoaoGRRR is_ondemand is from endpoints

    – Trey Copeland
    Mar 27 at 14:19













0












0








0








I have a Laravel 5 app that I'm trying to get data from two different tables: Endpoint table and Audits table. They are referencing each other by Endpoints.id and Audits.endpoint_id. I'm trying to get the audits for that specific endpoint but keep running into errors like Too few arguments to function IlluminateSupportCollection::get()



Here are my files:



OnDemandController.php



public function index()


$endpoints = auth()->user()->endpoints->where('is_ondemand', true);

$endpoint = $endpoints->get();

$mobileAudits = $endpoint->audits()->where('strategy', 'mobile')->first();
$desktopAudits = $endpoint->audits()->where('strategy', 'desktop')->first();

return view('ondemand.index', compact('endpoints', 'mobileAudits', 'desktopAudits'));




index.blade.php



 @forelse($endpoints as $endpoint)
$desktopAudits->id - $mobileAudits->id
@empty
nope
@endforelse


Endpoint Model



protected $guarded = [];

protected $requestedAudits = null;

public function audits()

return $this->hasMany(Audit::class);



Any help would be greatly appreciated.



Thanks!










share|improve this question














I have a Laravel 5 app that I'm trying to get data from two different tables: Endpoint table and Audits table. They are referencing each other by Endpoints.id and Audits.endpoint_id. I'm trying to get the audits for that specific endpoint but keep running into errors like Too few arguments to function IlluminateSupportCollection::get()



Here are my files:



OnDemandController.php



public function index()


$endpoints = auth()->user()->endpoints->where('is_ondemand', true);

$endpoint = $endpoints->get();

$mobileAudits = $endpoint->audits()->where('strategy', 'mobile')->first();
$desktopAudits = $endpoint->audits()->where('strategy', 'desktop')->first();

return view('ondemand.index', compact('endpoints', 'mobileAudits', 'desktopAudits'));




index.blade.php



 @forelse($endpoints as $endpoint)
$desktopAudits->id - $mobileAudits->id
@empty
nope
@endforelse


Endpoint Model



protected $guarded = [];

protected $requestedAudits = null;

public function audits()

return $this->hasMany(Audit::class);



Any help would be greatly appreciated.



Thanks!







php laravel






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 13:34









Trey CopelandTrey Copeland

2,6634 gold badges20 silver badges36 bronze badges




2,6634 gold badges20 silver badges36 bronze badges










  • 2





    ->endpoints returns a collection, while ->endpoints() returns the query builder. $endpoints may already have what you want, but if not, use ->endpoints()

    – aynber
    Mar 27 at 13:36











  • @aynber not quite sure I understand, can you provide an example please?

    – Trey Copeland
    Mar 27 at 14:03











  • What are you trying to accomplish with get()? $endpoints should already have what you need.

    – aynber
    Mar 27 at 14:10












  • Is "is_ondemand" from User? If yes, you could try auth()->user()->where('is_ondemand', true)->endpoints()->get()

    – JoaoGRRR
    Mar 27 at 14:12











  • @JoaoGRRR is_ondemand is from endpoints

    – Trey Copeland
    Mar 27 at 14:19












  • 2





    ->endpoints returns a collection, while ->endpoints() returns the query builder. $endpoints may already have what you want, but if not, use ->endpoints()

    – aynber
    Mar 27 at 13:36











  • @aynber not quite sure I understand, can you provide an example please?

    – Trey Copeland
    Mar 27 at 14:03











  • What are you trying to accomplish with get()? $endpoints should already have what you need.

    – aynber
    Mar 27 at 14:10












  • Is "is_ondemand" from User? If yes, you could try auth()->user()->where('is_ondemand', true)->endpoints()->get()

    – JoaoGRRR
    Mar 27 at 14:12











  • @JoaoGRRR is_ondemand is from endpoints

    – Trey Copeland
    Mar 27 at 14:19







2




2





->endpoints returns a collection, while ->endpoints() returns the query builder. $endpoints may already have what you want, but if not, use ->endpoints()

– aynber
Mar 27 at 13:36





->endpoints returns a collection, while ->endpoints() returns the query builder. $endpoints may already have what you want, but if not, use ->endpoints()

– aynber
Mar 27 at 13:36













@aynber not quite sure I understand, can you provide an example please?

– Trey Copeland
Mar 27 at 14:03





@aynber not quite sure I understand, can you provide an example please?

– Trey Copeland
Mar 27 at 14:03













What are you trying to accomplish with get()? $endpoints should already have what you need.

– aynber
Mar 27 at 14:10






What are you trying to accomplish with get()? $endpoints should already have what you need.

– aynber
Mar 27 at 14:10














Is "is_ondemand" from User? If yes, you could try auth()->user()->where('is_ondemand', true)->endpoints()->get()

– JoaoGRRR
Mar 27 at 14:12





Is "is_ondemand" from User? If yes, you could try auth()->user()->where('is_ondemand', true)->endpoints()->get()

– JoaoGRRR
Mar 27 at 14:12













@JoaoGRRR is_ondemand is from endpoints

– Trey Copeland
Mar 27 at 14:19





@JoaoGRRR is_ondemand is from endpoints

– Trey Copeland
Mar 27 at 14:19












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55378519%2fusing-get-with-laravel-5%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55378519%2fusing-get-with-laravel-5%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현