<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vincent Tommi</title>
    <description>The latest articles on DEV Community by Vincent Tommi (@vincenttommi).</description>
    <link>https://dev.to/vincenttommi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1057211%2Fb677487b-3f87-456c-b555-669a164fba50.jpeg</url>
      <title>DEV Community: Vincent Tommi</title>
      <link>https://dev.to/vincenttommi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vincenttommi"/>
    <language>en</language>
    <item>
      <title>Fixing PostgreSQL Permission Errors in Laravel PHPUnit Tests</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Sun, 18 Oct 2026 05:52:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/fixing-postgresql-permission-errors-in-laravel-phpunit-tests-40c5</link>
      <guid>https://dev.to/vincenttommi/fixing-postgresql-permission-errors-in-laravel-phpunit-tests-40c5</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;When writing automated tests in Laravel, configuring the testing environment correctly is just as important as writing the tests themselves.&lt;/p&gt;

&lt;p&gt;While setting up a feature test for a menu-category API in my Laravel POS project, I encountered a PostgreSQL permission error that prevented Laravel from creating the &lt;code&gt;migrations&lt;/code&gt; table.&lt;/p&gt;

&lt;p&gt;The error was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SQLSTATE[42501]: Insufficient privilege: 7
ERROR: permission denied for schema public

SQL: create table "migrations" (...)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this article, I'll explain why this error occurs, how to configure a dedicated PostgreSQL test database, and how to use Laravel's &lt;code&gt;RefreshDatabase&lt;/code&gt; trait to prepare the database for automated tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Understanding the Problem
&lt;/h2&gt;

&lt;p&gt;My initial goal was to test whether the &lt;code&gt;menu_categories&lt;/code&gt; table existed.&lt;/p&gt;

&lt;p&gt;I created a feature test using Laravel's Artisan command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan make:test MenuCategoryApiTest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, when I ran the test, Laravel failed to create its migration tracking table.&lt;/p&gt;

&lt;p&gt;The root cause was PostgreSQL permissions.&lt;/p&gt;

&lt;p&gt;Even though my &lt;code&gt;samu_user&lt;/code&gt; role had access to the &lt;code&gt;samu_test&lt;/code&gt; database, the database was owned by &lt;code&gt;postgres&lt;/code&gt;. The application user did not have the necessary permissions to create tables in the &lt;code&gt;public&lt;/code&gt; schema.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why does this happen?
&lt;/h3&gt;

&lt;p&gt;PostgreSQL manages permissions at different levels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Database privileges:&lt;/strong&gt; Control access to the database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Schema privileges:&lt;/strong&gt; Control access to objects and operations within a schema.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Table privileges:&lt;/strong&gt; Control operations such as reading, inserting, updating, and deleting rows.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Granting access to a database does not automatically guarantee permission to create tables inside its schemas.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Creating a Dedicated Test Database
&lt;/h2&gt;

&lt;p&gt;Automated tests can create, modify, or roll back database structures. Therefore, I used a separate test database rather than running tests against my development database.&lt;/p&gt;

&lt;p&gt;First, I listed the available PostgreSQL databases:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; postgres psql &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My database list included:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name       | Owner
-----------+----------
postgres   | postgres
samu       | samu_user
samu_test  | postgres
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;samu_test&lt;/code&gt; database existed, but its owner was &lt;code&gt;postgres&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To avoid accidentally modifying the main &lt;code&gt;samu&lt;/code&gt; database, I kept &lt;code&gt;samu_test&lt;/code&gt; dedicated to automated testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Fixing PostgreSQL Permissions
&lt;/h2&gt;

&lt;p&gt;I changed the owner of the test database to &lt;code&gt;samu_user&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; postgres psql &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="s2"&gt;"ALTER DATABASE samu_test OWNER TO samu_user;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, I changed ownership of the &lt;code&gt;public&lt;/code&gt; schema:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; postgres psql &lt;span class="nt"&gt;-d&lt;/span&gt; samu_test &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="s2"&gt;"ALTER SCHEMA public OWNER TO samu_user;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands ensure that the application user can create the tables required by Laravel's migrations in the test database.&lt;/p&gt;

&lt;p&gt;I verified the schema permissions with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-u&lt;/span&gt; postgres psql &lt;span class="nt"&gt;-d&lt;/span&gt; samu_test &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\d&lt;/span&gt;&lt;span class="s2"&gt;n+ public"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; These commands should be run only when you intend to grant the application role ownership of the dedicated test database and schema.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Configuring PHPUnit for PostgreSQL
&lt;/h2&gt;

&lt;p&gt;Laravel reads its testing environment from PHPUnit configuration and, when applicable, a &lt;code&gt;.env.testing&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;I configured the database-related environment variables in &lt;code&gt;phpunit.xml&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;env&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"APP_ENV"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"testing"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;env&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"DB_CONNECTION"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"pgsql"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;env&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"DB_HOST"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"127.0.0.1"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;env&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"DB_PORT"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"5432"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;env&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"DB_DATABASE"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"samu_test"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;env&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"DB_USERNAME"&lt;/span&gt; &lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;"samu_user"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If PostgreSQL requires password authentication, the appropriate password must also be configured securely.&lt;/p&gt;

&lt;p&gt;The important settings are:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;APP_ENV&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Activates the testing environment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DB_CONNECTION&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Selects PostgreSQL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DB_HOST&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the database server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DB_PORT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the PostgreSQL port&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DB_DATABASE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Selects the test database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DB_USERNAME&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the PostgreSQL role&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Make sure the database name is consistent across your configuration files. In my case, the intended test database was &lt;code&gt;samu_test&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Also check &lt;code&gt;.env.testing&lt;/code&gt; for conflicting values, since Laravel may load that file when running tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Using Laravel's RefreshDatabase Trait
&lt;/h2&gt;

&lt;p&gt;Laravel provides the &lt;code&gt;RefreshDatabase&lt;/code&gt; trait to prepare the database for tests.&lt;/p&gt;

&lt;p&gt;I added it to &lt;code&gt;tests/Feature/MenuCategoryApiTest.php&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;Tests\Feature&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Foundation\Testing\RefreshDatabase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Tests\TestCase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryApiTest&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;TestCase&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;RefreshDatabase&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;test_menu_categories_table_exists&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;assertDatabaseHas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'migrations'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="s1"&gt;'migration'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
                &lt;span class="s1"&gt;'2026_09_18_034452_create_menu_categories_table'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;]);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example checks whether a particular migration is recorded in Laravel's migration history. It assumes that the migration has run and that its filename matches the value shown.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RefreshDatabase&lt;/code&gt; prepares the database using Laravel's migration and transaction mechanisms as appropriate.&lt;/p&gt;

&lt;p&gt;It is useful when tests need a predictable database state, but the test database must be configured correctly before using it.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Running the Test
&lt;/h2&gt;

&lt;p&gt;After updating the configuration and permissions, I ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan config:clear
php artisan &lt;span class="nb"&gt;test&lt;/span&gt; &lt;span class="nt"&gt;--filter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;MenuCategoryApiTest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Initially, the test failed because PostgreSQL could not create the &lt;code&gt;migrations&lt;/code&gt; table.&lt;/p&gt;

&lt;p&gt;After correcting the database and schema ownership, the test passed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PASS  Tests\Feature\MenuCategoryApiTest
✓ menu categories table exists

Tests: 1 passed
Time: 3.69s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This confirmed that Laravel could connect to the configured PostgreSQL test database and that the assertion succeeded.&lt;/p&gt;

&lt;p&gt;It did not yet prove that all menu-category API operations worked correctly. Those require additional feature tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Understanding PHP Deprecation Warnings
&lt;/h2&gt;

&lt;p&gt;Even after the test passed, PHP displayed warnings from the &lt;code&gt;nunomaduro/collision&lt;/code&gt; package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PHP Deprecated:
Implicitly marking parameter $throwable as nullable
is deprecated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These warnings were separate from the PostgreSQL permissions problem.&lt;/p&gt;

&lt;p&gt;They indicate that the installed package uses parameter declarations that newer PHP versions deprecate.&lt;/p&gt;

&lt;p&gt;To investigate compatibility, I checked the installed versions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-v&lt;/span&gt;
composer show nunomaduro/collision
composer show laravel/framework
composer show phpunit/phpunit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before upgrading dependencies, check which Collision version is compatible with the installed Laravel and PHPUnit versions.&lt;/p&gt;

&lt;p&gt;A passing test can still produce deprecation warnings, so it is worth addressing these separately.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. What Should Be Tested Next?
&lt;/h2&gt;

&lt;p&gt;Checking whether a database table exists is a useful first step, but a complete API test suite should cover application behavior.&lt;/p&gt;

&lt;p&gt;For a menu-category API, I would add the following tests:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;Expected behavior&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;List categories&lt;/td&gt;
&lt;td&gt;Returns the expected response&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Create category&lt;/td&gt;
&lt;td&gt;Saves valid data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Validate input&lt;/td&gt;
&lt;td&gt;Rejects invalid data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Show category&lt;/td&gt;
&lt;td&gt;Returns the requested category&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Update category&lt;/td&gt;
&lt;td&gt;Persists changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Delete category&lt;/td&gt;
&lt;td&gt;Removes the record&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prevent duplicates&lt;/td&gt;
&lt;td&gt;Enforces the intended uniqueness rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Validate relationships&lt;/td&gt;
&lt;td&gt;Handles warehouse and kitchen-section references correctly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Migration tests can also verify the expected columns, foreign keys, and constraints.&lt;/p&gt;

&lt;p&gt;Once the feature tests are in place, run the complete suite:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This troubleshooting experience reinforced an important lesson: automated testing depends on both application code and a correctly configured database environment.&lt;/p&gt;

&lt;p&gt;When using Laravel with PostgreSQL, remember to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a dedicated test database.&lt;/li&gt;
&lt;li&gt;Configure PHPUnit to use the correct database and user.&lt;/li&gt;
&lt;li&gt;Grant the necessary database and schema permissions.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;RefreshDatabase&lt;/code&gt; when appropriate.&lt;/li&gt;
&lt;li&gt;Separate database failures from PHP deprecation warnings.&lt;/li&gt;
&lt;li&gt;Test API behavior, not just the existence of database tables.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fixing these fundamentals makes Laravel applications easier to test, debug, and maintain.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>postgressql</category>
      <category>testing</category>
    </item>
    <item>
      <title>Understanding Key Business Stakeholders Through Software Development</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Sat, 17 Oct 2026 07:28:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/understanding-key-business-stakeholders-through-software-development-1ipp</link>
      <guid>https://dev.to/vincenttommi/understanding-key-business-stakeholders-through-software-development-1ipp</guid>
      <description>&lt;p&gt;Understanding Key Business Stakeholders Through Software Development&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connecting Business Studies with Real-World Technology&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When building software, it's easy to focus entirely on writing code, designing databases, creating APIs, and fixing bugs. However, successful software development requires more than technical skills.&lt;/p&gt;

&lt;p&gt;Every business has people and organizations that influence its operations or are affected by its decisions. These are known as &lt;strong&gt;stakeholders&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Whether you're developing a restaurant management system, an e-commerce platform, a property management application, or a financial system, understanding stakeholders helps you build software that solves real problems.&lt;/p&gt;

&lt;p&gt;In this article, we'll explore the key stakeholders in a business and how they relate to software development.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Business Stakeholders?
&lt;/h2&gt;

&lt;p&gt;Business stakeholders are individuals, groups, or organizations that have an interest in a business because they can affect it or be affected by its activities.&lt;/p&gt;

&lt;p&gt;For example, when developing an online shopping platform, stakeholders may include business owners, customers, employees, suppliers, payment providers, and competing businesses.&lt;/p&gt;

&lt;p&gt;Each stakeholder has different needs and expectations. A developer must understand these needs before designing and implementing a solution.&lt;/p&gt;

&lt;p&gt;Let's examine five important stakeholders.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Company: The Business Organization
&lt;/h2&gt;

&lt;p&gt;A company is an organization established to carry out business activities. It brings together people, equipment, buildings, technology, and other resources needed to provide goods or services.&lt;/p&gt;

&lt;p&gt;Companies range from individuals operating small businesses to large corporations operating in multiple countries.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does this relate to software development?
&lt;/h3&gt;

&lt;p&gt;Imagine a restaurant that wants to replace manual sales records with a Point of Sale (POS) system.&lt;/p&gt;

&lt;p&gt;The restaurant is the business organization that will use the software to manage its operations.&lt;/p&gt;

&lt;p&gt;The system might include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sales and order management.&lt;/li&gt;
&lt;li&gt;Inventory tracking.&lt;/li&gt;
&lt;li&gt;Menu and product management.&lt;/li&gt;
&lt;li&gt;Employee accounts and permissions.&lt;/li&gt;
&lt;li&gt;Financial reports.&lt;/li&gt;
&lt;li&gt;Customer records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The software should support the company's actual business processes rather than introduce unnecessary complexity.&lt;/p&gt;

&lt;p&gt;Before writing code, developers should understand how the company operates, what problems it faces, and what it expects the system to achieve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key takeaway:&lt;/strong&gt; The company provides the business environment in which the software operates. Understanding its processes helps developers build practical solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Owners: The People Who Invest in the Business
&lt;/h2&gt;

&lt;p&gt;Owners are the individuals or organizations that own a business and have a financial interest in its success.&lt;/p&gt;

&lt;p&gt;They may provide the initial capital needed to start the business. Entrepreneurs often develop business ideas and take risks, but they may invite other investors to contribute funding.&lt;/p&gt;

&lt;p&gt;In companies, shareholders become partial owners by purchasing shares.&lt;/p&gt;

&lt;p&gt;Owners generally want the business to remain sustainable, grow, manage risks, and generate satisfactory returns.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does this relate to software development?
&lt;/h3&gt;

&lt;p&gt;Suppose a business owner invests in developing an e-commerce platform.&lt;/p&gt;

&lt;p&gt;The owner may want the platform to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Increase sales.&lt;/li&gt;
&lt;li&gt;Reduce operational costs.&lt;/li&gt;
&lt;li&gt;Reach more customers.&lt;/li&gt;
&lt;li&gt;Protect business information.&lt;/li&gt;
&lt;li&gt;Provide useful sales reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a developer, you need to understand these business goals because they influence project requirements and priorities.&lt;/p&gt;

&lt;p&gt;For example, if the owner's main objective is to increase sales, improving the checkout process may be more valuable than adding a complicated feature that customers rarely use.&lt;/p&gt;

&lt;p&gt;However, technical decisions should balance business goals with security, reliability, accessibility, and long-term maintenance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key takeaway:&lt;/strong&gt; Owners provide resources and direction, while developers help turn business goals into working software.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Customers: The People Who Buy or Use Products and Services
&lt;/h2&gt;

&lt;p&gt;Customers are the people or organizations that purchase a business's goods or services. A group of customers served by a business is known as its market.&lt;/p&gt;

&lt;p&gt;Businesses attract customers by offering quality products, useful services, reasonable prices, and a positive customer experience.&lt;/p&gt;

&lt;p&gt;Customers can also be classified as internal or external.&lt;/p&gt;

&lt;h3&gt;
  
  
  External customers
&lt;/h3&gt;

&lt;p&gt;External customers are people or organizations outside the business who purchase or use its products and services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; A customer ordering food through a restaurant's mobile application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Internal customers
&lt;/h3&gt;

&lt;p&gt;Internal customers are employees or departments within an organization that depend on services, information, or outputs provided by other employees or departments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; A restaurant manager using sales reports generated by the cashier's POS system.&lt;/p&gt;

&lt;p&gt;The concept of internal customers reminds businesses that employees also need effective tools, information, and support to serve external customers well.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does this relate to software development?
&lt;/h3&gt;

&lt;p&gt;When developing an application, understanding customer needs is essential.&lt;/p&gt;

&lt;p&gt;For example, customers using an online shopping platform may expect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simple registration and login.&lt;/li&gt;
&lt;li&gt;Fast page loading.&lt;/li&gt;
&lt;li&gt;Secure payments.&lt;/li&gt;
&lt;li&gt;Accurate product information.&lt;/li&gt;
&lt;li&gt;Order tracking.&lt;/li&gt;
&lt;li&gt;Helpful customer support.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the application is difficult to use or unreliable, customers may abandon it and choose a competitor.&lt;/p&gt;

&lt;p&gt;Developers can gather customer requirements through interviews, surveys, feedback, usability testing, and analysis of user behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key takeaway:&lt;/strong&gt; Customer needs should guide software features, usability, and quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Collaborators: External Partners Who Help the Business Operate
&lt;/h2&gt;

&lt;p&gt;Collaborators are individuals or organizations that work with a business but are not part of its internal organization.&lt;/p&gt;

&lt;p&gt;They provide products, services, resources, expertise, or infrastructure that help the business operate effectively.&lt;/p&gt;

&lt;p&gt;Examples include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Suppliers.&lt;/li&gt;
&lt;li&gt;Banks and financial institutions.&lt;/li&gt;
&lt;li&gt;Creditors.&lt;/li&gt;
&lt;li&gt;Accounting firms.&lt;/li&gt;
&lt;li&gt;Retailers and distributors.&lt;/li&gt;
&lt;li&gt;Recruitment agencies.&lt;/li&gt;
&lt;li&gt;Technology service providers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Collaborators may also be described as business partners, alliances, or members of a business network.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does this relate to software development?
&lt;/h3&gt;

&lt;p&gt;Modern applications rarely operate entirely on their own. They often integrate with external services.&lt;/p&gt;

&lt;p&gt;Consider an e-commerce platform that relies on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A payment gateway to process transactions.&lt;/li&gt;
&lt;li&gt;A bank or financial service to support payments.&lt;/li&gt;
&lt;li&gt;A delivery company to transport orders.&lt;/li&gt;
&lt;li&gt;An email service to send order confirmations.&lt;/li&gt;
&lt;li&gt;A cloud provider to host the application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These organizations are collaborators because they help the business deliver its services.&lt;/p&gt;

&lt;p&gt;From a developer's perspective, collaboration often involves APIs, authentication credentials, data exchange, error handling, and monitoring.&lt;/p&gt;

&lt;p&gt;For example, if a payment gateway becomes unavailable, the application should handle the failure gracefully instead of incorrectly marking an order as paid.&lt;/p&gt;

&lt;p&gt;Developers should also consider data privacy, service agreements, integration costs, and dependency risks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key takeaway:&lt;/strong&gt; Collaborators extend a business's capabilities, and software integrations help different organizations work together.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Competitors: Businesses Offering Similar Products or Services
&lt;/h2&gt;

&lt;p&gt;Competitors are businesses that compete for the same customers or market opportunities.&lt;/p&gt;

&lt;p&gt;They may offer similar products, alternative solutions, or services that satisfy the same customer needs.&lt;/p&gt;

&lt;p&gt;Businesses study competitors to understand market trends, identify opportunities, improve their offerings, and develop a competitive advantage.&lt;/p&gt;

&lt;p&gt;A competitive advantage is something that allows a business to perform better than its rivals in ways that matter to customers.&lt;/p&gt;

&lt;h3&gt;
  
  
  How does this relate to software development?
&lt;/h3&gt;

&lt;p&gt;Imagine you're building a property management application for landlords and tenants.&lt;/p&gt;

&lt;p&gt;Other applications may already offer similar services. To compete effectively, your application needs to provide meaningful value.&lt;/p&gt;

&lt;p&gt;You might differentiate it through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easier property registration.&lt;/li&gt;
&lt;li&gt;Reliable rent payment tracking.&lt;/li&gt;
&lt;li&gt;Faster maintenance request handling.&lt;/li&gt;
&lt;li&gt;Better communication between landlords and tenants.&lt;/li&gt;
&lt;li&gt;Clear financial reports.&lt;/li&gt;
&lt;li&gt;Strong security and data protection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Competitor analysis can help identify missing features and weaknesses in existing solutions.&lt;/p&gt;

&lt;p&gt;However, copying competitors is not always the best strategy. A better approach is to understand customer problems and build a solution that addresses them effectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key takeaway:&lt;/strong&gt; Competitors encourage businesses to innovate, improve quality, and offer better value.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting Stakeholders to a Software Project
&lt;/h2&gt;

&lt;p&gt;Let's bring these concepts together using a restaurant management system as an example.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Stakeholder&lt;/th&gt;
&lt;th&gt;Main interest&lt;/th&gt;
&lt;th&gt;Example in the system&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Company&lt;/td&gt;
&lt;td&gt;Efficient operations&lt;/td&gt;
&lt;td&gt;Managing orders and inventory&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Owners&lt;/td&gt;
&lt;td&gt;Profitability and growth&lt;/td&gt;
&lt;td&gt;Viewing revenue and expenses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;External customers&lt;/td&gt;
&lt;td&gt;Convenient service&lt;/td&gt;
&lt;td&gt;Placing and tracking orders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Internal customers&lt;/td&gt;
&lt;td&gt;Efficient work&lt;/td&gt;
&lt;td&gt;Cashiers and kitchen staff managing orders&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Collaborators&lt;/td&gt;
&lt;td&gt;Successful service delivery&lt;/td&gt;
&lt;td&gt;Payment gateways and suppliers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Competitors&lt;/td&gt;
&lt;td&gt;Winning the same market&lt;/td&gt;
&lt;td&gt;Other restaurant POS providers&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each stakeholder has different expectations, so developers must identify and prioritize requirements carefully.&lt;/p&gt;

&lt;p&gt;For example, restaurant owners may prioritize sales reports, kitchen staff may need immediate order notifications, and customers may care most about ordering speed.&lt;/p&gt;

&lt;p&gt;A successful system must account for these different needs without compromising security or reliability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Stakeholder Analysis Matters in Software Engineering
&lt;/h2&gt;

&lt;p&gt;Stakeholder analysis is the process of identifying stakeholders, understanding their interests, and assessing how they influence a project.&lt;/p&gt;

&lt;p&gt;It is important because it helps developers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Gather accurate requirements:&lt;/strong&gt; Understand what different users actually need.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set priorities:&lt;/strong&gt; Focus on features that provide the greatest value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduce misunderstandings:&lt;/strong&gt; Clarify expectations before implementation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manage conflicts:&lt;/strong&gt; Balance competing requirements and limited resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improve adoption:&lt;/strong&gt; Build systems that fit real working practices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manage risks:&lt;/strong&gt; Identify dependencies and potential problems early.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For example, an owner might request detailed access to all system data, while an employee's role should restrict access to sensitive financial or personal information. Stakeholder analysis helps reveal these requirements so the developer can implement appropriate permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Business stakeholders are essential to understanding how an organization operates and what it needs to succeed.&lt;/p&gt;

&lt;p&gt;The company provides the organizational environment, owners invest resources, customers create demand, collaborators support operations, and competitors influence market decisions.&lt;/p&gt;

&lt;p&gt;As software developers, we should understand these relationships before building applications. The best software solutions do more than execute code correctly: they support business objectives, meet user needs, and create value for the people and organizations involved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remember: Good software development starts with understanding people and their problems, not just choosing a programming language or framework.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Discussion&lt;/p&gt;

&lt;p&gt;If you were building a restaurant management system, which stakeholder would you prioritize when gathering requirements: the business owner, the employees, or the customers? How would you balance their different needs?&lt;/p&gt;

</description>
      <category>buildinpublic</category>
      <category>beginners</category>
      <category>softwaredevelopment</category>
      <category>learning</category>
    </item>
    <item>
      <title>Understanding Business Objectives Through Software Development</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Sat, 17 Oct 2026 00:00:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/understanding-business-objectives-through-software-development-hhg</link>
      <guid>https://dev.to/vincenttommi/understanding-business-objectives-through-software-development-hhg</guid>
      <description>&lt;p&gt;&lt;strong&gt;Learning Business by Connecting Theory with Technology&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Business studies and software development may seem like two different fields, but they are closely connected. Every software application, whether it's a banking system, an e-commerce platform, or a restaurant management system, is built to solve a problem and achieve specific business objectives.&lt;/p&gt;

&lt;p&gt;As a software developer learning business concepts, I find it helpful to connect theoretical ideas with real-world software projects. In this article, we'll explore five major business objectives and see how they apply to software development.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Profitability: Building Software That Makes Money
&lt;/h2&gt;

&lt;p&gt;Profitability is one of the primary objectives of many businesses. It involves generating more revenue than the business spends on expenses.&lt;/p&gt;

&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Profit = Revenue − Expenses&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example, imagine you're developing a restaurant management system that helps restaurants manage orders, inventory, payments, and sales.&lt;/p&gt;

&lt;p&gt;You could earn revenue by charging restaurants a monthly subscription fee. However, you must also consider expenses such as hosting, domain registration, development time, maintenance, and customer support.&lt;/p&gt;

&lt;p&gt;If your software generates KSh 100,000 in monthly revenue and costs KSh 60,000 to operate, the business makes KSh 40,000 in profit.&lt;/p&gt;

&lt;p&gt;From a software engineering perspective, profitability also encourages developers to build efficient systems, reduce unnecessary infrastructure costs, and prioritize features that deliver real value to customers.&lt;/p&gt;

&lt;p&gt;Businesses may aim to maximize profit or earn a satisfactory level of profit, depending on their goals.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Survival: Keeping the Business Running
&lt;/h2&gt;

&lt;p&gt;Survival means ensuring that a business continues operating, especially during challenging economic conditions.&lt;/p&gt;

&lt;p&gt;Consider a startup that develops a property management application for landlords and tenants.&lt;/p&gt;

&lt;p&gt;Initially, the company may have only a few paying customers. If its operating costs are too high and revenue is too low, it may struggle to survive.&lt;/p&gt;

&lt;p&gt;The development team might respond by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choosing affordable cloud hosting.&lt;/li&gt;
&lt;li&gt;Fixing critical bugs before building unnecessary features.&lt;/li&gt;
&lt;li&gt;Automating repetitive business processes.&lt;/li&gt;
&lt;li&gt;Listening to customers and improving the product.&lt;/li&gt;
&lt;li&gt;Prioritizing features that customers are willing to pay for.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This demonstrates why software developers should understand the business context behind their technical decisions.&lt;/p&gt;

&lt;p&gt;A technically advanced application is not necessarily a successful business if the company cannot afford to maintain it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The lesson:&lt;/strong&gt; Build software that solves real problems while keeping its operating costs manageable.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Prestige: Building a Strong Reputation
&lt;/h2&gt;

&lt;p&gt;Prestige refers to the reputation, recognition, and respect a business earns from customers and society.&lt;/p&gt;

&lt;p&gt;In software development, reputation is strongly influenced by the quality and reliability of the products we build.&lt;/p&gt;

&lt;p&gt;For example, customers are more likely to trust an e-commerce platform that offers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A clean and user-friendly interface.&lt;/li&gt;
&lt;li&gt;Secure payment processing.&lt;/li&gt;
&lt;li&gt;Fast response times.&lt;/li&gt;
&lt;li&gt;Reliable services with minimal downtime.&lt;/li&gt;
&lt;li&gt;Good customer support.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As developers, we contribute to a company's reputation through clean code, effective testing, secure authentication, good documentation, and reliable APIs.&lt;/p&gt;

&lt;p&gt;Imagine two applications that offer the same service. One frequently crashes and exposes customer data to risk, while the other is secure, responsive, and easy to use.&lt;/p&gt;

&lt;p&gt;Even if both applications have similar features, customers are more likely to trust the reliable one.&lt;/p&gt;

&lt;p&gt;Prestige can also come from adopting modern technology, treating employees fairly, producing high-quality products, and protecting the environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The lesson:&lt;/strong&gt; Software quality is not only a technical concern; it can also influence customer trust and business reputation.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Growth: Scaling a Business Through Technology
&lt;/h2&gt;

&lt;p&gt;Growth involves expanding business operations, increasing sales, attracting more customers, and entering new markets.&lt;/p&gt;

&lt;p&gt;Software can make this expansion easier.&lt;/p&gt;

&lt;p&gt;Consider a restaurant that initially manages orders using paper receipts. As the business grows, it may introduce a point-of-sale (POS) system to manage sales, inventory, payments, and kitchen orders.&lt;/p&gt;

&lt;p&gt;Later, the restaurant may expand to several branches. A centralized system could help management monitor sales and inventory across all locations.&lt;/p&gt;

&lt;p&gt;Developers can support business growth by designing systems that are maintainable, secure, and capable of handling increased demand.&lt;/p&gt;

&lt;p&gt;Important concepts include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; The ability of a system to handle increasing workloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintainability:&lt;/strong&gt; The ease of modifying and improving software.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation:&lt;/strong&gt; Using software to reduce repetitive manual work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration:&lt;/strong&gt; Connecting different systems so they can exchange information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Economies of scale:&lt;/strong&gt; Reducing the average cost per unit as the scale of operations increases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a well-designed application may serve 100 customers initially and later support 10,000 customers with appropriate infrastructure improvements.&lt;/p&gt;

&lt;p&gt;However, growth does not happen automatically because software is scalable. The business must also attract customers, generate revenue, and manage its operations effectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The lesson:&lt;/strong&gt; Good software architecture can support business expansion, but sustainable growth also requires a viable business strategy.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Social Responsibility: Building Software That Benefits Society
&lt;/h2&gt;

&lt;p&gt;Social responsibility means that a business considers its impact on society and the environment, rather than focusing only on profit.&lt;/p&gt;

&lt;p&gt;Software developers contribute to social responsibility through the systems they design and the decisions they make.&lt;/p&gt;

&lt;p&gt;For example, a food donation platform could connect restaurants with surplus food to charities and people who need it.&lt;/p&gt;

&lt;p&gt;Such a platform could include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Restaurant registration and food listings.&lt;/li&gt;
&lt;li&gt;Donation requests and collection scheduling.&lt;/li&gt;
&lt;li&gt;Notifications for available food.&lt;/li&gt;
&lt;li&gt;Tracking of completed donations.&lt;/li&gt;
&lt;li&gt;Reports showing the amount of food redistributed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The business could operate as a nonprofit organization or use a sustainable revenue model to support its operations.&lt;/p&gt;

&lt;p&gt;Other examples of socially responsible software include accessible educational platforms, healthcare information systems, digital financial services, and applications that help communities access essential services.&lt;/p&gt;

&lt;p&gt;Developers should also consider data privacy, accessibility, cybersecurity, and the potential harm their applications could cause.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The lesson:&lt;/strong&gt; Technology can create economic value while addressing important social challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting Business Objectives to Software Engineering
&lt;/h2&gt;

&lt;p&gt;The following table summarizes how the five business objectives relate to software development.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Business objective&lt;/th&gt;
&lt;th&gt;Software development application&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Profitability&lt;/td&gt;
&lt;td&gt;Build cost-effective products that generate revenue&lt;/td&gt;
&lt;td&gt;Subscription-based SaaS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Survival&lt;/td&gt;
&lt;td&gt;Control operating costs and retain customers&lt;/td&gt;
&lt;td&gt;Optimizing cloud expenses&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prestige&lt;/td&gt;
&lt;td&gt;Deliver reliable, secure, high-quality software&lt;/td&gt;
&lt;td&gt;A trusted banking application&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Growth&lt;/td&gt;
&lt;td&gt;Design systems that support expansion&lt;/td&gt;
&lt;td&gt;Multi-branch POS software&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Social responsibility&lt;/td&gt;
&lt;td&gt;Solve social problems ethically&lt;/td&gt;
&lt;td&gt;A food donation platform&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why Software Developers Should Understand Business
&lt;/h2&gt;

&lt;p&gt;Understanding business objectives helps developers make better technical decisions.&lt;/p&gt;

&lt;p&gt;Before implementing a feature, a developer should consider questions such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What business problem does this feature solve?&lt;/li&gt;
&lt;li&gt;Who will benefit from it?&lt;/li&gt;
&lt;li&gt;Will it increase revenue, reduce costs, improve customer satisfaction, or support growth?&lt;/li&gt;
&lt;li&gt;Is it secure, maintainable, and reliable?&lt;/li&gt;
&lt;li&gt;Could it negatively affect customers or society?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These questions help bridge the gap between writing code and creating meaningful business value.&lt;/p&gt;

&lt;p&gt;For example, a developer may be asked to add a reporting feature to a POS system. Instead of simply generating a report, the developer can investigate what management needs to understand: daily sales, stock shortages, product performance, or employee productivity.&lt;/p&gt;

&lt;p&gt;That understanding leads to a solution that is more useful to the business.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Business objectives and software development are closely connected. Profitability helps businesses generate sustainable returns, survival keeps them operating, prestige builds trust, growth supports expansion, and social responsibility ensures that businesses consider their impact on society.&lt;/p&gt;

&lt;p&gt;As software developers, we should not focus exclusively on whether our code works. We should also understand why the software is being built, who it serves, and how it contributes to the organization's objectives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The goal is not simply to write code. It is to use technology to solve problems and create business value.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Discussion&lt;/p&gt;

&lt;p&gt;If you're a software developer or a student learning business studies, how do you think understanding business objectives can improve the way we design and build software applications?&lt;/p&gt;

&lt;p&gt;Share your thoughts in the comments.&lt;/p&gt;

</description>
      <category>business</category>
      <category>softwaredevelopment</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Internet Chat and Web Conferencing: Understanding Online Communication</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Fri, 16 Oct 2026 22:10:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/internet-chat-and-web-conferencing-understanding-online-communication-g7i</link>
      <guid>https://dev.to/vincenttommi/internet-chat-and-web-conferencing-understanding-online-communication-g7i</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;The Internet provides many ways for people to communicate, share information, and collaborate across different locations. Examples include email, newsgroups, mailing lists, Internet chat, and web conferencing.&lt;/p&gt;

&lt;p&gt;In this article, we will explore two important Internet communication services: &lt;strong&gt;Internet Chat&lt;/strong&gt; and &lt;strong&gt;Web Conferencing&lt;/strong&gt;. We will explain how they work, their main features, and the differences between them.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What Is Internet Chat?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Internet chat&lt;/strong&gt; is a form of online communication that allows two or more people to exchange messages in real time.&lt;/p&gt;

&lt;p&gt;It is an example of &lt;strong&gt;synchronous communication&lt;/strong&gt;, where participants communicate at the same time.&lt;/p&gt;

&lt;p&gt;Internet chat allows users from different parts of the world to discuss topics, share ideas, ask questions, and exchange information.&lt;/p&gt;

&lt;h3&gt;
  
  
  Internet Relay Chat (IRC)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Internet Relay Chat (IRC)&lt;/strong&gt; is a communication protocol that enables users to communicate through text-based chat channels.&lt;/p&gt;

&lt;p&gt;IRC provides different channels, each focusing on a particular topic. Users can join channels that match their interests and participate in discussions with other members.&lt;/p&gt;

&lt;p&gt;For example, a programming channel might allow developers to discuss programming languages, troubleshoot errors, and share technical knowledge.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features of Internet Chat
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real-time communication:&lt;/strong&gt; Users can exchange messages instantly when connected.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Topic-based discussions:&lt;/strong&gt; Chat channels can focus on specific subjects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Global participation:&lt;/strong&gt; People from different countries can communicate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Information sharing:&lt;/strong&gt; Users can exchange ideas, ask questions, and learn from others.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example of Internet Chat
&lt;/h3&gt;

&lt;p&gt;Imagine students working on an assignment. They join an online chat room to ask questions, discuss course topics, and help each other understand difficult concepts.&lt;/p&gt;

&lt;p&gt;Other examples include group chats and online messaging platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. What Is Web Conferencing?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Web conferencing&lt;/strong&gt; is the use of Internet-based tools to conduct online meetings, presentations, discussions, and training sessions.&lt;/p&gt;

&lt;p&gt;It allows people in different geographical locations to participate in the same meeting without being physically present in one room.&lt;/p&gt;

&lt;p&gt;Organizations, educational institutions, and businesses use web conferencing to improve communication and collaboration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features of Web Conferencing
&lt;/h3&gt;

&lt;p&gt;Depending on the platform, web conferencing may support:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Audio communication:&lt;/strong&gt; Participants can speak and listen to one another.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Video conferencing:&lt;/strong&gt; Participants can see one another through video.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Screen sharing:&lt;/strong&gt; A presenter can display their computer screen to others.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Online presentations:&lt;/strong&gt; Speakers can present slides and other materials.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text chat:&lt;/strong&gt; Participants can send messages during a meeting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote collaboration:&lt;/strong&gt; People can discuss projects and work together from different locations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Example of Web Conferencing
&lt;/h3&gt;

&lt;p&gt;A university lecturer conducts an online class for students who are studying remotely. The lecturer shares presentation slides, explains the lesson, answers questions, and interacts with students through audio, video, and chat.&lt;/p&gt;

&lt;p&gt;Other examples include remote job interviews, business meetings, and online training sessions.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Differences Between Internet Chat and Web Conferencing
&lt;/h2&gt;

&lt;p&gt;Although both services support online communication, their main purposes differ.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Internet Chat&lt;/th&gt;
&lt;th&gt;Web Conferencing&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Main purpose&lt;/td&gt;
&lt;td&gt;Real-time conversations&lt;/td&gt;
&lt;td&gt;Meetings, presentations, and collaboration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Communication style&lt;/td&gt;
&lt;td&gt;Often text-based&lt;/td&gt;
&lt;td&gt;Audio, video, text, and screen sharing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Participants&lt;/td&gt;
&lt;td&gt;Two or more people&lt;/td&gt;
&lt;td&gt;Two or more people&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Common use&lt;/td&gt;
&lt;td&gt;Discussions and quick questions&lt;/td&gt;
&lt;td&gt;Online classes, meetings, and training&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Example&lt;/td&gt;
&lt;td&gt;IRC chat channels&lt;/td&gt;
&lt;td&gt;Virtual meetings and online lectures&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; These services can overlap. Modern chat platforms may support audio and video calls, while web conferencing tools often include text-chat features.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Advantages of Internet Chat and Web Conferencing
&lt;/h2&gt;

&lt;p&gt;Both services offer several benefits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Global communication:&lt;/strong&gt; People can communicate regardless of their physical location.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time savings:&lt;/strong&gt; Users can communicate without travelling to meet in person.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learning opportunities:&lt;/strong&gt; Students can discuss course materials and attend online classes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration:&lt;/strong&gt; Teams can share information and work together remotely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lower communication costs:&lt;/strong&gt; Online communication can reduce travel and meeting expenses.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Internet chat and web conferencing are important Internet services that support real-time communication.&lt;/p&gt;

&lt;p&gt;Internet chat is commonly used for exchanging messages and participating in topic-based discussions, while web conferencing is mainly used for online meetings, presentations, training, and collaboration.&lt;/p&gt;

&lt;p&gt;Understanding the difference between these services helps students and professionals choose the appropriate communication method for different situations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Revision Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Internet chat:&lt;/strong&gt; Online communication that allows users to exchange messages in real time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synchronous communication:&lt;/strong&gt; Communication that happens in real time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IRC:&lt;/strong&gt; Internet Relay Chat, a protocol used for text-based communication through chat channels.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web conferencing:&lt;/strong&gt; Using Internet-based tools to conduct online meetings and presentations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Examples of web conferencing features:&lt;/strong&gt; Audio, video, screen sharing, presentations, and text chat.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main difference:&lt;/strong&gt; Chat focuses on conversations, while web conferencing focuses on meetings and collaboration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Revision tip:&lt;/strong&gt; Remember that Internet chat is commonly associated with real-time messaging, whereas web conferencing is associated with online meetings and presentations.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>computerscience</category>
      <category>networking</category>
    </item>
    <item>
      <title>Introduction to the Internet: Understanding FTP (File Transfer Protocol)</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Fri, 16 Oct 2026 11:06:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/introduction-to-the-internet-understanding-ftp-file-transfer-protocol-33aj</link>
      <guid>https://dev.to/vincenttommi/introduction-to-the-internet-understanding-ftp-file-transfer-protocol-33aj</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;The Internet provides several services that allow computers to communicate and share resources. One of these services is &lt;strong&gt;File Transfer Protocol (FTP)&lt;/strong&gt;, a standard network protocol designed to transfer files between computers over a TCP/IP network.&lt;/p&gt;

&lt;p&gt;FTP has traditionally been used to download software, share documents, distribute datasets, and transfer files between remote systems.&lt;/p&gt;

&lt;p&gt;In this article, we will explore what FTP is, how it works, its common commands, and its security limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What Is FTP?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;File Transfer Protocol (FTP)&lt;/strong&gt; is a network protocol used to transfer files between a client and a server over a TCP/IP network.&lt;/p&gt;

&lt;p&gt;An FTP client connects to an FTP server to perform permitted operations, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Downloading files from a remote server.&lt;/li&gt;
&lt;li&gt;Uploading files to a remote server.&lt;/li&gt;
&lt;li&gt;Listing files and directories.&lt;/li&gt;
&lt;li&gt;Navigating remote directories.&lt;/li&gt;
&lt;li&gt;Managing files, where the account has the necessary permissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a researcher might download a dataset from a public FTP server, or a system administrator might transfer files to a server they manage.&lt;/p&gt;

&lt;p&gt;FTP does not automatically grant unrestricted access to a remote computer. The operations a user can perform depend on the server's configuration and account permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How Does FTP Work?
&lt;/h2&gt;

&lt;p&gt;FTP uses a client-server model.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FTP client:&lt;/strong&gt; The application that initiates the connection and requests file operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FTP server:&lt;/strong&gt; The system that accepts connections and provides file-transfer services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network connection:&lt;/strong&gt; FTP traditionally uses TCP to establish reliable communication.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;FTP commonly uses two separate connections:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Control connection:&lt;/strong&gt; Carries commands and server responses. Traditionally, the server listens on TCP port 21.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data connection:&lt;/strong&gt; Carries file contents and directory listings. Its connection details depend on whether active or passive FTP is used.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This separation is an important characteristic of traditional FTP.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic FTP workflow
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The user starts an FTP client.&lt;/li&gt;
&lt;li&gt;The client connects to the FTP server.&lt;/li&gt;
&lt;li&gt;The server requests authentication, unless anonymous access or another configured method applies.&lt;/li&gt;
&lt;li&gt;The user requests a file listing, download, or upload.&lt;/li&gt;
&lt;li&gt;The server performs the permitted operation.&lt;/li&gt;
&lt;li&gt;The connection is closed when the session ends.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Types of FTP Access
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Authenticated FTP
&lt;/h3&gt;

&lt;p&gt;Authenticated FTP requires a username and usually a password. The account's permissions determine which files the user can access or modify.&lt;/p&gt;

&lt;p&gt;It is commonly associated with controlled file transfers between users and servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  B. Anonymous FTP
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anonymous FTP&lt;/strong&gt; allows users to access a server without having an individual account.&lt;/p&gt;

&lt;p&gt;A server may accept a conventional username such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;anonymous
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some servers historically accepted an email address as the password, although this is not a universal requirement.&lt;/p&gt;

&lt;p&gt;Anonymous access is generally configured to provide limited permissions, often for downloading publicly available files. It does not necessarily allow uploads or file modification.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important distinction
&lt;/h3&gt;

&lt;p&gt;Anonymous FTP does not mean that the user has unrestricted access to the server. Access depends on the permissions set by the server administrator.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Common FTP Commands
&lt;/h2&gt;

&lt;p&gt;Traditional command-line FTP clients provide commands for interacting with remote files.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ftp hostname&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Attempts to connect to an FTP server.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ls&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Lists remote files and directories.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pwd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Displays the current remote directory.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cd directory&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Changes the remote directory.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get filename&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Downloads a file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;put filename&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Uploads a file, if permitted.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;binary&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Selects binary transfer mode.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ascii&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Selects ASCII text transfer mode.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;bye&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ends the FTP session.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Example: Connecting to an FTP server
&lt;/h3&gt;

&lt;p&gt;On systems with a traditional FTP client installed, the syntax is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ftp ftp.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The hostname &lt;code&gt;ftp.example.com&lt;/code&gt; is illustrative. A real connection requires an actual server that supports FTP and permits your connection.&lt;/p&gt;

&lt;p&gt;After connecting, the client may prompt for a username and password.&lt;/p&gt;

&lt;p&gt;To download a file, you might use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get report.pdf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To end the session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bye
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Many modern operating systems do not install a command-line FTP client by default. Also, only connect to servers you own or are authorized to access.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Active FTP vs. Passive FTP
&lt;/h2&gt;

&lt;p&gt;Traditional FTP supports two common approaches to establishing its data connection.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Active FTP:&lt;/strong&gt; The client tells the server where to establish the data connection. Firewalls and network address translation (NAT) can make this difficult.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Passive FTP:&lt;/strong&gt; The client initiates the data connection to a server-provided port. This is often easier to use through client-side firewalls and NAT.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Passive FTP is widely used in modern network environments because it generally works more conveniently with typical client network configurations. However, server firewall rules must still allow the required connections.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Advantages of FTP
&lt;/h2&gt;

&lt;p&gt;Historically, FTP has been useful because it supports:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;File sharing:&lt;/strong&gt; Transfers files between connected computers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Large file transfers:&lt;/strong&gt; Moves files without relying on email attachments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Directory browsing:&lt;/strong&gt; Allows users to list and navigate remote directories when permitted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Software distribution:&lt;/strong&gt; Provides a way to distribute software and updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Research data access:&lt;/strong&gt; Enables access to datasets and other public resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch transfers:&lt;/strong&gt; Can be automated using scripts and compatible tools.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  7. Security Limitations of Traditional FTP
&lt;/h2&gt;

&lt;p&gt;Traditional FTP has an important security weakness: &lt;strong&gt;it does not encrypt usernames, passwords, commands, or file contents by default&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;On an untrusted network, someone who can monitor the traffic may be able to read sensitive information.&lt;/p&gt;

&lt;p&gt;For this reason, traditional FTP is generally unsuitable for transferring confidential information over untrusted networks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modern alternatives
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FTPS:&lt;/strong&gt; FTP secured using TLS encryption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SFTP (SSH File Transfer Protocol):&lt;/strong&gt; A separate file-transfer protocol that operates over SSH.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTPS:&lt;/strong&gt; Often used to download files securely through a web server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;FTPS and SFTP are not the same protocol. FTPS adds TLS security to FTP, while SFTP uses the SSH protocol and does not require traditional FTP's separate control and data connections.&lt;/p&gt;

&lt;p&gt;For secure server administration and file transfers, SFTP is often a practical choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;FTP is a traditional Internet protocol used to transfer files between clients and servers. It supports downloads, uploads, directory listings, and different access models, including authenticated and anonymous access.&lt;/p&gt;

&lt;p&gt;Although FTP remains relevant when studying networking fundamentals and maintaining legacy systems, its lack of encryption makes it unsuitable for many modern security-sensitive tasks. Secure alternatives such as SFTP and FTPS should be considered when protecting credentials and file contents is important.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Revision Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FTP:&lt;/strong&gt; File Transfer Protocol, used to transfer files over a network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client:&lt;/strong&gt; The application that requests file operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server:&lt;/strong&gt; The system that provides file-transfer services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TCP port 21:&lt;/strong&gt; The traditional FTP control port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anonymous FTP:&lt;/strong&gt; Allows limited access without an individual user account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Active FTP:&lt;/strong&gt; The server initiates the data connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Passive FTP:&lt;/strong&gt; The client initiates the data connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main security weakness:&lt;/strong&gt; Traditional FTP does not encrypt traffic by default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure alternatives:&lt;/strong&gt; SFTP and FTPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; FTP transfers files, but SFTP and FTPS provide secure alternatives for protecting file transfers and credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc959" rel="noopener noreferrer"&gt;RFC 959 — File Transfer Protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc4217" rel="noopener noreferrer"&gt;RFC 4217 — Securing FTP with TLS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc4253" rel="noopener noreferrer"&gt;RFC 4253 — SSH Transport Layer Protocol&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The Internet provides several services that allow computers to communicate and share resources. One of these services is &lt;strong&gt;File Transfer Protocol (FTP)&lt;/strong&gt;, a standard network protocol designed to transfer files between computers over a TCP/IP network.&lt;/p&gt;

&lt;p&gt;FTP has traditionally been used to download software, share documents, distribute datasets, and transfer files between remote systems.&lt;/p&gt;

&lt;p&gt;In this article, we will explore what FTP is, how it works, its common commands, and its security limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What Is FTP?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;File Transfer Protocol (FTP)&lt;/strong&gt; is a network protocol used to transfer files between a client and a server over a TCP/IP network.&lt;/p&gt;

&lt;p&gt;An FTP client connects to an FTP server to perform permitted operations, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Downloading files from a remote server.&lt;/li&gt;
&lt;li&gt;Uploading files to a remote server.&lt;/li&gt;
&lt;li&gt;Listing files and directories.&lt;/li&gt;
&lt;li&gt;Navigating remote directories.&lt;/li&gt;
&lt;li&gt;Managing files, where the account has the necessary permissions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a researcher might download a dataset from a public FTP server, or a system administrator might transfer files to a server they manage.&lt;/p&gt;

&lt;p&gt;FTP does not automatically grant unrestricted access to a remote computer. The operations a user can perform depend on the server's configuration and account permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. How Does FTP Work?
&lt;/h2&gt;

&lt;p&gt;FTP uses a client-server model.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FTP client:&lt;/strong&gt; The application that initiates the connection and requests file operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FTP server:&lt;/strong&gt; The system that accepts connections and provides file-transfer services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network connection:&lt;/strong&gt; FTP traditionally uses TCP to establish reliable communication.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;FTP commonly uses two separate connections:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Control connection:&lt;/strong&gt; Carries commands and server responses. Traditionally, the server listens on TCP port 21.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data connection:&lt;/strong&gt; Carries file contents and directory listings. Its connection details depend on whether active or passive FTP is used.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This separation is an important characteristic of traditional FTP.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic FTP workflow
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;The user starts an FTP client.&lt;/li&gt;
&lt;li&gt;The client connects to the FTP server.&lt;/li&gt;
&lt;li&gt;The server requests authentication, unless anonymous access or another configured method applies.&lt;/li&gt;
&lt;li&gt;The user requests a file listing, download, or upload.&lt;/li&gt;
&lt;li&gt;The server performs the permitted operation.&lt;/li&gt;
&lt;li&gt;The connection is closed when the session ends.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Types of FTP Access
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Authenticated FTP
&lt;/h3&gt;

&lt;p&gt;Authenticated FTP requires a username and usually a password. The account's permissions determine which files the user can access or modify.&lt;/p&gt;

&lt;p&gt;It is commonly associated with controlled file transfers between users and servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  B. Anonymous FTP
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Anonymous FTP&lt;/strong&gt; allows users to access a server without having an individual account.&lt;/p&gt;

&lt;p&gt;A server may accept a conventional username such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;anonymous
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some servers historically accepted an email address as the password, although this is not a universal requirement.&lt;/p&gt;

&lt;p&gt;Anonymous access is generally configured to provide limited permissions, often for downloading publicly available files. It does not necessarily allow uploads or file modification.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important distinction
&lt;/h3&gt;

&lt;p&gt;Anonymous FTP does not mean that the user has unrestricted access to the server. Access depends on the permissions set by the server administrator.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Common FTP Commands
&lt;/h2&gt;

&lt;p&gt;Traditional command-line FTP clients provide commands for interacting with remote files.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ftp hostname&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Attempts to connect to an FTP server.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ls&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Lists remote files and directories.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pwd&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Displays the current remote directory.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;cd directory&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Changes the remote directory.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;get filename&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Downloads a file.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;put filename&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Uploads a file, if permitted.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;binary&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Selects binary transfer mode.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ascii&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Selects ASCII text transfer mode.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;bye&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Ends the FTP session.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Example: Connecting to an FTP server
&lt;/h3&gt;

&lt;p&gt;On systems with a traditional FTP client installed, the syntax is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ftp ftp.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The hostname &lt;code&gt;ftp.example.com&lt;/code&gt; is illustrative. A real connection requires an actual server that supports FTP and permits your connection.&lt;/p&gt;

&lt;p&gt;After connecting, the client may prompt for a username and password.&lt;/p&gt;

&lt;p&gt;To download a file, you might use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;get report.pdf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To end the session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bye
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Many modern operating systems do not install a command-line FTP client by default. Also, only connect to servers you own or are authorized to access.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Active FTP vs. Passive FTP
&lt;/h2&gt;

&lt;p&gt;Traditional FTP supports two common approaches to establishing its data connection.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Active FTP:&lt;/strong&gt; The client tells the server where to establish the data connection. Firewalls and network address translation (NAT) can make this difficult.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Passive FTP:&lt;/strong&gt; The client initiates the data connection to a server-provided port. This is often easier to use through client-side firewalls and NAT.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Passive FTP is widely used in modern network environments because it generally works more conveniently with typical client network configurations. However, server firewall rules must still allow the required connections.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Advantages of FTP
&lt;/h2&gt;

&lt;p&gt;Historically, FTP has been useful because it supports:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;File sharing:&lt;/strong&gt; Transfers files between connected computers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Large file transfers:&lt;/strong&gt; Moves files without relying on email attachments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Directory browsing:&lt;/strong&gt; Allows users to list and navigate remote directories when permitted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Software distribution:&lt;/strong&gt; Provides a way to distribute software and updates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Research data access:&lt;/strong&gt; Enables access to datasets and other public resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch transfers:&lt;/strong&gt; Can be automated using scripts and compatible tools.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  7. Security Limitations of Traditional FTP
&lt;/h2&gt;

&lt;p&gt;Traditional FTP has an important security weakness: &lt;strong&gt;it does not encrypt usernames, passwords, commands, or file contents by default&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;On an untrusted network, someone who can monitor the traffic may be able to read sensitive information.&lt;/p&gt;

&lt;p&gt;For this reason, traditional FTP is generally unsuitable for transferring confidential information over untrusted networks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modern alternatives
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FTPS:&lt;/strong&gt; FTP secured using TLS encryption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SFTP (SSH File Transfer Protocol):&lt;/strong&gt; A separate file-transfer protocol that operates over SSH.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTPS:&lt;/strong&gt; Often used to download files securely through a web server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;FTPS and SFTP are not the same protocol. FTPS adds TLS security to FTP, while SFTP uses the SSH protocol and does not require traditional FTP's separate control and data connections.&lt;/p&gt;

&lt;p&gt;For secure server administration and file transfers, SFTP is often a practical choice.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;FTP is a traditional Internet protocol used to transfer files between clients and servers. It supports downloads, uploads, directory listings, and different access models, including authenticated and anonymous access.&lt;/p&gt;

&lt;p&gt;Although FTP remains relevant when studying networking fundamentals and maintaining legacy systems, its lack of encryption makes it unsuitable for many modern security-sensitive tasks. Secure alternatives such as SFTP and FTPS should be considered when protecting credentials and file contents is important.&lt;/p&gt;

&lt;p&gt;Quick Revision Notes&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FTP:&lt;/strong&gt; File Transfer Protocol, used to transfer files over a network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client:&lt;/strong&gt; The application that requests file operations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server:&lt;/strong&gt; The system that provides file-transfer services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TCP port 21:&lt;/strong&gt; The traditional FTP control port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anonymous FTP:&lt;/strong&gt; Allows limited access without an individual user account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Active FTP:&lt;/strong&gt; The server initiates the data connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Passive FTP:&lt;/strong&gt; The client initiates the data connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main security weakness:&lt;/strong&gt; Traditional FTP does not encrypt traffic by default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure alternatives:&lt;/strong&gt; SFTP and FTPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; FTP transfers files, but SFTP and FTPS provide secure alternatives for protecting file transfers and credentials.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc959" rel="noopener noreferrer"&gt;RFC 959 — File Transfer Protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc4217" rel="noopener noreferrer"&gt;RFC 4217 — Securing FTP with TLS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc4253" rel="noopener noreferrer"&gt;RFC 4253 — SSH Transport Layer Protocol&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>networking</category>
      <category>beginners</category>
      <category>cybersecurity</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Introduction to Internet Services: Email and the World Wide Web</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Fri, 16 Oct 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/introduction-to-internet-services-email-and-the-world-wide-web-a3d</link>
      <guid>https://dev.to/vincenttommi/introduction-to-internet-services-email-and-the-world-wide-web-a3d</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;The Internet provides various services that help people communicate, access information, share files, and conduct business worldwide.&lt;/p&gt;

&lt;p&gt;Two of the most widely used Internet services are &lt;strong&gt;Electronic Mail (Email)&lt;/strong&gt; and the &lt;strong&gt;World Wide Web (WWW)&lt;/strong&gt;. Although they both use the Internet, they serve different purposes.&lt;/p&gt;

&lt;p&gt;This article explains how email works, the structure of an email address, the features of email, and how the World Wide Web provides access to online information.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Electronic Mail (Email)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Electronic Mail (Email)&lt;/strong&gt; is an Internet service used to send and receive digital messages over a network.&lt;/p&gt;

&lt;p&gt;Email allows a user to communicate with one person or send a message to multiple recipients. Unlike traditional postal mail, email messages can usually be delivered within seconds, depending on network and server availability.&lt;/p&gt;

&lt;p&gt;One major advantage of email is that the recipient does not need to be online when the message is sent. The message can remain in the recipient's mailbox until they access it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features of Email
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;One-to-one communication:&lt;/strong&gt; Send a message to an individual.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One-to-many communication:&lt;/strong&gt; Send a message to several recipients simultaneously.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast delivery:&lt;/strong&gt; Messages are often delivered within seconds, although delays can occur.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Asynchronous communication:&lt;/strong&gt; The sender and recipient do not need to be online at the same time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Global accessibility:&lt;/strong&gt; Email can be accessed from different locations using an Internet-connected device.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost-effectiveness:&lt;/strong&gt; Email is generally inexpensive compared with traditional postal services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;24/7 availability:&lt;/strong&gt; Users can send and receive messages at any time, subject to service availability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File attachments:&lt;/strong&gt; Users can share documents, images, and other supported files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Written record:&lt;/strong&gt; Messages can be stored, searched, and retrieved later.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Components of an Email Address
&lt;/h3&gt;

&lt;p&gt;An email address identifies a mailbox where messages are delivered.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;john@hotmail.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;An email address has two main parts separated by the &lt;code&gt;@&lt;/code&gt; symbol.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local part:&lt;/strong&gt; &lt;code&gt;john&lt;/code&gt; identifies the mailbox or recipient name within the domain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Domain part:&lt;/strong&gt; &lt;code&gt;hotmail.com&lt;/code&gt; identifies the domain associated with the email service.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The domain can contain a mail server that receives and processes messages for its users.&lt;/p&gt;

&lt;h4&gt;
  
  
  Understanding the domain
&lt;/h4&gt;

&lt;p&gt;In &lt;code&gt;john@hotmail.com&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;hotmail&lt;/code&gt; is the domain label associated with the email service.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.com&lt;/code&gt; is a top-level domain (TLD), historically associated with commercial organizations but now used much more broadly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other common top-level domains include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;.org&lt;/code&gt; — traditionally associated with organizations.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.edu&lt;/code&gt; — used for eligible educational institutions, particularly in the United States.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.gov&lt;/code&gt; — used for eligible government entities, particularly in the United States.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.ke&lt;/code&gt; — Kenya's country-code top-level domain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; These domain extensions do not always reveal the exact type of organization operating a website or email service.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Does Email Work?
&lt;/h3&gt;

&lt;p&gt;Email relies on several networking protocols:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SMTP (Simple Mail Transfer Protocol):&lt;/strong&gt; Used to submit and transfer outgoing email.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IMAP (Internet Message Access Protocol):&lt;/strong&gt; Allows email clients to access and synchronize messages stored on a mail server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;POP3 (Post Office Protocol version 3):&lt;/strong&gt; Allows an email client to retrieve messages from a mail server.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A simplified email delivery process is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The sender writes an email using an email application.&lt;/li&gt;
&lt;li&gt;The application submits the message to an outgoing mail server using SMTP.&lt;/li&gt;
&lt;li&gt;The sending server uses DNS, particularly MX records, to identify the recipient domain's mail server.&lt;/li&gt;
&lt;li&gt;The message is transferred to the recipient's mail server.&lt;/li&gt;
&lt;li&gt;The recipient accesses the message through a webmail service or email application, often using IMAP or POP3.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Modern email systems commonly use encryption, such as TLS, to protect connections between clients and mail servers.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The World Wide Web (WWW)
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;World Wide Web (WWW)&lt;/strong&gt; is a system of interconnected web pages and other resources that users access over the Internet.&lt;/p&gt;

&lt;p&gt;It was proposed by Tim Berners-Lee in 1989 and made publicly available in the early 1990s.&lt;/p&gt;

&lt;p&gt;The Web makes information accessible through hyperlinks, allowing users to navigate from one page or resource to another.&lt;/p&gt;

&lt;p&gt;For example, a student can visit an educational website, follow a link to a research article, and then open another resource without knowing where the underlying servers are physically located.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of the World Wide Web
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hyperlinks:&lt;/strong&gt; Connect web pages and resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multimedia:&lt;/strong&gt; Supports text, images, audio, video, and interactive content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Global access:&lt;/strong&gt; Allows users to access publicly available resources from different locations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Graphical interface:&lt;/strong&gt; Web browsers provide an accessible way to view and interact with web content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Information sharing:&lt;/strong&gt; Supports education, research, entertainment, communication, and business.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive applications:&lt;/strong&gt; Enables services such as online banking, shopping, learning platforms, and web-based software.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Technologies Used by the Web
&lt;/h3&gt;

&lt;p&gt;The Web depends on several important technologies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML (HyperText Markup Language):&lt;/strong&gt; Defines the structure and meaning of web page content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP (Hypertext Transfer Protocol):&lt;/strong&gt; Defines how web clients and servers exchange resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTPS (HTTP Secure):&lt;/strong&gt; Uses TLS to protect HTTP communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;URL (Uniform Resource Locator):&lt;/strong&gt; Identifies the location of a resource.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web browser:&lt;/strong&gt; Software such as Firefox or Chrome that retrieves and displays web content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web server:&lt;/strong&gt; Software that receives requests and delivers web resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How Does the Web Work?
&lt;/h3&gt;

&lt;p&gt;Consider visiting &lt;code&gt;https://example.com&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You enter the URL into a web browser.&lt;/li&gt;
&lt;li&gt;DNS helps the browser resolve the domain name to an IP address.&lt;/li&gt;
&lt;li&gt;The browser establishes a connection to the server, using HTTPS to protect the communication.&lt;/li&gt;
&lt;li&gt;The browser sends an HTTP request.&lt;/li&gt;
&lt;li&gt;The server returns a response containing a web page or another resource.&lt;/li&gt;
&lt;li&gt;The browser processes the response and displays the content.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This process involves several Internet technologies working together.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Difference Between the Internet and the World Wide Web
&lt;/h2&gt;

&lt;p&gt;The Internet and the World Wide Web are related, but they are not the same thing.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Internet&lt;/th&gt;
&lt;th&gt;World Wide Web&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A global network of interconnected networks.&lt;/td&gt;
&lt;td&gt;A service that operates over the Internet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Uses networking technologies such as IP and TCP.&lt;/td&gt;
&lt;td&gt;Uses technologies such as HTTP, URLs, and HTML.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Supports email, the Web, file transfer, and other services.&lt;/td&gt;
&lt;td&gt;Provides access to linked web pages and applications.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Includes the underlying network infrastructure.&lt;/td&gt;
&lt;td&gt;Uses that infrastructure to exchange web resources.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For example, you can use an email application without opening a web browser. Email is an Internet service, but it is not itself the World Wide Web.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Email and the World Wide Web are important Internet services that support communication and information sharing.&lt;/p&gt;

&lt;p&gt;Email enables users to exchange messages and attachments, while the Web provides access to interconnected pages and interactive online applications.&lt;/p&gt;

&lt;p&gt;Understanding email addresses, SMTP, IMAP, POP3, DNS, HTTP, and HTTPS provides a useful foundation for studying computer networking and Internet technologies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Revision Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Email:&lt;/strong&gt; An Internet service for sending and receiving digital messages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Email address:&lt;/strong&gt; Identifies a mailbox using a local part and a domain, separated by &lt;code&gt;@&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SMTP:&lt;/strong&gt; Used for sending and transferring email.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IMAP:&lt;/strong&gt; Synchronizes access to messages stored on a mail server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;POP3:&lt;/strong&gt; Retrieves email from a mail server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;WWW:&lt;/strong&gt; A system of linked web pages and resources accessed over the Internet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML:&lt;/strong&gt; Structures web content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP:&lt;/strong&gt; Defines communication between web clients and servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTPS:&lt;/strong&gt; Protects HTTP communication using TLS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;URL:&lt;/strong&gt; Identifies the location of a web resource.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNS:&lt;/strong&gt; Resolves domain names to IP addresses and supports other domain-related functions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; Email is mainly used for electronic messaging, while the World Wide Web is used to access linked information and web applications.&lt;/p&gt;

&lt;p&gt;Further Reading&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.internetsociety.org/internet/history-internet/brief-history-internet/" rel="noopener noreferrer"&gt;Internet Society — A Brief History of the Internet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc5321" rel="noopener noreferrer"&gt;RFC 5321 — Simple Mail Transfer Protocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc9051" rel="noopener noreferrer"&gt;RFC 9051 — Internet Message Access Protocol (IMAP) Version 4rev2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn_web_development/Getting_started/Web_standards/How_the_web_works" rel="noopener noreferrer"&gt;MDN Web Docs — How the Web Works&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>education</category>
      <category>learning</category>
    </item>
    <item>
      <title>A Brief History of the Internet: From ARPANET to Global Connectivity</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Fri, 16 Oct 2026 07:00:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/a-brief-history-of-the-internet-from-arpanet-to-global-connectivity-4m91</link>
      <guid>https://dev.to/vincenttommi/a-brief-history-of-the-internet-from-arpanet-to-global-connectivity-4m91</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;The Internet is a global system of interconnected computer networks that communicate using standardized protocols. It enables services such as email, file sharing, online communication, cloud computing, and the World Wide Web.&lt;/p&gt;

&lt;p&gt;The Internet did not emerge overnight. It developed through decades of research, networking innovations, and collaboration between universities, governments, and private companies.&lt;/p&gt;

&lt;p&gt;This article summarizes the major milestones in the Internet's history and explains how it evolved from a research network into essential global infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The Origins of the Internet (1950s–1960s)
&lt;/h2&gt;

&lt;p&gt;In 1958, the United States established the Advanced Research Projects Agency (ARPA), later renamed DARPA, to support advanced scientific and technological research.&lt;/p&gt;

&lt;p&gt;Researchers began exploring ways for computers to communicate and share resources across networks. An important development was &lt;strong&gt;packet switching&lt;/strong&gt;, a method of dividing data into smaller units called packets for transmission across a network.&lt;/p&gt;

&lt;p&gt;In 1969, ARPANET, the precursor to the modern Internet, connected four initial sites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;University of California, Los Angeles (UCLA)&lt;/li&gt;
&lt;li&gt;University of California, Santa Barbara (UCSB)&lt;/li&gt;
&lt;li&gt;Stanford Research Institute (SRI)&lt;/li&gt;
&lt;li&gt;University of Utah&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This network demonstrated that geographically separated computers could communicate and share computing resources. &lt;a href="https://www.internetsociety.org/internet/history-internet/brief-history-internet/" rel="noopener noreferrer"&gt;Source: Internet Society&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Network Development and Email (1970s)
&lt;/h2&gt;

&lt;p&gt;During the 1970s, researchers developed networking protocols and applications to improve communication between computers.&lt;/p&gt;

&lt;p&gt;Key developments included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Electronic mail:&lt;/strong&gt; Email emerged as one of the earliest widely used network applications, with Ray Tomlinson's work in 1971 helping establish network email.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote access:&lt;/strong&gt; Users could connect to remote computers and access their resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network protocols:&lt;/strong&gt; Researchers worked on standards that would allow different computer networks to communicate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These developments demonstrated that computer networks could support communication and resource sharing, not merely connect machines.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. TCP/IP and DNS (1980s)
&lt;/h2&gt;

&lt;p&gt;The 1980s marked a major turning point in Internet development.&lt;/p&gt;

&lt;h3&gt;
  
  
  TCP/IP
&lt;/h3&gt;

&lt;p&gt;The Transmission Control Protocol/Internet Protocol (TCP/IP) suite became the foundation for communication across interconnected networks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;IP (Internet Protocol):&lt;/strong&gt; Handles packet addressing and forwarding between networks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TCP (Transmission Control Protocol):&lt;/strong&gt; Provides reliable, ordered delivery of data between applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On &lt;strong&gt;January 1, 1983&lt;/strong&gt;, ARPANET transitioned from its earlier Network Control Protocol (NCP) to TCP/IP. This milestone helped establish the technical foundation of the modern Internet.&lt;/p&gt;

&lt;h3&gt;
  
  
  Domain Name System (DNS)
&lt;/h3&gt;

&lt;p&gt;DNS was developed in the 1980s to translate human-readable domain names into IP addresses.&lt;/p&gt;

&lt;p&gt;For example, DNS allows a user to enter &lt;code&gt;example.com&lt;/code&gt; instead of having to remember a numerical IP address.&lt;/p&gt;

&lt;h3&gt;
  
  
  NSFNET
&lt;/h3&gt;

&lt;p&gt;In 1986, the United States National Science Foundation developed NSFNET to connect research institutions and support the expansion of academic networking. It became an important part of the Internet's infrastructure.&lt;/p&gt;

&lt;p&gt;Together, TCP/IP, DNS, and expanding network infrastructure made it easier to connect increasingly large numbers of computers. &lt;a href="https://www.internetsociety.org/internet/history-internet/brief-history-internet/" rel="noopener noreferrer"&gt;Source: Internet Society&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. The World Wide Web and Commercial Growth (1990s)
&lt;/h2&gt;

&lt;p&gt;The 1990s brought major improvements in how people accessed information online.&lt;/p&gt;

&lt;h3&gt;
  
  
  The World Wide Web
&lt;/h3&gt;

&lt;p&gt;In 1989, Tim Berners-Lee proposed the World Wide Web while working at CERN. The Web introduced a system of interconnected documents accessed through browsers using technologies such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HTML (HyperText Markup Language):&lt;/strong&gt; Structures web pages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP (Hypertext Transfer Protocol):&lt;/strong&gt; Enables communication between web clients and servers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;URLs (Uniform Resource Locators):&lt;/strong&gt; Identify the location of web resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web browsers:&lt;/strong&gt; Allow users to access and navigate web pages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Web became publicly accessible in the early 1990s. The Mosaic browser, released in 1993, helped make browsing more accessible by supporting graphical content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important distinction:&lt;/strong&gt; The Internet is the underlying network infrastructure, while the World Wide Web is a service that operates over it. Email and other Internet services do not depend on the Web itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Commercialization
&lt;/h3&gt;

&lt;p&gt;As Internet access expanded, businesses began using it for commercial activities, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Online shopping and electronic commerce&lt;/li&gt;
&lt;li&gt;Digital advertising and marketing&lt;/li&gt;
&lt;li&gt;Online banking&lt;/li&gt;
&lt;li&gt;Business-to-business communication&lt;/li&gt;
&lt;li&gt;Customer support and information services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In 1995, the NSFNET backbone was retired as commercial network providers increasingly supplied Internet connectivity. This marked an important stage in the transition toward a commercially operated Internet.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The Internet Today
&lt;/h2&gt;

&lt;p&gt;The Internet has evolved from a small research network into global infrastructure connecting billions of people and devices.&lt;/p&gt;

&lt;p&gt;It supports many modern technologies, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cloud computing and online storage&lt;/li&gt;
&lt;li&gt;Social media and instant messaging&lt;/li&gt;
&lt;li&gt;Video and voice communication&lt;/li&gt;
&lt;li&gt;E-commerce and digital payments&lt;/li&gt;
&lt;li&gt;Internet of Things (IoT) devices&lt;/li&gt;
&lt;li&gt;Online education and remote work&lt;/li&gt;
&lt;li&gt;Artificial intelligence services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Its continued development depends on interoperable protocols, network infrastructure, security practices, and collaboration among technical organizations, service providers, governments, and users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Milestones at a Glance
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Year&lt;/th&gt;
&lt;th&gt;Milestone&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1958&lt;/td&gt;
&lt;td&gt;ARPA established&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1969&lt;/td&gt;
&lt;td&gt;ARPANET connects four initial sites&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1971&lt;/td&gt;
&lt;td&gt;Ray Tomlinson develops network email&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1983&lt;/td&gt;
&lt;td&gt;ARPANET transitions to TCP/IP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1984&lt;/td&gt;
&lt;td&gt;DNS begins emerging as a practical naming system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1986&lt;/td&gt;
&lt;td&gt;NSFNET development begins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1989&lt;/td&gt;
&lt;td&gt;Tim Berners-Lee proposes the World Wide Web&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1991&lt;/td&gt;
&lt;td&gt;The Web becomes publicly accessible&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1993&lt;/td&gt;
&lt;td&gt;Mosaic browser helps popularize the Web&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1995&lt;/td&gt;
&lt;td&gt;NSFNET backbone is retired as commercial Internet services expand&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The Internet developed through several major stages: early networking research, the creation of ARPANET, the adoption of TCP/IP, the development of DNS, and the growth of the World Wide Web and commercial connectivity.&lt;/p&gt;

&lt;p&gt;Its success depends on &lt;strong&gt;standardized protocols and interoperability&lt;/strong&gt;, which allow different devices and networks to communicate regardless of their underlying technologies.&lt;/p&gt;

&lt;p&gt;Understanding this history provides a foundation for studying computer networks, Internet protocols, web development, and cybersecurity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Revision Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Internet:&lt;/strong&gt; A global network of interconnected networks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ARPANET:&lt;/strong&gt; An early research network and precursor to the Internet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Packet switching:&lt;/strong&gt; Dividing data into packets for transmission across a network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TCP/IP:&lt;/strong&gt; The core protocol suite used for Internet communication.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DNS:&lt;/strong&gt; Maps domain names to IP addresses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NSFNET:&lt;/strong&gt; A research and education network that helped expand Internet connectivity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;World Wide Web:&lt;/strong&gt; A system of interlinked resources accessed over the Internet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTML:&lt;/strong&gt; Structures web page content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP:&lt;/strong&gt; Defines communication for transferring Web resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commercialization:&lt;/strong&gt; The expansion of Internet services for business and public use.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; ARPANET started the journey, TCP/IP enabled interconnected networks, DNS simplified addressing, and the World Wide Web made online information easier to access.&lt;/p&gt;

&lt;p&gt;References&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.internetsociety.org/internet/history-internet/brief-history-internet/" rel="noopener noreferrer"&gt;Internet Society — A Brief History of the Internet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.internetsociety.org/internet/history-internet/short-history-of-the-internet/" rel="noopener noreferrer"&gt;Internet Society — Short History of the Internet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://home.cern/science/computing/birth-web" rel="noopener noreferrer"&gt;CERN — The Birth of the Web&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>networking</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Introduction to the Internet: Understanding Telnet for Beginners</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Fri, 16 Oct 2026 03:00:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/introduction-to-the-internet-understanding-telnet-for-beginners-51fd</link>
      <guid>https://dev.to/vincenttommi/introduction-to-the-internet-understanding-telnet-for-beginners-51fd</guid>
      <description>&lt;p&gt;Introduction&lt;/p&gt;

&lt;p&gt;The internet allows computers around the world to communicate and share resources. One important concept in computer networking is &lt;strong&gt;remote access&lt;/strong&gt;, which allows a user to connect to and interact with a computer located somewhere else.&lt;/p&gt;

&lt;p&gt;One of the older tools developed for remote access is &lt;strong&gt;Telnet&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In this article, we will explore what Telnet is, how it works, the commands used to connect to remote computers, and why modern systems generally prefer SSH.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Telnet?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Telnet&lt;/strong&gt; is a network protocol that allows a user to connect to a remote computer and execute commands through a text-based interface.&lt;/p&gt;

&lt;p&gt;A remote computer, also called a &lt;em&gt;remote host&lt;/em&gt;, is a computer that you access over a network rather than directly using its keyboard and screen.&lt;/p&gt;

&lt;p&gt;With Telnet, a user can interact with the remote system as though they were logged in locally, provided they have the necessary access permissions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;Imagine you are in Nairobi and need to access a computer located in another city. Instead of physically travelling to that computer, you could use a remote-access tool to connect over a network.&lt;/p&gt;

&lt;p&gt;Telnet was designed to provide this kind of remote terminal access.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements for Using Telnet
&lt;/h2&gt;

&lt;p&gt;To connect to a remote computer using Telnet, you generally need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Hostname or IP address:&lt;/strong&gt; Identifies the remote computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Valid user account:&lt;/strong&gt; The remote system must authorize your access.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network connectivity:&lt;/strong&gt; Your computer must be able to reach the remote host.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Telnet service:&lt;/strong&gt; The remote computer must have a Telnet service running and accessible.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Traditional Telnet access is not anonymous by default; you normally need valid credentials and permission to use the remote system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Telnet Commands
&lt;/h2&gt;

&lt;p&gt;Telnet commands specify the remote computer to which you want to connect.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Connecting Using a Hostname
&lt;/h3&gt;

&lt;p&gt;The basic syntax is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;telnet &lt;span class="nb"&gt;hostname&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;telnet math.sunysb.edu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This attempts to establish a Telnet connection to the host named &lt;code&gt;math.sunysb.edu&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The connection will only succeed if the hostname resolves, the network permits the connection, and a Telnet service is available.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Connecting Using an IP Address
&lt;/h3&gt;

&lt;p&gt;You can also specify the remote computer's IP address:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;telnet 192.0.2.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;192.0.2.10&lt;/code&gt; is an example address reserved for documentation. It is not intended to identify a real public server.&lt;/p&gt;

&lt;p&gt;The command attempts to connect to the computer at that address.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Connecting to a Specific Port
&lt;/h3&gt;

&lt;p&gt;Telnet can also specify a port number:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;telnet &lt;span class="nb"&gt;hostname &lt;/span&gt;port
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;telnet example.com 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This attempts to open a TCP connection to port 80, commonly associated with HTTP.&lt;/p&gt;

&lt;p&gt;Note that connecting to a port does not automatically mean you are logging into a computer. Telnet can also be used to test whether a TCP service is reachable, although modern diagnostic tools are often more suitable.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does Telnet Work?
&lt;/h2&gt;

&lt;p&gt;The basic process can be summarized in four steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The user enters a hostname or IP address.&lt;/li&gt;
&lt;li&gt;The computer attempts to establish a network connection with the remote host.&lt;/li&gt;
&lt;li&gt;If the service is available, the remote system may request authentication.&lt;/li&gt;
&lt;li&gt;Once authorized, the user can interact with the remote terminal.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The connection depends on network availability, service configuration, and access permissions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is Telnet Secure?
&lt;/h2&gt;

&lt;p&gt;An important limitation of traditional Telnet is that it &lt;strong&gt;does not encrypt the communication by default&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This means that usernames, passwords, and other transmitted information may be exposed to someone monitoring the network.&lt;/p&gt;

&lt;p&gt;For this reason, Telnet is generally unsuitable for logging into remote computers over untrusted networks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Telnet vs. SSH
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Telnet&lt;/th&gt;
&lt;th&gt;SSH&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Main purpose&lt;/td&gt;
&lt;td&gt;Remote terminal access&lt;/td&gt;
&lt;td&gt;Secure remote access&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Encryption&lt;/td&gt;
&lt;td&gt;No encryption by default&lt;/td&gt;
&lt;td&gt;Encrypts communication&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Credentials&lt;/td&gt;
&lt;td&gt;Can be exposed in transit&lt;/td&gt;
&lt;td&gt;Protected by encryption&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Modern use&lt;/td&gt;
&lt;td&gt;Legacy systems and limited diagnostics&lt;/td&gt;
&lt;td&gt;Standard choice for remote administration&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;SSH (Secure Shell)&lt;/strong&gt; is generally preferred for remote administration because it provides encrypted communication and supports secure authentication.&lt;/p&gt;

&lt;h2&gt;
  
  
  When Is Telnet Still Useful?
&lt;/h2&gt;

&lt;p&gt;Although Telnet is largely outdated for secure remote login, it can still be encountered in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Legacy networking environments.&lt;/li&gt;
&lt;li&gt;Networking education and demonstrations.&lt;/li&gt;
&lt;li&gt;Testing whether a TCP port is reachable.&lt;/li&gt;
&lt;li&gt;Older systems that still depend on the protocol.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only connect to systems you own or are explicitly authorized to access.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;Telnet is an older Internet protocol that allows users to connect to remote computers and interact with their command-line interfaces. To use it, you typically specify a hostname or IP address and need permission to access the remote system.&lt;/p&gt;

&lt;p&gt;The most important limitation to remember is that traditional Telnet does not encrypt its traffic. For secure remote access, SSH is the preferred modern alternative.&lt;/p&gt;

&lt;p&gt;Quick Revision Notes&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Telnet:&lt;/strong&gt; A protocol for accessing a remote computer through a text-based terminal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remote host:&lt;/strong&gt; A computer accessed over a network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hostname:&lt;/strong&gt; The name used to identify a computer on a network.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IP address:&lt;/strong&gt; A numerical network address identifying a device or interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Basic command:&lt;/strong&gt; &lt;code&gt;telnet hostname&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Main disadvantage:&lt;/strong&gt; Communication is unencrypted by default.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modern alternative:&lt;/strong&gt; SSH.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; Telnet provides remote terminal access, while SSH provides remote terminal access with encryption.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>learning</category>
      <category>beginners</category>
      <category>networking</category>
    </item>
    <item>
      <title>Fixing Laravel IDE Helper Errors: Eloquent Relationships, PHP Namespaces, and Model Annotations</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Thu, 15 Oct 2026 13:05:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/fixing-laravel-ide-helper-errors-eloquent-relationships-php-namespaces-and-model-annotations-23ha</link>
      <guid>https://dev.to/vincenttommi/fixing-laravel-ide-helper-errors-eloquent-relationships-php-namespaces-and-model-annotations-23ha</guid>
      <description>&lt;p&gt;When working on a Laravel project, your code can work in some places while your IDE still reports errors about model relationships, return types, or missing methods.&lt;/p&gt;

&lt;p&gt;Recently, I encountered this situation while configuring &lt;strong&gt;Laravel IDE Helper&lt;/strong&gt; in a project. The goal was to generate model annotations for better autocomplete, improve code navigation, and help the IDE understand Eloquent relationships.&lt;/p&gt;

&lt;p&gt;However, the process revealed several issues involving incorrect imports, class capitalization, relationship return types, and model references.&lt;/p&gt;

&lt;p&gt;In this article, we'll walk through the problems, their solutions, and the lessons beginners can learn from them.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is Laravel IDE Helper?
&lt;/h2&gt;

&lt;p&gt;Laravel IDE Helper is a development package that generates PHPDoc annotations to help IDEs such as PhpStorm and VS Code understand Laravel's dynamic features.&lt;/p&gt;

&lt;p&gt;Laravel's Eloquent ORM allows us to write code like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$warehouse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Warehouse&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nv"&gt;$products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$warehouse&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although this is valid Laravel code, an IDE may not always know which properties, methods, or relationship types are available on the model.&lt;/p&gt;

&lt;p&gt;IDE Helper generates documentation that helps the editor recognize those relationships and methods.&lt;/p&gt;

&lt;p&gt;Install it in a Laravel project with Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require &lt;span class="nt"&gt;--dev&lt;/span&gt; barryvdh/laravel-ide-helper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate general helper documentation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan ide-helper:generate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate model annotations:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan ide-helper:models
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more information, see the &lt;a href="https://github.com/barryvdh/laravel-ide-helper" rel="noopener noreferrer"&gt;Laravel IDE Helper repository&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Problem One: Incorrect Eloquent Relationship Imports
&lt;/h2&gt;

&lt;p&gt;One of the errors reported during model generation was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Return value must be of type App\Models\HasMany,
Illuminate\Database\Eloquent\Relations\HasMany returned
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A similar error occurred for &lt;code&gt;BelongsTo&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why did this happen?
&lt;/h3&gt;

&lt;p&gt;PHP uses namespaces to identify classes. When a class name is used without an import or fully qualified namespace, PHP attempts to resolve it according to the current namespace and other applicable rules.&lt;/p&gt;

&lt;p&gt;For example, consider this model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Models&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Model&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Relations\BelongsTo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;KitchenSection&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;warehouse&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;BelongsTo&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;belongsTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Warehouse&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;menuItems&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;HasMany&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hasMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MenuItem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;BelongsTo&lt;/code&gt; type is imported, but &lt;code&gt;HasMany&lt;/code&gt; is not.&lt;/p&gt;

&lt;p&gt;Because the model is inside the &lt;code&gt;App\Models&lt;/code&gt; namespace, PHP may try to resolve &lt;code&gt;HasMany&lt;/code&gt; as &lt;code&gt;App\Models\HasMany&lt;/code&gt;. Laravel actually returns an instance of &lt;code&gt;Illuminate\Database\Eloquent\Relations\HasMany&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The declared return type and the actual returned object therefore do not match.&lt;/p&gt;

&lt;h3&gt;
  
  
  The solution
&lt;/h3&gt;

&lt;p&gt;Import both relationship types:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Relations\BelongsTo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Relations\HasMany&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the complete relationship definitions are valid:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;warehouse&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;BelongsTo&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;belongsTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Warehouse&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;menuItems&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;HasMany&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hasMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MenuItem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Beginner lesson:&lt;/strong&gt; Whenever you add a return type to an Eloquent relationship, import the correct class from &lt;code&gt;Illuminate\Database\Eloquent\Relations&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Common relationship types include:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Relationship&lt;/th&gt;
&lt;th&gt;Return type&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One-to-one&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HasOne&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One-to-many&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HasMany&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inverse one-to-one or one-to-many&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BelongsTo&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Many-to-many&lt;/td&gt;
&lt;td&gt;&lt;code&gt;BelongsToMany&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Polymorphic one-to-one&lt;/td&gt;
&lt;td&gt;&lt;code&gt;MorphOne&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Polymorphic one-to-many&lt;/td&gt;
&lt;td&gt;&lt;code&gt;MorphMany&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  3. Problem Two: Incorrect Model Class Names and Capitalization
&lt;/h2&gt;

&lt;p&gt;Another issue involved relationship references such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hasMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;menuItem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The actual model class was named &lt;code&gt;MenuItem&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On a case-sensitive filesystem, capitalization matters. This is especially important when developing on Linux.&lt;/p&gt;

&lt;h3&gt;
  
  
  Incorrect
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hasMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;menuItem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Correct
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hasMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;MenuItem&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same principle applies to other models:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;Warehouse&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kd"&gt;class&lt;/span&gt;
&lt;span class="nc"&gt;ModifierGroup&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kd"&gt;class&lt;/span&gt;
&lt;span class="nc"&gt;BillPrint&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kd"&gt;class&lt;/span&gt;
&lt;span class="nc"&gt;DiningArea&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kd"&gt;class&lt;/span&gt;
&lt;span class="nc"&gt;IngredientStockMovement&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="kd"&gt;class&lt;/span&gt;
&lt;span class="nc"&gt;MenuItemVariation&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Always use the exact class name defined by the model.&lt;/p&gt;

&lt;p&gt;For example, if your file is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app/Models/MenuItem.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The class declaration should normally be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Models&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MenuItem&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Model&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Laravel's PSR-4 autoloading depends on correctly mapping namespaces and class names to files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginner lesson:&lt;/strong&gt; A model reference can look correct in your editor but fail during runtime or automated tooling because of incorrect capitalization.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Problem Three: Fixing the Modifier Relationship
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;Modifier&lt;/code&gt; model exposed another version of the missing-import problem.&lt;/p&gt;

&lt;p&gt;The original relationship looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;modifierGroup&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;BelongsTo&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;belongsTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;modifierGroup&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two improvements were necessary:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Import Laravel's &lt;code&gt;BelongsTo&lt;/code&gt; relationship type.&lt;/li&gt;
&lt;li&gt;Use the correct model class name, &lt;code&gt;ModifierGroup::class&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The corrected relationship was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Relations\BelongsTo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;modifierGroup&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;BelongsTo&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;belongsTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nc"&gt;ModifierGroup&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s1"&gt;'modifier_groups_id'&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The foreign-key argument is important here.&lt;/p&gt;

&lt;p&gt;By convention, Laravel would normally look for &lt;code&gt;modifier_group_id&lt;/code&gt;. The explicit argument tells Laravel to use &lt;code&gt;modifier_groups_id&lt;/code&gt; instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Use the explicit foreign-key name only if that column really exists in your database.&lt;/p&gt;

&lt;p&gt;You can inspect your migration files or database schema to verify the column.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Understanding Laravel Relationship Conventions
&lt;/h2&gt;

&lt;p&gt;Eloquent relationships describe how database records are connected.&lt;/p&gt;

&lt;p&gt;Consider a warehouse that has multiple products:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Warehouse.php&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Relations\HasMany&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;HasMany&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;hasMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Product&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the inverse relationship:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Product.php&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Relations\BelongsTo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;warehouse&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;BelongsTo&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;belongsTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Warehouse&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Laravel will normally expect a &lt;code&gt;warehouse_id&lt;/code&gt; foreign key in the &lt;code&gt;products&lt;/code&gt; table.&lt;/p&gt;

&lt;p&gt;The relationships allow queries such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$warehouse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Warehouse&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;findOrFail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Get the related products.&lt;/span&gt;
&lt;span class="nv"&gt;$products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$warehouse&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;products&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Get the warehouse associated with a product.&lt;/span&gt;
&lt;span class="nv"&gt;$product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Product&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;findOrFail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$warehouse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;warehouse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice the distinction between &lt;code&gt;$warehouse-&amp;gt;products()&lt;/code&gt; and &lt;code&gt;$warehouse-&amp;gt;products&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;products()&lt;/code&gt; returns a relationship object, which can be used to build queries.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;products&lt;/code&gt; accesses the relationship as a property and retrieves the related records, using Eloquent's relationship loading behavior.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding this difference helps when debugging relationship return types and IDE warnings.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Generating IDE Helper Model Annotations
&lt;/h2&gt;

&lt;p&gt;After correcting the relationship definitions, I regenerated the helper documentation.&lt;/p&gt;

&lt;p&gt;First, rebuild Composer's autoloader:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer dump-autoload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then generate the general helper file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan ide-helper:generate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To generate model annotations and add mixins to the models:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan ide-helper:models &lt;span class="nt"&gt;-M&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-M&lt;/code&gt; option tells IDE Helper to use mixins, helping IDEs recognize the generated model documentation without duplicating every generated method declaration directly in each model.&lt;/p&gt;

&lt;p&gt;This generates or updates:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_ide_helper.php
_ide_helper_models.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The files serve different purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;_ide_helper.php&lt;/code&gt; provides helper documentation for Laravel's dynamic features.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;_ide_helper_models.php&lt;/code&gt; contains generated model annotations, including properties, relationships, and query methods.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a generated Warehouse annotation may contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;property&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt; &lt;span class="nc"&gt;\Illuminate\Database\Eloquent\Collection&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;\App\Models\Product&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$products&lt;/span&gt;
&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;property&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt; &lt;span class="nc"&gt;\Illuminate\Database\Eloquent\Collection&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;\App\Models\Sale&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$sales&lt;/span&gt;
&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;method&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;\Illuminate\Database\Eloquent\Builder&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="nc"&gt;Warehouse&lt;/span&gt; &lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These annotations help the IDE understand model behavior without changing the actual database schema.&lt;/p&gt;

&lt;p&gt;The generated documentation is for development assistance; it does not create new Eloquent relationships or replace the real relationship methods.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Verifying That the Fix Worked
&lt;/h2&gt;

&lt;p&gt;Generating a file is not enough. We should check whether the errors have actually disappeared.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Rebuild the autoloader
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer dump-autoload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Regenerate model documentation without writing annotations into model files
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan ide-helper:models &lt;span class="nt"&gt;-N&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; &lt;span class="s1"&gt;'app/Models/*'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-N&lt;/code&gt; prevents writing the generated annotations directly into model files.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-D&lt;/code&gt; specifies the model directory or file pattern to process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is useful when you want to test generation without making additional changes to each model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Check Git for whitespace errors
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git diff &lt;span class="nt"&gt;--check&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If this command produces no output, Git has not found whitespace errors in the changes it checks.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Review the changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status &lt;span class="nt"&gt;--short&lt;/span&gt;
git diff &lt;span class="nt"&gt;--stat&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Review the modified models and generated helper files before committing.&lt;/p&gt;

&lt;p&gt;A successful verification should include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No unresolved relationship model errors.&lt;/li&gt;
&lt;li&gt;No incorrect relationship return types.&lt;/li&gt;
&lt;li&gt;Correct model class names and capitalization.&lt;/li&gt;
&lt;li&gt;Generated helper documentation.&lt;/li&gt;
&lt;li&gt;No reported whitespace errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  8. Common Mistakes to Avoid
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Mistake 1: Importing the wrong class
&lt;/h3&gt;

&lt;p&gt;Incorrect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\HasMany&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Correct:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Database\Eloquent\Relations\HasMany&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Mistake 2: Ignoring Linux capitalization rules
&lt;/h3&gt;

&lt;p&gt;Incorrect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;Modifiergroup&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Correct:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;ModifierGroup&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the actual class name, not a guessed variation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 3: Assuming IDE Helper creates relationships
&lt;/h3&gt;

&lt;p&gt;IDE Helper documents model behavior for your IDE. You must still define valid Eloquent relationship methods in your models.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 4: Changing a foreign key without checking the database
&lt;/h3&gt;

&lt;p&gt;Laravel conventions are useful, but existing projects sometimes use custom column names. Confirm the schema before modifying a relationship's foreign-key argument.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake 5: Committing every generated change without reviewing it
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;-M&lt;/code&gt; command can modify many model files. Always inspect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status &lt;span class="nt"&gt;--short&lt;/span&gt;
git diff &lt;span class="nt"&gt;--check&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure temporary backups and unrelated changes are not included in the commit.&lt;/p&gt;

&lt;h2&gt;
  
  
  9. Final Checklist for Laravel Developers
&lt;/h2&gt;

&lt;p&gt;Before considering an Eloquent relationship complete, verify the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; The related model exists.&lt;/li&gt;
&lt;li&gt; The model class name uses the correct capitalization.&lt;/li&gt;
&lt;li&gt;The relationship method uses the correct return type.&lt;/li&gt;
&lt;li&gt;The return type imports the correct Laravel relationship class.&lt;/li&gt;
&lt;li&gt; Any custom foreign key matches the database schema.&lt;/li&gt;
&lt;li&gt; IDE Helper can resolve the relationship.&lt;/li&gt;
&lt;li&gt; Git changes have been reviewed before committing.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Debugging Laravel IDE Helper errors taught me an important lesson: &lt;strong&gt;understanding PHP namespaces and Eloquent relationship types is just as important as knowing Laravel's syntax.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A missing import, incorrect class capitalization, or mismatched relationship return type can prevent IDE Helper from generating complete model documentation.&lt;/p&gt;

&lt;p&gt;The best approach is to verify the model class, check the imports, confirm the database relationship, regenerate the documentation, and inspect the results.&lt;/p&gt;

&lt;p&gt;Once these fundamentals become familiar, debugging Eloquent relationships becomes much easier—and your code becomes clearer for both your IDE and other developers.&lt;/p&gt;

&lt;p&gt;If you are learning Laravel, try applying these checks to a model in your own project. They are small habits that can prevent hours of debugging later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Useful resources:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://laravel.com/docs/eloquent-relationships" rel="noopener noreferrer"&gt;Laravel Eloquent Relationships&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/barryvdh/laravel-ide-helper" rel="noopener noreferrer"&gt;Laravel IDE Helper&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.php.net/manual/en/language.namespaces.php" rel="noopener noreferrer"&gt;PHP Namespaces&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.php-fig.org/psr/psr-4/" rel="noopener noreferrer"&gt;PSR-4 Autoloading Standard&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Understanding the PostgreSQL Error: `SQLSTATE[42P01]`</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Thu, 15 Oct 2026 11:15:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/understanding-the-postgresql-error-sqlstate42p01-j9e</link>
      <guid>https://dev.to/vincenttommi/understanding-the-postgresql-error-sqlstate42p01-j9e</guid>
      <description>&lt;p&gt;When I ran &lt;code&gt;php artisan migrate:fresh&lt;/code&gt;, Laravel failed while creating the &lt;code&gt;menu_categories&lt;/code&gt; table.&lt;/p&gt;

&lt;p&gt;The error was:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SQLSTATE[42P01]: Undefined table:
ERROR: relation "kitchen_sections" does not exist
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What does this error mean?
&lt;/h3&gt;

&lt;p&gt;PostgreSQL uses the word &lt;em&gt;relation&lt;/em&gt; to refer to database objects such as tables. In this case, PostgreSQL could not find the &lt;code&gt;kitchen_sections&lt;/code&gt; table that my migration referenced.&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;menu_categories&lt;/code&gt; migration contained:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;foreignId&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'kitchen_section_id'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;nullable&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;constrained&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'kitchen_sections'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;nullOnDelete&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code tells Laravel to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a &lt;code&gt;kitchen_section_id&lt;/code&gt; foreign-key column.&lt;/li&gt;
&lt;li&gt;Reference the &lt;code&gt;id&lt;/code&gt; column in the &lt;code&gt;kitchen_sections&lt;/code&gt; table.&lt;/li&gt;
&lt;li&gt;Allow the foreign key to be &lt;code&gt;NULL&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;kitchen_section_id&lt;/code&gt; to &lt;code&gt;NULL&lt;/code&gt; if its referenced kitchen section is deleted.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The relationship itself was valid. The problem was that Laravel attempted to create it before the referenced table existed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why did Laravel run the migration in the wrong order?
&lt;/h3&gt;

&lt;p&gt;My migration files were initially named:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026_09_18_034452_create_menu_categories_table.php
2026_09_22_040308_create_kitchen_sections_table.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Laravel executes migrations in timestamp order. Since the &lt;code&gt;menu_categories&lt;/code&gt; migration had an earlier timestamp, it ran first.&lt;/p&gt;

&lt;p&gt;However, &lt;code&gt;menu_categories&lt;/code&gt; depended on &lt;code&gt;kitchen_sections&lt;/code&gt;, creating a dependency conflict.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I fixed it
&lt;/h3&gt;

&lt;p&gt;I renamed the kitchen-sections migration so that it would run before the menu-categories migration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026_09_18_030000_create_kitchen_sections_table.php
2026_09_18_034452_create_menu_categories_table.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also removed an empty, unused migration file that was named &lt;code&gt;recreate_menu_categories_table&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After correcting the migration order, I ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan migrate:fresh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The migrations completed successfully.&lt;/p&gt;

&lt;p&gt;The main lesson&lt;/p&gt;

&lt;p&gt;A foreign key requires its referenced table and column to exist before the constraint can be created. In Laravel, migration timestamps determine the execution order, so dependent tables must be created first.&lt;/p&gt;

&lt;p&gt;When troubleshooting &lt;code&gt;SQLSTATE[42P01]&lt;/code&gt;, check whether the referenced table exists, whether its migration has run, and whether the migration files are ordered correctly.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>beginners</category>
      <category>learning</category>
      <category>programming</category>
    </item>
    <item>
      <title>Refactoring a Laravel API Controller to Reuse AppBaseController Response Helpers</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Thu, 15 Oct 2026 06:00:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/refactoring-a-laravel-api-controller-to-reuse-appbasecontroller-response-helpers-1d3</link>
      <guid>https://dev.to/vincenttommi/refactoring-a-laravel-api-controller-to-reuse-appbasecontroller-response-helpers-1d3</guid>
      <description>&lt;h1&gt;
  
  
  Refactoring a Laravel API Controller to Reuse AppBaseController Response Helpers
&lt;/h1&gt;

&lt;p&gt;When building APIs in Laravel, it's easy to create a controller that works correctly but doesn't follow the response conventions already established in a project.&lt;/p&gt;

&lt;p&gt;I recently worked on a &lt;code&gt;MenuCategoryController&lt;/code&gt; that handled CRUD operations, pagination, validation, and deletion checks. However, it returned custom JSON responses instead of following the existing &lt;code&gt;AppBaseController&lt;/code&gt; pattern used by other controllers in the application.&lt;/p&gt;

&lt;p&gt;In this article, I'll explain how to refactor a Laravel API controller to reuse shared response helpers while preserving resource-based responses and proper HTTP status codes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: Inconsistent API Responses
&lt;/h2&gt;

&lt;p&gt;My original controller extended Laravel's default &lt;code&gt;Controller&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Controllers\Controller&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// CRUD methods...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some methods returned manually constructed JSON responses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="s1"&gt;'success'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'Menu Category created successfully.'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'data'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$category&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although this works, manually constructing response bodies in multiple controllers can introduce inconsistencies.&lt;/p&gt;

&lt;p&gt;For example, one controller might return a &lt;code&gt;success&lt;/code&gt; field, while another uses a shared response utility. Over time, this makes the API harder to maintain and its responses less predictable for frontend developers.&lt;/p&gt;

&lt;p&gt;The project already had an &lt;code&gt;AppBaseController&lt;/code&gt; with reusable response methods, so the better approach was to reuse the existing architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Understand the Existing AppBaseController
&lt;/h2&gt;

&lt;p&gt;The existing base controller provides three response helpers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AppBaseController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Controller&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;sendResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;JsonResponse&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nc"&gt;ResponseUtil&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;makeResponse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;sendError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;422&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;JsonResponse&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nc"&gt;ResponseUtil&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;makeError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$error&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="nv"&gt;$code&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;sendSuccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;JsonResponse&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="s1"&gt;'success'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="s1"&gt;'message'&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nv"&gt;$message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each method serves a different purpose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;sendResponse()&lt;/code&gt; returns a successful response using the project's &lt;code&gt;ResponseUtil&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sendError()&lt;/code&gt; returns an error response with a configurable HTTP status code.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sendSuccess()&lt;/code&gt; returns a simple success message.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These helpers establish shared response conventions and reduce duplicated response-handling code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; &lt;code&gt;sendResponse()&lt;/code&gt; and &lt;code&gt;sendSuccess()&lt;/code&gt; do not return identical JSON structures. Always inspect &lt;code&gt;ResponseUtil::makeResponse()&lt;/code&gt; and &lt;code&gt;ResponseUtil::makeError()&lt;/code&gt; before assuming their exact output format.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Extend AppBaseController
&lt;/h2&gt;

&lt;p&gt;The first change is to replace the default controller import:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Controllers\Controller&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Controllers\AppBaseController&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then update the class declaration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;AppBaseController&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// CRUD methods...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The controller can now access the shared response helpers without redefining them.&lt;/p&gt;

&lt;p&gt;This is a simple example of code reuse and inheritance in PHP: common behavior belongs in a shared parent class, while the child controller focuses on its resource-specific business logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Implement the CRUD Operations
&lt;/h2&gt;

&lt;p&gt;Below is the refactored controller.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;

&lt;span class="kn"&gt;namespace&lt;/span&gt; &lt;span class="nn"&gt;App\Http\Controllers\API&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Controllers\AppBaseController&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Requests\StoreMenuCategoryRequest&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Requests\UpdateMenuCategoryRequest&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Resources\MenuCategoryResource&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Models\MenuCategory&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Http\JsonResponse&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Http\Resources\Json\AnonymousResourceCollection&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryController&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;AppBaseController&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="cd"&gt;/**
     * Display a paginated listing of menu categories.
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="kt"&gt;AnonymousResourceCollection&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$categories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MenuCategory&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;orderBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sort_order'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;orderBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;paginate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryResource&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$categories&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cd"&gt;/**
     * Store a newly created menu category.
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="kt"&gt;StoreMenuCategoryRequest&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;
    &lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;JsonResponse&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$category&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MenuCategory&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validated&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$category&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
            &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cd"&gt;/**
     * Display the specified menu category.
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="kt"&gt;MenuCategory&lt;/span&gt; &lt;span class="nv"&gt;$menuCategory&lt;/span&gt;
    &lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;MenuCategoryResource&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cd"&gt;/**
     * Update the specified menu category.
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="kt"&gt;UpdateMenuCategoryRequest&lt;/span&gt; &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="kt"&gt;MenuCategory&lt;/span&gt; &lt;span class="nv"&gt;$menuCategory&lt;/span&gt;
    &lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;MenuCategoryResource&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validated&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;refresh&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="cd"&gt;/**
     * Remove the specified menu category.
     */&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;destroy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="kt"&gt;MenuCategory&lt;/span&gt; &lt;span class="nv"&gt;$menuCategory&lt;/span&gt;
    &lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;JsonResponse&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;menuItems&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;sendError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="s1"&gt;'Menu category cannot be deleted because it has menu items.'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="mi"&gt;409&lt;/span&gt;
            &lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;sendSuccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s1"&gt;'Menu category deleted successfully.'&lt;/span&gt;
        &lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's examine the important decisions.&lt;/p&gt;

&lt;h3&gt;
  
  
  A. Paginated listing
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$categories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MenuCategory&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;orderBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sort_order'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;orderBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'name'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;paginate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryResource&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$categories&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pagination prevents the API from returning every category in a single request. This becomes increasingly important as the database grows.&lt;/p&gt;

&lt;p&gt;Ordering by &lt;code&gt;sort_order&lt;/code&gt; and then &lt;code&gt;name&lt;/code&gt; also provides predictable category ordering.&lt;/p&gt;

&lt;p&gt;Laravel's resource collection preserves pagination metadata, although the precise JSON envelope depends on the resource configuration and Laravel version.&lt;/p&gt;

&lt;h3&gt;
  
  
  B. Validated input when creating a category
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$category&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MenuCategory&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validated&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;StoreMenuCategoryRequest&lt;/code&gt; handles validation before the controller method executes.&lt;/p&gt;

&lt;p&gt;Using &lt;code&gt;validated()&lt;/code&gt; means the controller receives only fields accepted by the request's validation rules, rather than blindly accepting every submitted field.&lt;/p&gt;

&lt;p&gt;The model must still have the appropriate mass-assignment configuration, and authorization rules should be applied where required.&lt;/p&gt;

&lt;p&gt;The response uses HTTP &lt;code&gt;201 Created&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$category&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;response&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;setStatusCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This communicates that a new resource was successfully created.&lt;/p&gt;

&lt;h3&gt;
  
  
  C. Retrieving a single category
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="kt"&gt;MenuCategory&lt;/span&gt; &lt;span class="nv"&gt;$menuCategory&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kt"&gt;MenuCategoryResource&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Laravel's implicit route model binding resolves the category from the route parameter.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /api/menu-categories/5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Laravel attempts to resolve the category with ID &lt;code&gt;5&lt;/code&gt;. If it cannot find the model, the framework normally returns a &lt;code&gt;404 Not Found&lt;/code&gt; response.&lt;/p&gt;

&lt;p&gt;Returning a resource also keeps the category's JSON representation under the control of &lt;code&gt;MenuCategoryResource&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  D. Updating a category
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;validated&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;MenuCategoryResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;refresh&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The update request validates the incoming fields before the model is changed.&lt;/p&gt;

&lt;p&gt;Calling &lt;code&gt;refresh()&lt;/code&gt; reloads the model's current database values before constructing the response. This can be useful when the database applies defaults or other changes during persistence.&lt;/p&gt;

&lt;h3&gt;
  
  
  E. Preventing deletion of categories with menu items
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;menuItems&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;exists&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;sendError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s1"&gt;'Menu category cannot be deleted because it has menu items.'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="mi"&gt;409&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deleting a category that still has associated menu items could break application behavior or violate database constraints.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;exists()&lt;/code&gt; query checks whether any related records exist without loading the entire relationship collection into memory.&lt;/p&gt;

&lt;p&gt;HTTP &lt;code&gt;409 Conflict&lt;/code&gt; is appropriate when the requested deletion conflicts with the current state of the resource.&lt;/p&gt;

&lt;p&gt;After the deletion check passes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$menuCategory&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;sendSuccess&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'Menu category deleted successfully.'&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The controller reuses the shared success helper instead of constructing another custom JSON response.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Understand Where Resources and Shared Helpers Fit
&lt;/h2&gt;

&lt;p&gt;A useful distinction is that &lt;strong&gt;resource formatting and shared response helpers solve related but different problems&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Component&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AppBaseController&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shared response helper methods&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MenuCategoryController&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Handles CRUD workflow and business rules&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;StoreMenuCategoryRequest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Validates creation input&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UpdateMenuCategoryRequest&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Validates update input&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MenuCategoryResource&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Controls how a category is represented in JSON&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;MenuCategory&lt;/code&gt; model&lt;/td&gt;
&lt;td&gt;Represents the database entity and relationships&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In this implementation, the listing, creation, retrieval, and update methods return Laravel resources directly, while deletion uses the shared &lt;code&gt;sendSuccess()&lt;/code&gt; and &lt;code&gt;sendError()&lt;/code&gt; helpers.&lt;/p&gt;

&lt;p&gt;That matches the resource-oriented style used by the existing &lt;code&gt;RoleAPIController&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;However, if the project requires every successful endpoint to use &lt;code&gt;ResponseUtil::makeResponse()&lt;/code&gt;, then the resource-returning methods should also be adapted to that convention. Before doing so, check whether the existing API expects Laravel's standard resource envelope or the custom envelope defined by &lt;code&gt;ResponseUtil&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Consistency means following the actual project contract, not simply using the same method everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Register the CRUD Routes
&lt;/h2&gt;

&lt;p&gt;Laravel can register the standard API resource routes with one declaration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;App\Http\Controllers\API\MenuCategoryController&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;use&lt;/span&gt; &lt;span class="nc"&gt;Illuminate\Support\Facades\Route&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nc"&gt;Route&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;apiResource&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'menu-categories'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nc"&gt;MenuCategoryController&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;class&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This generates the five standard API operations:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;HTTP method&lt;/th&gt;
&lt;th&gt;Endpoint&lt;/th&gt;
&lt;th&gt;Controller method&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/menu-categories&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;index&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;POST&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/menu-categories&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;store&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GET&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/menu-categories/{menu_category}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;show&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PUT/PATCH&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/menu-categories/{menu_category}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;update&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DELETE&lt;/td&gt;
&lt;td&gt;&lt;code&gt;/api/menu-categories/{menu_category}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;destroy&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The actual route parameter name can depend on Laravel's resource parameter configuration. Confirm the registered routes using Artisan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Verify the Changes
&lt;/h2&gt;

&lt;p&gt;After saving the controller, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan optimize:clear

php artisan route:list &lt;span class="nt"&gt;--path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;menu-categories
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then test the endpoints with Postman or your preferred API client.&lt;/p&gt;

&lt;p&gt;Verify that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The listing is paginated.&lt;/li&gt;
&lt;li&gt;Invalid creation and update requests are rejected.&lt;/li&gt;
&lt;li&gt;Successful creation returns HTTP &lt;code&gt;201&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Requests for nonexistent categories return &lt;code&gt;404&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Categories with related menu items cannot be deleted.&lt;/li&gt;
&lt;li&gt;Successful deletion returns HTTP &lt;code&gt;200&lt;/code&gt; with the shared success message.&lt;/li&gt;
&lt;li&gt;Response structures match the conventions expected by the frontend.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should also test duplicate category names. The controller shown here does not itself prevent duplicate creation; that behavior must be implemented through validation and appropriate database constraints.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;This refactoring reinforced several backend development principles:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Reuse existing architecture.&lt;/strong&gt; Before introducing a custom response format, inspect the conventions already used by other controllers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Separate responsibilities.&lt;/strong&gt; Form requests validate input, models handle persistence and relationships, resources format output, and controllers coordinate the workflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use meaningful HTTP status codes.&lt;/strong&gt; &lt;code&gt;201&lt;/code&gt; indicates creation, &lt;code&gt;404&lt;/code&gt; indicates a missing resource, and &lt;code&gt;409&lt;/code&gt; can indicate a conflict with the resource's current state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid unnecessary database work.&lt;/strong&gt; Relationship &lt;code&gt;exists()&lt;/code&gt; checks can be more efficient than loading an entire collection just to count or inspect it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat API responses as a contract.&lt;/strong&gt; Frontend applications depend on predictable response shapes, pagination metadata, and error handling.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Refactoring &lt;code&gt;MenuCategoryController&lt;/code&gt; to extend &lt;code&gt;AppBaseController&lt;/code&gt; improves alignment with the existing Laravel application and makes shared response behavior easier to maintain.&lt;/p&gt;

&lt;p&gt;The key is to reuse the project's established conventions without sacrificing validation, pagination, resource formatting, or correct HTTP semantics.&lt;/p&gt;

&lt;p&gt;Before applying the same pattern to other controllers, inspect their response contracts and confirm whether they use Laravel resources, &lt;code&gt;ResponseUtil&lt;/code&gt;, or a combination of both.&lt;/p&gt;

&lt;p&gt;That small step can prevent a lot of inconsistent API behavior as an application grows.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>6 Types of Information Systems: A Beginner-Friendly Guide</title>
      <dc:creator>Vincent Tommi</dc:creator>
      <pubDate>Thu, 15 Oct 2026 05:00:00 +0000</pubDate>
      <link>https://dev.to/vincenttommi/6-types-of-information-systems-a-beginner-friendly-guide-pn6</link>
      <guid>https://dev.to/vincenttommi/6-types-of-information-systems-a-beginner-friendly-guide-pn6</guid>
      <description>&lt;p&gt;Information systems help organisations collect, process, store, and share information. However, different systems serve different purposes depending on the tasks performed and the level of management involved.&lt;/p&gt;

&lt;p&gt;In this article, we will explore six common types of information systems, their functions, and practical examples of how organisations use them.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Transaction Processing Systems (TPS)
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Transaction Processing System (TPS)&lt;/strong&gt; handles the routine, day-to-day transactions of an organisation.&lt;/p&gt;

&lt;p&gt;These systems operate at the operational level and process large amounts of basic transaction data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Functions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Record business transactions.&lt;/li&gt;
&lt;li&gt;Process routine operations.&lt;/li&gt;
&lt;li&gt;Generate detailed reports and summaries.&lt;/li&gt;
&lt;li&gt;Maintain accurate transaction records.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Payroll systems that calculate employee salaries.&lt;/li&gt;
&lt;li&gt;Point-of-sale systems that record customer purchases.&lt;/li&gt;
&lt;li&gt;Stock control systems that track inventory.&lt;/li&gt;
&lt;li&gt;Order processing systems that record customer orders.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Practical example:&lt;/strong&gt; When you purchase goods at a supermarket, the point-of-sale system records the sale, calculates the total, and updates stock levels.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Office Systems
&lt;/h2&gt;

&lt;p&gt;Office systems help employees perform everyday communication, documentation, and administrative tasks.&lt;/p&gt;

&lt;p&gt;They are widely used across different departments and support the creation, storage, and sharing of information.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Functions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create and edit documents.&lt;/li&gt;
&lt;li&gt;Manage spreadsheets and databases.&lt;/li&gt;
&lt;li&gt;Send and receive emails.&lt;/li&gt;
&lt;li&gt;Support communication and collaboration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Microsoft Word for document processing.&lt;/li&gt;
&lt;li&gt;Microsoft Excel for spreadsheets.&lt;/li&gt;
&lt;li&gt;Email applications for communication.&lt;/li&gt;
&lt;li&gt;Database applications for organising records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Practical example:&lt;/strong&gt; An administrator uses a spreadsheet to manage employee attendance and email to share reports with colleagues.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Knowledge Work Systems (KWS)
&lt;/h2&gt;

&lt;p&gt;Knowledge Work Systems support professionals who create new knowledge, develop designs, or solve specialised technical problems.&lt;/p&gt;

&lt;p&gt;They are commonly used by engineers, architects, designers, and other technical professionals.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Functions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Support technical and professional work.&lt;/li&gt;
&lt;li&gt;Help create new designs and knowledge.&lt;/li&gt;
&lt;li&gt;Perform modelling and simulations.&lt;/li&gt;
&lt;li&gt;Support complex problem-solving.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Computer-Aided Design (CAD) software.&lt;/li&gt;
&lt;li&gt;Engineering simulation tools.&lt;/li&gt;
&lt;li&gt;Advanced scientific modelling applications.&lt;/li&gt;
&lt;li&gt;Professional design software.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Practical example:&lt;/strong&gt; An engineer uses CAD software to design a machine component before it is manufactured.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Management Information Systems (MIS)
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Management Information System (MIS)&lt;/strong&gt; provides managers with organised information to monitor operations and make routine management decisions.&lt;/p&gt;

&lt;p&gt;MIS commonly uses summary data generated by Transaction Processing Systems to produce reports.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Functions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Summarise operational data.&lt;/li&gt;
&lt;li&gt;Generate regular management reports.&lt;/li&gt;
&lt;li&gt;Highlight unusual results or exceptions.&lt;/li&gt;
&lt;li&gt;Support planning, monitoring, and control.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Monthly sales reports.&lt;/li&gt;
&lt;li&gt;Departmental performance reports.&lt;/li&gt;
&lt;li&gt;Inventory summary reports.&lt;/li&gt;
&lt;li&gt;Payroll cost reports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Practical example:&lt;/strong&gt; A supermarket manager reviews a monthly sales report to identify the best-selling products and departments with declining sales.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Decision Support Systems (DSS)
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Decision Support System (DSS)&lt;/strong&gt; helps users analyse information and evaluate possible solutions to problems.&lt;/p&gt;

&lt;p&gt;Unlike systems that mainly report past activities, DSS can help users explore different scenarios and predict possible outcomes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Functions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Analyse data using statistical methods.&lt;/li&gt;
&lt;li&gt;Compare alternative decisions.&lt;/li&gt;
&lt;li&gt;Perform what-if analysis.&lt;/li&gt;
&lt;li&gt;Use models and simulations to evaluate possible outcomes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Spreadsheets used for financial forecasting.&lt;/li&gt;
&lt;li&gt;Investment analysis tools.&lt;/li&gt;
&lt;li&gt;Sales forecasting applications.&lt;/li&gt;
&lt;li&gt;Inventory optimisation systems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Practical example:&lt;/strong&gt; A business manager uses a spreadsheet to compare how different product prices might affect revenue and profit.&lt;/p&gt;

&lt;p&gt;A DSS supports decision-making; it does not necessarily make the final decision for the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Executive Support Systems (ESS)
&lt;/h2&gt;

&lt;p&gt;Executive Support Systems provide senior managers with high-level information for strategic planning and long-term decision-making.&lt;/p&gt;

&lt;p&gt;They combine information from internal systems with relevant external information, such as market conditions, competitor activities, and economic trends.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Functions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Present high-level organisational performance.&lt;/li&gt;
&lt;li&gt;Combine internal and external information.&lt;/li&gt;
&lt;li&gt;Identify long-term trends.&lt;/li&gt;
&lt;li&gt;Support strategic planning and major business decisions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Examples
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Executive dashboards.&lt;/li&gt;
&lt;li&gt;Strategic performance reports.&lt;/li&gt;
&lt;li&gt;Market trend analysis tools.&lt;/li&gt;
&lt;li&gt;Business intelligence dashboards for senior leadership.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Practical example:&lt;/strong&gt; A company's chief executive reviews sales trends, competitor performance, and economic forecasts to decide whether the business should expand into a new market.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Comparison of the Six Information Systems
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System&lt;/th&gt;
&lt;th&gt;Main purpose&lt;/th&gt;
&lt;th&gt;Typical users&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;TPS&lt;/td&gt;
&lt;td&gt;Process routine transactions&lt;/td&gt;
&lt;td&gt;Operational staff&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Office Systems&lt;/td&gt;
&lt;td&gt;Support communication and office tasks&lt;/td&gt;
&lt;td&gt;Employees across departments&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;KWS&lt;/td&gt;
&lt;td&gt;Support technical work and knowledge creation&lt;/td&gt;
&lt;td&gt;Engineers, designers, and specialists&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MIS&lt;/td&gt;
&lt;td&gt;Produce management reports&lt;/td&gt;
&lt;td&gt;Middle managers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DSS&lt;/td&gt;
&lt;td&gt;Analyse alternatives and support decisions&lt;/td&gt;
&lt;td&gt;Professionals, analysts, and managers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ESS&lt;/td&gt;
&lt;td&gt;Support strategic decisions&lt;/td&gt;
&lt;td&gt;Senior executives&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  8. How the Systems Work Together
&lt;/h2&gt;

&lt;p&gt;These information systems are not isolated. They can share information and support different levels of an organisation.&lt;/p&gt;

&lt;p&gt;For example, in a retail business:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;TPS&lt;/strong&gt; records daily sales.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MIS&lt;/strong&gt; summarises sales data into monthly reports.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DSS&lt;/strong&gt; analyses different pricing and stock scenarios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ESS&lt;/strong&gt; uses business performance and market trends to support expansion decisions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Office systems help employees communicate and manage documents, while knowledge work systems support specialised tasks such as product design.&lt;/p&gt;

&lt;p&gt;Together, these systems help an organisation operate efficiently, analyse performance, and plan for the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The six types of information systems serve different purposes, from recording everyday transactions to supporting strategic decisions.&lt;/p&gt;

&lt;p&gt;Understanding their differences helps explain how information flows through an organisation and how employees, managers, and executives use information to perform their responsibilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key takeaway:&lt;/strong&gt; TPS handles transactions, office systems support daily office work, KWS supports specialised knowledge work, MIS produces management reports, DSS evaluates alternatives, and ESS supports strategic decisions.&lt;/p&gt;

&lt;p&gt;Knowing these six types and their examples is useful when studying Information Systems and preparing for examinations.&lt;/p&gt;

</description>
      <category>learning</category>
      <category>computerscience</category>
      <category>informationtechnology</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
