256 Kilobytes

Web Development Answers > Laravel

Type AnswersAsk and answer questions, if that is something that you want to do. Category Web DevelopmentContent about developing websites, web applications, and other similar projects. Tag Laravel

Profile Photo - August R. Garcia

[Solved] PHP/Laravel - Cache Query for Current Request/Pageload

Answers in Server-Side | By August R. Garcia

Published 5 days agoSat, 09 Nov 2019 12:03:54 -0800

Profile Photo - August R. Garcia

TL;DR: Use $GLOBALS

MoreThe Laravel caching functions seem to not have specific built-in functionality to cache a query for only the current pageload, but it can easily be do...
🗨
0
🐏
0
👁
29
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Call the currentPage and lastPage method...

MoreIncorrect: <h1>Page {{ $paginator->currentPage }} of {{ $paginator->lastPage }}</h1> Correct: <h1>Page {{ $pagina...
🗨
0
🐏
0
👁
56
Profile Photo - August R. Garcia

[Solved] Adding an "active" class to <nav>/navigation menus in Laravel

Answers in Client-Side | By August R. Garcia

Published 2 months agoTue, 20 Aug 2019 16:25:41 -0700 | Last update 2 months agoTue, 20 Aug 2019 16:26:29 -0700

Profile Photo - August R. Garcia

Basically the same with PHP in general;...

MoreBasically the same with PHP in general; only real difference is the use of Route::currentRouteName(). Code: <nav> <?php $...
🗨
0
🐏
0
👁
82
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

I'm going to fucking kill myself on live...

MoreThe problem was that two new helper files had been added. Similar to these: https://laravel-news.com/creating-helpers Fairly standard. A...
🗨
0
🐏
0
👁
120
Profile Photo - Some Guy

Laravel - How can I check if a collection is empty?

Answers in Frameworks | By Some Guy

Published 11 months agoSun, 02 Dec 2018 03:44:19 -0800

Profile Photo - Scuffed Dog

Last Reply Thank you Univa, you're a very smart gentleman and also a nice companion in life. Scuffed Dog,

Thank you Univa, you're a...

Mon, 03 Jun 2019 09:12:06 -0700 5 months ago
🗨
2
🐏
0
👁
268
Profile Photo - Some Guy
Profile Photo - Univa

Last Reply Eager loading is achieved using the Include() method. for example: LINQ Query Syntax: using (var context = new SchoolDBEntities())... Univa,

Eager loading is achieved...

Fri, 31 May 2019 11:17:29 -0700 5 months ago
🗨
1
🐏
0
👁
259
Profile Photo - Some Guy

What does "PHP Artisan dump-autoload" actually do?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:45:47 -0800

Profile Photo - August R. Garcia

Last Reply Also, if you're having a caching issue with Laravel and php artisan dump-autoload didn't fix your problem, you can also try this: php compos... August R. Garcia,

Also, if you're having a...

Thu, 16 May 2019 21:27:41 -0700 5 months ago
🗨
2
🐏
0
👁
248
Profile Photo - Some Guy
Profile Photo - Univa

Last Reply To use subqueries with Laravel's query builder, you should add it to the join as follows: ->leftJoin(DB::raw("(SELECT [...]) AS p"), 'p.post_i... Univa,

To use subqueries with La...

Thu, 16 May 2019 08:22:47 -0700 5 months ago
🗨
1
🐏
0
👁
221
Profile Photo - Some Guy

Laravel 301 all pages to the www version and the https version.

Answers in Frameworks | By Some Guy

Published 11 months agoSun, 02 Dec 2018 03:44:07 -0800

Profile Photo - August R. Garcia

Last Reply Update. Don't fucking use the code in the previous post I made. Use this code: <IfModule mod_rewrite.c> <IfModule mod_negotiation.c... August R. Garcia,

Update. Don't fucking use...

Sat, 13 Apr 2019 00:01:32 -0700 7 months ago
🗨
3
🐏
0
👁
204
Profile Photo - Some Guy
Profile Photo - Univa

Last Reply Step 1: Make sure you have .env file in your application.If not run this command cp .env.example .env Step 2: Now run following command ( php artisan... Univa,

Step 1: Make sure you hav...

Fri, 12 Apr 2019 11:24:47 -0700 7 months ago
🗨
1
🐏
0
👁
287
Profile Photo - August R. Garcia

[Solution] How to View Queries in Laravel for Debugging

Answers in Frameworks | By August R. Garcia

Published 8 months agoTue, 12 Mar 2019 03:30:21 -0700 | Last update 8 months agoTue, 12 Mar 2019 04:53:04 -0700

Profile Photo - August R. Garcia

Ghetto hack edition.

MoreStep 1: Open app/Providers/AppServiceProvider.php Step 2: Add this code to the boot() function: if ( TRUE ) { $G...
🗨
0
🐏
0
👁
209
Profile Photo - Some Guy

How to install Laravel properly?

Answers in Web Development | By Some Guy

Published 9 months agoWed, 06 Feb 2019 14:01:09 -0800

Profile Photo - roxblade

Last Reply Laravel installation can be executed by following the simple instructions on Laravel docs here. roxblade,

Laravel installation can...

Mon, 18 Feb 2019 09:22:33 -0800 8 months ago
🗨
1
🐏
0
👁
220
Profile Photo - Some Guy

[Laravel/Eloquent] orderBy id DESC?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:42:36 -0800

Profile Photo - August R. Garcia

Last Reply // The query in Eloquent $posts = Post::orderBy('id', 'DESC'); // Run the query and get the results $posts = $posts->get(); Laravel Doc... August R. Garcia,

Fri, 18 Jan 2019 20:15:31 -0800 9 months ago
🗨
1
🐏
0
👁
247
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last Reply Go to /public/.htaccess and set up a 301 the same as you would for a non--Laravel website. August R. Garcia,

Go to /public/.htaccess a...

Mon, 14 Jan 2019 16:58:25 -0800 10 months ago
🗨
1
🐏
0
👁
240
Profile Photo - Some Guy

How do .htaccess files work with Laravel?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:52:37 -0800

Profile Photo - August R. Garcia

Last Reply Go to /public/.htaccess and you will find a default .htaccess to work off of. August R. Garcia,

Go to /public/.htaccess a...

Mon, 14 Jan 2019 16:50:43 -0800 10 months ago
🗨
1
🐏
0
👁
242
Profile Photo - Some Guy

[Laravel] How to make a route function return a controller?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:53:27 -0800

Profile Photo - Some Guy

MoreI'm not very experienced with Frameworks. Does anyone know how to make a route function return a controller?
🗨
0
🐏
0
👁
228
Profile Photo - Some Guy

[Laravel/Eloquent] What is "active" when referring to Laravel models?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:53:17 -0800

Profile Photo - Some Guy

MoreI am new to Frameworks. Can anybody explain what is "active" when referring to Laravel models?Here's an example of a code snippet that...
🗨
0
🐏
0
👁
216
Profile Photo - Some Guy

Fixing "Could not open input file: Artisan?"

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:52:57 -0800

Profile Photo - Some Guy

MoreSo far my program has gone well and done what I needed it to do. Today though, I get an error when I try to run it. How would I fix the error "Co...
🗨
0
🐏
0
👁
281
Profile Photo - Some Guy
Profile Photo - Some Guy

MoreAny Frameworks users out there that can help me with this question would really be appreciated. I don't know how to fix "No supported encryp...
🗨
0
🐏
0
👁
265
Profile Photo - Some Guy

[Laravel] When using DB::select(), how can I get the result as a Collection?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:52:27 -0800

Profile Photo - Some Guy

MoreI'm trying to get my result as a Collection, how do I do this with DB::select()?
🗨
0
🐏
0
👁
226
Profile Photo - Some Guy

[Laravel/Eloquent] When to use parentheses?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:52:07 -0800

Profile Photo - Some Guy

MoreHi! I just started using Laravel at my job, so I realize this question is probably super basic. But I still can't figure out exactly when I'...
🗨
0
🐏
0
👁
254
Profile Photo - Some Guy

[Laravel] Is it possible to have nested eager loading for specific columns?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:51:57 -0800

Profile Photo - Some Guy

MoreI just started using Larevel, so I'm a bit unfamiliar with some of its functions. I was wondering if it was possible to have nested eager loading...
🗨
0
🐏
0
👁
262
Profile Photo - Some Guy

Can you use mysqli in a Laravel project?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:51:47 -0800

Profile Photo - Some Guy

MoreI'm building an online store front for a friend's business and using Laravel to automate some of the functions. Will mysqli be a good choice...
🗨
0
🐏
0
👁
211
Profile Photo - Some Guy

[Laravel] How to convert a collection to an associative array?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:51:37 -0800

Profile Photo - Some Guy

MoreI'm using Laravel and I have a collection that I'd like to convert to an associative array. What do I need to do?
🗨
0
🐏
0
👁
208
Profile Photo - Some Guy
Profile Photo - Some Guy

MoreHi! I'll admit that I'm a bit new at web development, and it's been quite an experience lol. I keep running into errors and troubleshoo...
🗨
0
🐏
0
👁
275
Profile Photo - Some Guy

[Laravel] How to ALTER TABLE in the Schema Builder?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:51:17 -0800

Profile Photo - Some Guy

MoreMy new job requires me to use Laravel, so I've been trying to familiarize myself with its features. Specifically, I want to be able to alter a ta...
🗨
0
🐏
0
👁
189
Profile Photo - Some Guy

How to open a new Laravel project in the browser?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:51:07 -0800

Profile Photo - Some Guy

MoreOk, all you Frameworks experts out there. Here is a question from someone who just started using it last week. How do you open a new Laravel project i...
🗨
0
🐏
0
👁
198
Profile Photo - Some Guy

How to check Laravel version?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:50:57 -0800

Profile Photo - Some Guy

MoreHi, I am in the process of working on a web design and I was told by a colleague of mine about Laravel in terms of frameworking. How does that work I...
🗨
0
🐏
0
👁
186
Profile Photo - Some Guy

[Laravel] How top get the contents of an UploadedFile?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:50:47 -0800

Profile Photo - Some Guy

MoreI am new to using Frameworks. I thought it would be straightforward but, how do I go about getting the contents of an uploaded file?
🗨
0
🐏
0
👁
188
Profile Photo - Some Guy

Laravel find/delete model by composite primary key?

Answers in Frameworks | By Some Guy

Published 10 months agoSun, 13 Jan 2019 04:50:37 -0800

Profile Photo - Some Guy

MoreI am trying to use frameworks and want Laravel to find/delete model by composite primary key?
🗨
0
🐏
0
👁
165