256 Kilobytes

Frameworks > PHP

Type All Category FrameworksLaravel, Ruby on Rails, etc. Tag PHPPHP: Hypertext Preprocessor is a scripting language used heavily in server-side development. PHP is frequently used for templating.

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
👁 1,905
Profile Photo - August R. Garcia

How to Automatically Merge and Minify CSS Files in Laravel 5.7

Articles in Frameworks | By August R. Garcia

Published | Last Update

Profile Photo - August R. Garcia

This also basically works for PHP in gen...

MoreChoose a CSS minifying function. This function from Datayze combined with this additional function to remove comments works fine. Ideally move th...
🗨 0
🐏 0
👁 754
Profile Photo - August R. Garcia
Profile Photo - August R. Garcia

Holy shit, use krsort(), not arsort().

MoreOkay, you fucking cocksuckers, I'm going to stab myself for the reason stated in the description.Anyway, here's some code to make a fucking "recently...
🗨 0
🐏 0
👁 2,124
Profile Photo - Some Guy
Profile Photo - August R. Garcia

Last ReplyAre you using the Blade templating engine? When you use the double curly brace syntax to insert content, it uses the PHP htmlspecialchars() functio... August R. Garcia,

Are you using the Blade t...

Sun, 02 Dec 2018 03:49:45 -08002 years ago1
🗨 1
🐏 0
👁 670
Profile Photo - Some Guy

[Laravel] If not on a certain page redirect to that page?

Answers in Frameworks | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplySomething along these lines should work for your purposes:if (Request::path() != "posts/some-post") return redirect('/posts/some-post&... August R. Garcia,

Something along these lin...

Sun, 02 Dec 2018 03:48:42 -08002 years ago1
🗨 1
🐏 0
👁 314
Profile Photo - Some Guy

In web.PHP line 23: The use statement with non-compound name 'Request' has no effect

Answers in Frameworks | By Some Guy

Published | Last Update

Profile Photo - August R. Garcia

Last ReplyThis is a bug that I ran into while testing a few things in the routes/web.PHP file. I had included the line: <?php use Request; While--... August R. Garcia,

This is a bug that I ran...

Sun, 02 Dec 2018 03:48:35 -08002 years ago1
🗨 1
🐏 0
👁 336
Profile Photo - Some Guy

How to get the first 20 words from a string in Laravel?

Answers in Frameworks | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyThe function you're looking for is str_limit(). https://Laravel-news.com/str_limit https://Laravel.com/docs/5.7/helpers#method-str-limit... August R. Garcia,

The function you're l...

Sun, 02 Dec 2018 03:48:30 -08002 years ago1
🗨 1
🐏 0
👁 317
Profile Photo - Some Guy

How to get random pivot table values with Laravel seeders?

Answers in Frameworks | By Some Guy

Published | Last Update

Profile Photo - August R. Garcia

Last ReplyThe 'sync' method solves for the issue with duplicates causing errors. A piece of code similar to this is relatively concise and works for gen... August R. Garcia,

The 'sync' method...

Sun, 02 Dec 2018 03:47:58 -08002 years ago1
🗨 1
🐏 0
👁 351
Profile Photo - Some Guy

Laravel - Where to store utility functions?

Answers in Frameworks | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyIf you're writing utility functions that are used for all/many of your controlelrs, you might consider defining them in the/a parent controller&#... August R. Garcia,

If you're writing ut...

Sun, 02 Dec 2018 03:47:49 -08002 years ago1
🗨 1
🐏 0
👁 279
Profile Photo - Some Guy

Can Laravel's Faker library get random IP addresses?

Answers in Frameworks | By Some Guy

Published

Profile Photo - August R. Garcia

Last Reply~~The easiest way to get a random IP address when working with Laravel (or the Faker library in general) is to use the PHP function long2ip: long2ip(... August R. Garcia,

~~The easiest way to get...

Sun, 02 Dec 2018 03:47:14 -08002 years ago1
🗨 1
🐏 0
👁 404
Profile Photo - Some Guy

How to check the current page in Laravel?

Answers in Frameworks | By Some Guy

Published

Profile Photo - August R. Garcia

Last ReplyTo get the current path, you can use: <?php Request::path() August R. Garcia,

To get the current path,...

Sun, 02 Dec 2018 03:45:58 -08002 years ago1
🗨 1
🐏 0
👁 359