Coursecomp is your starting point for developing and maintaining your web application.
If you are running your Laravel app in production mode, you may want to register long running queries, which is very useful for debugging purposes: You can also sort these long queries by their duration of execution, so that the longest running ones are easier to see: Via @realstevebauman.
We now have quite a good option with the new implementation of dd() method. So, since Laravel 9.32.0 you can easily test the performance of any part of your Laravel application. Just add new “Benchmark” class and you will be able the time it takes (in milliseconds) for the certain callbacks to complete: You can […]
Since Laravel 9.32.0, you can easily see in the preview the corresponding file and the exact line which have called the dd() method. Via @laratips
If you want to use redirect to a specific section on a page, you might want to use withFragment(), so you can use the fragment of the URI: You can also utilize this method when redirecting upon form completion: Via @ecrmnn
Imagine, we need to get the name of the first admin in our web application. We can do that in two ways: The first way, using four lines of code, and if the user is not present, it will throw an error: The second way uses only 2 lines of code, and if the user […]
Laravel quick tip! URL Facade is a cool feature in Laravel that allows you to extract the current, previous, and full URLs on any given web page. See the example below: https://coursecomp.com/user/admin/ https://coursecomp.com/user/admin/?foo=bar https://coursecomp.com/news/
Python is a programming language with many features that make it well suited for scripting, automation, and data analysis. The latest version of python for Mac OS is 3.6.3. This version includes bug fixes and improvements to existing features, with the most notable change of adding an enclosure keyword and support for type annotation. You […]
In order to make your code cleaner, the best way is to use the count() function outside of the loop. See the example below: What it count() in PHP? The count() function is a built-in function in PHP that we use to count the number of elements in an array. We can also use it […]
If you want to update a timestamp column in a specific model, you can use touch method, instead of using update. This functionality has been added Since Laravel 9.25 it is now also possible to use the touch method on the query builder as well (was only possible on a model previously). But remember, touch […]
There is a beautiful filled() method in Laravel so that you can avoid unnecessary outputs in your rendering blade-templates. Here is the example: Quantity per serving Energy 1438 kJ / 338 kcal Protein 0 Fat 0 Carbohydrate 85 See the official documentation. Thnx to Daniel Eckermann.