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

[Laravel] unserialize(): Error at offset 2 of 32758 bytes

Answers in Frameworks | By August R. Garcia

Published

Profile Photo - August R. Garcia

Solved, basically

MoreSome max-size issue with Laravel caching library. <?php // Fix weird issue with cache // unserialize(): Error at offset 2 of 32758 byt...
🗨 0
🐏 0
👁 37
Profile Photo - August R. Garcia

[Solved] Laravel - How to List All Queries Used to Generate a Page with Execution Times

Answers in Frameworks | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

How to show color-coded boxes for each q...

MoreRework/expansion of a solution provided in a Stack Overflow thread from 2 years, 11 months ago (December 2016). My team and I are working on...
🗨 0
🐏 1
👁 109
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

E.g., a validation rule where "<...

MoreE.g., a validation rule where "<p>This is a&nbsp;post</p>" is counted as 14 characters instead of 26 characters. Anyway, here'...
🗨 0
🐏 0
👁 210
Profile Photo - August R. Garcia

[Solved] Automatic Copyright Footer Dates in Laravel/Basically Vanilla PHP

Answers in Server-Side | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

The only part about this that isn't vani...

MoreThe only part about this that isn't vanilla PHP is using {{ $var }} as shorthand for <?= htmlspecialchars($var); ?>. <style> .footer...
🗨 0
🐏 0
👁 183
Profile Photo - August R. Garcia
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
👁 204
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
👁 590
Profile Photo - August R. Garcia

[Solved] Adding an "active" class to

Answers in Client-Side | By August R. Garcia

Published | Last Update

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
👁 160
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
👁 240
Profile Photo - Some Guy

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

Answers in Frameworks | By Some Guy

Published

Profile Photo - Scuffed Dog

Last ReplyThank 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 -070011 months ago1
🗨 2
🐏 0
👁 387
Profile Photo - Some Guy
Profile Photo - Univa

Last ReplyEager 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 -070011 months ago1
🗨 1
🐏 0
👁 352
Profile Photo - Some Guy

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

Answers in Frameworks | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyAlso, 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 -07001 year ago1
🗨 2
🐏 0
👁 383
Profile Photo - Some Guy
Profile Photo - Univa

Last ReplyTo 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 -07001 year ago1
🗨 1
🐏 0
👁 341
Profile Photo - Some Guy

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

Answers in Frameworks | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyUpdate. 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 -07001 year ago1
🗨 3
🐏 0
👁 301
Profile Photo - Some Guy
Profile Photo - Univa

Last ReplyStep 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 -07001 year ago1
🗨 1
🐏 0
👁 443
Profile Photo - August R. Garcia

[Solution] How to View Queries in Laravel for Debugging

Answers in Frameworks | By August R. Garcia

Published | Last Update

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
👁 321
Profile Photo - Some Guy

How to install Laravel properly?

Answers in Web Development | By Some Guy

Published

Profile Photo - roxblade

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

Laravel installation can...

Mon, 18 Feb 2019 09:22:33 -08001 year ago1
🗨 1
🐏 0
👁 323
Profile Photo - Some Guy

[Laravel/Eloquent] orderBy id DESC?

Answers in Frameworks | By Some Guy

Published

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 -08001 year ago1
🗨 1
🐏 0
👁 372
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last ReplyGo 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 -08001 year ago1
🗨 1
🐏 0
👁 326
Profile Photo - Some Guy

How do .htaccess files work with Laravel?

Answers in Frameworks | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyGo 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 -08001 year ago1
🗨 1
🐏 0
👁 341
Profile Photo - Some Guy

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

Answers in Frameworks | By Some Guy

Published

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
👁 306
Profile Photo - Some Guy
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
👁 295
Profile Photo - Some Guy

Fixing "Could not open input file: Artisan?"

Answers in Frameworks | By Some Guy

Published

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
👁 399
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
👁 341
Profile Photo - Some Guy
Profile Photo - Some Guy

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

[Laravel/Eloquent] When to use parentheses?

Answers in Frameworks | By Some Guy

Published

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
👁 340
Profile Photo - Some Guy
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
👁 399
Profile Photo - Some Guy

Can you use mysqli in a Laravel project?

Answers in Frameworks | By Some Guy

Published

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
👁 329
Profile Photo - Some Guy

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

Answers in Frameworks | By Some Guy

Published

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
👁 291
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
👁 422
Profile Photo - Some Guy

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

Answers in Frameworks | By Some Guy

Published

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
👁 281