Search results

  1. Andrew

    What is PHP CS Fixer and how it can help you keep your code cleaner

    What is PHP CS Fixer PHP CS Fixer stands for PHP Coding Standards Fixer. This is a tool that fixes your code to follow standards. There are various PHP coding standards that you can follow, such as the popular PSR-1, and PSR-12 published by the PHP Framework Interoperability Group (the full list...
  2. Andrew

    What is the difference between POST and PUT?

    The difference between POST and PUT according to RFC According to RFC 2616, § 9.5, POST is used to create a resource: According to RFC 2616, § 9.6, PUT is used to create or replace a resource: Let's find out which HTTP method should be used to create a resource. Or should both be...
  3. Andrew

    What are Idempotent HTTP methods?

    Idempotent HTTP methods An idempotent HTTP method is a method that can be invoked many times without different outcomes. It does not matter whether the method was called only once or ten times. The result should always be the same. Idempotency essentially means that the result of a successfully...
  4. Andrew

    Shadow Legion Update – v2022.5

    🚀 What's new Added Open Graph and Twitter Cards images along with additional SEO tags for social sharing. * Several improvements have been made to optimize page load times. Served some assets using CDN. * Twitter Social Share preview.
  5. Andrew

    What is the difference between Design Patterns and Design Principles?

    Design Patterns Design Patterns are techniques for how to design and architect your code. They are low-level solutions related to the implementation to real-world problems that arise again and again, so instead of inventing the wheel, we follow design patterns that are well-proven, tested by...
  6. Andrew

    Shadow Legion Update – v2022.4

    This week has been more intense than usual, so the fourth version of the Shadow Legion website has only one improvement. 🚀 What's new Added the ability to view attachments/images to posts for unregistered users (guests).
  7. Andrew

    Laravel Tips and Tricks

    Laravel Tip #4 Did you know about the $ loop variable in Laravel? This is an object that contains useful information about the current iteration of the loop.
  8. Andrew

    Shadow Legion Update – v2022.3

    The third update of the Shadow Legion website took place this week. 🚀 What's new Added new forum: PHP. Added new tags: #what-is and #how-to. You can use them to view new educational threads or tutorials. Added two sticky topics that will be updated regularly: Laravel Tips and Tricks and PHP...
  9. Andrew

    Laravel Tips and Tricks

    Laravel Tip #3 Here are two ways to check the route name in Laravel. Personally, I prefer the second option using request()->routeIs($routeName).
  10. Andrew

    Laravel Tips and Tricks

    Laravel Tip #2 Here is an example of how to convert an array of paragraphs to HTML string with <p> tags. I like to use this approach when working with fake data (factories) in Laravel.
  11. Andrew

    PHP Tips and Tricks

    Like Laravel Tips and Tricks, I will post here Tips and Tricks for PHP, but less regularly. If this is something you are interested in, make sure you follow/watch this thread. PHP Tip #1 Here is an example of how to convert an array of paragraphs to HTML string with <p> tags. Personally...
  12. Andrew

    Laravel Tips and Tricks

    Starting today, I will be posting one to two Laravel refactoring tips a week. If this is what you are interested in, you can follow/watch this thread. I will also make it sticky so that it is fixed at the top of the list under the Laravel (PHP Framework) forum. Laravel Tip #1 Here is an...
  13. Andrew

    What is the difference between Unix and Linux?

    Today, Linux is in great demand. You can see its use everywhere, on servers, desktops, smartphones, and even some electrical devices such as refrigerators. Some people consider Unix and Linux as synonyms, but that is not true. Let's take a closer look. Unix Before Linux and Windows, the...
  14. Andrew

    What is the difference between Service Classes and Traits in PHP?

    Service Classes A service class is a class that performs some business logic that you want to use in various places. It is any PHP object that performs some sort of a "global" task. When code does not naturally fit into one class or another nicely then you have a candidate for a service. For...
  15. Andrew

    Shadow Legion Update – v2022.2

    The second update of the Shadow Legion website took place this week. 🚀 What's new Added new forum: XenForo (PHP-based CMS). Added new trophies for forum members. Configured rank titles for forum members. Displayed a list of followers in several parts on the website (user profile page, user...
  16. Andrew

    What are Invokable Controllers? (controllers with one specific action)

    Definition Invokable Controller is a controller that contains only one (__invoke()) method. The __invoke() method is a magic method that is called when a script tries to call an object/class as a function. Invokable controllers come in handy when you need to create a controller that does one...
  17. Andrew

    .gitignore template for XenForo

    Here is the .gitignore template for XenForo I created myself (since I could not find a good example on the Internet). Please, share if you have any ideas on how to extend or modify it. # XenForo Specific data/ internal_data/ js/swfupload/ js/vendor/ js/videojs/ js/xf/*.min.js...
  18. Andrew

    How to dump variables in XenForo templates?

    By the way, XenForo uses the same debug library as Laravel (symfony/var-dumper), a very popular package among PHP developers.
  19. Andrew

    How to dump variables in XenForo templates?

    To dump / debug a variable in XenForo templates, all you need to do is call the dump() method passing the variable as a parameter: {{ dump($variable) )}}
  20. Andrew

    How to create Cron Job using shell script?

    In this article, I will show you how to create a cron job to automate the /tmp directory clean-up process in Linux. I am going to use the script described in the previous thread about the Linux /tmp directory: find /tmp -type f \( ! -user root \) -atime +5 -delete This script finds temporary...
  21. Andrew

    What is the Linux /tmp directory?

    The Linux /tmp directory The /tmp directory in Linux-based systems contains the necessary files that the system temporarily needs, as well as other software and applications running on the machine. For example, when you are writing a document, all the contents of that document are saved as a...
  22. Andrew

    What is the difference between hasOne/hasMany and belongsTo/belongsToMany relation?

    The only difference between hasOne/hasMany and belongsTo/belongsToMany is where the foreign key column is located. hasOne and hasMany - you are telling Laravel that this table does not have the foreign key. belongsTo and belongsToMany - you are telling Laravel that this table holds the foreign...
  23. Andrew

    Suggest your ideas for forum Trophies/Achievements

    Birthday Trophy Award to members on their birthday. Likes Per Thread User has obtained 10 likes on a single thread. User has obtained 25 likes on a single thread. User has obtained 50 likes on a single thread. User has obtained 100 likes on a single thread. Trophies for "liking" other...
  24. Andrew

    Suggest your ideas for forum Trophies/Achievements

    Please share if anyone has ideas for new forum trophies. Currently, there are ones for total posts and total reactions earned, among others. You can find the list of current trophies here.
  25. Andrew

    Shadow Legion Release announcement – v2022.1

    The Shadow Legion website was successfully launched on March 17, 2022. Further updates will take place and be documented in this forum. 🚀 What's new The forum engine has been installed and configured. Redesigned the default forum template. Installed a new Inter font. Created a basic content...
Top