<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KodeSmart</title>
	<atom:link href="https://kodesmart.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://kodesmart.com/</link>
	<description>#1 guide to Drupal, Wordpress, CSS and Custom Coding Beginner to Pro</description>
	<lastBuildDate>Sat, 04 Apr 2026 16:14:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://kodesmart.com/wp-content/uploads/2014/07/cropped-logo-32x32.jpg</url>
	<title>KodeSmart</title>
	<link>https://kodesmart.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Block route by IP address in Laravel</title>
		<link>https://kodesmart.com/laravel/block-route-by-ip-address-in-laravel/</link>
					<comments>https://kodesmart.com/laravel/block-route-by-ip-address-in-laravel/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Kodesmart]]></dc:creator>
		<pubDate>Fri, 31 Jan 2025 18:47:55 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<guid isPermaLink="false">https://kodesmart.com/?p=2131</guid>

					<description><![CDATA[<p>In Laravel, using middleware, you can block access to a specific route by IP address. Middleware allows you to filter HTTP requests entering your application. Here&#8217;s how you can do it step by step: Step 1: Create a Middleware Run the following Artisan command to create a new middleware: php artisan make:middleware IPBlockerMiddleware This will [&#8230;]</p>
<p>The post <a href="https://kodesmart.com/laravel/block-route-by-ip-address-in-laravel/">Block route by IP address in Laravel</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="ds-markdown ds-markdown--block" style="--ds-md-zoom: 1.143;">
<p>In Laravel, using middleware, you can block access to a specific route by IP address. Middleware allows you to filter HTTP requests entering your application. Here&#8217;s how you can do it step by step:</p>
<hr />
<h3><strong>Step 1: Create a Middleware</strong></h3>
<p>Run the following Artisan command to create a new middleware:</p>
<div class="md-code-block">
<div class="md-code-block-banner-wrap">
<div class="md-code-block-banner">
<div class="md-code-block-action">
<div class="ds-markdown-code-copy-button"><span style="color: #1e1e1e; font-family: Menlo, Consolas, monaco, monospace; font-size: 15px; white-space-collapse: preserve;">php artisan make:middleware IPBlockerMiddleware</span></div>
</div>
</div>
</div>
</div>
<p>This will create a new middleware file in <em>app/Http/Middleware/IPBlockerMiddleware.php</em>.</p>
<hr />
<h3><strong>Step 2: Implement IP Blocking Logic</strong></h3>
<p>Open the newly created middleware file (<em>IPBlockerpMiddleware.php</em>) and add the logic to block specific IP addresses.</p>
<div class="md-code-block">
<div class="md-code-block-banner-wrap">
<div class="md-code-block-banner">
<div class="md-code-block-action">
<div class="ds-markdown-code-copy-button"><span style="color: #1e1e1e; font-family: Menlo, Consolas, monaco, monospace; font-size: 15px; white-space-collapse: preserve;">&lt;?php</span></div>
</div>
</div>
</div>
<pre><span class="token php language-php"><span class="token keyword">namespace</span> <span class="token package">App<span class="token punctuation">\</span>Http<span class="token punctuation">\</span>Middleware</span><span class="token punctuation">;</span>

<span class="token keyword">use</span> <span class="token package">Closure</span><span class="token punctuation">;</span>
<span class="token keyword">use</span> <span class="token package">Illuminate<span class="token punctuation">\</span>Http<span class="token punctuation">\</span>Request</span><span class="token punctuation">;</span>

<span class="token keyword">class</span> IP<span class="token class-name-definition class-name">BlockerMiddleware</span>
<span class="token punctuation">{</span>
    <span class="token comment">// List of blocked IP addresses</span>
    <span class="token keyword">private</span> <span class="token variable">$blockedIPs</span> <span class="token operator">=</span> <span class="token punctuation">[</span>
        <span class="token string single-quoted-string">'192.168.1.100'</span><span class="token punctuation">,</span> <span class="token comment">// Example IP to block</span>
        <span class="token string single-quoted-string">'192.168.1.101'</span><span class="token punctuation">,</span> <span class="token comment">// Another example IP</span>
    <span class="token punctuation">]</span><span class="token punctuation">;</span>

    <span class="token comment">/**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */</span>
    <span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function-definition function">handle</span><span class="token punctuation">(</span><span class="token class-name type-declaration">Request</span> <span class="token variable">$request</span><span class="token punctuation">,</span> <span class="token class-name type-declaration">Closure</span> <span class="token variable">$next</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token comment">// Get the client's IP address</span>
        <span class="token variable">$clientIP</span> <span class="token operator">=</span> <span class="token variable">$request</span><span class="token operator">-&gt;</span><span class="token function">ip</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">// Check if the client's IP is in the blocked list</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token function">in_array</span><span class="token punctuation">(</span><span class="token variable">$clientIP</span><span class="token punctuation">,</span> <span class="token variable">$this</span><span class="token operator">-&gt;</span><span class="token property">blockedIPs</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">// Return a 403 Forbidden response</span>
            <span class="token keyword">return</span> <span class="token function">response</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'Access Denied'</span><span class="token punctuation">,</span> <span class="token number">403</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        <span class="token comment">// Allow the request to proceed</span>
        <span class="token keyword">return</span> <span class="token variable">$next</span><span class="token punctuation">(</span><span class="token variable">$request</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span></span></pre>
</div>
<hr />
<h3><strong>Step 3: Register the Middleware</strong></h3>
<p>Next, register your middleware in <em>app/Http/Kernel.php</em>. Add it to the <em>$routeMiddleware</em> array:</p>
<div class="md-code-block">
<pre><span class="token keyword">protected</span> <span class="token variable">$routeMiddleware</span> <span class="token operator">=</span> <span class="token punctuation">[</span>
    <span class="token comment">// Other middleware</span>
    <span class="token string single-quoted-string">'block.ip'</span> <span class="token operator">=&gt;</span> <span class="token class-name class-name-fully-qualified static-context"><span class="token punctuation">\</span>App<span class="token punctuation">\</span>Http<span class="token punctuation">\</span>Middleware<span class="token punctuation">\IP</span>BlockerMiddleware</span><span class="token operator">::</span><span class="token keyword">class</span><span class="token punctuation">,</span>
<span class="token punctuation">]</span><span class="token punctuation">;</span></pre>
</div>
<hr />
<h3><strong>Step 4: Apply the Middleware to Routes</strong></h3>
<p>Now, apply the middleware to the routes you want to protect. You can do this in your <em>routes/web.php</em> or <em>routes/api.php</em> file.</p>
<h4>Example: Block IP for a Specific Route</h4>
<div class="md-code-block">
<pre><span class="token class-name static-context">Route</span><span class="token operator">::</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'/protected-route'</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">return</span> <span class="token string single-quoted-string">'This route is protected!'</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">middleware</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'block.ip'</span><span class="token punctuation">)</span><span class="token punctuation">;</span></pre>
</div>
<h4>Example: Block IP for a Group of Routes</h4>
<div class="md-code-block">
<pre><span class="token class-name static-context">Route</span><span class="token operator">::</span><span class="token function">middleware</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'block.ip'</span><span class="token punctuation">)</span><span class="token operator">-&gt;</span><span class="token function">group</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token class-name static-context">Route</span><span class="token operator">::</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'/protected-route-1'</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">return</span> <span class="token string single-quoted-string">'This route is protected!'</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token class-name static-context">Route</span><span class="token operator">::</span><span class="token function">get</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'/protected-route-2'</span><span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">return</span> <span class="token string single-quoted-string">'This route is also protected!'</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></pre>
</div>
<hr />
<h3><strong>Step 5: Test the Middleware</strong></h3>
<ol start="1">
<li>
<p>Access the protected route from a blocked IP address. You should see a <em>403 Forbidden</em> response.</p>
</li>
<li>
<p>Access the route from an allowed IP address. You should see the route&#8217;s content.</p>
</li>
</ol>
<hr />
<h3><strong>Optional: Dynamically Load Blocked IPs</strong></h3>
<p>If you want to load the blocked IPs dynamically (e.g., from a database or configuration file), you can modify the middleware to fetch the IPs from a source.</p>
<h4>Example: Load Blocked IPs from Config</h4>
<ol start="1">
<li>
<p>Add the blocked IPs to your <em>config/app.php</em> file:</p>
<div class="md-code-block">
<div class="md-code-block-banner-wrap">
<div class="md-code-block-banner"> </div>
</div>
<pre><span class="token string single-quoted-string">'blocked_ips'</span> <span class="token operator">=&gt;</span> <span class="token punctuation">[</span>
    <span class="token string single-quoted-string">'192.168.1.100'</span><span class="token punctuation">,</span>
    <span class="token string single-quoted-string">'192.168.1.101'</span><span class="token punctuation">,</span>
<span class="token punctuation">]</span><span class="token punctuation">,</span></pre>
</div>
</li>
<li>
<p>Update the middleware to use the config:</p>
<div class="md-code-block">
<div class="md-code-block-banner-wrap">
<div class="md-code-block-banner"> </div>
</div>
<pre><span class="token keyword">private</span> <span class="token variable">$blockedIPs</span><span class="token punctuation">;</span>

<span class="token keyword">public</span> <span class="token keyword">function</span> <span class="token function-definition function">__construct</span><span class="token punctuation">(</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token variable">$this</span><span class="token operator">-&gt;</span><span class="token property">blockedIPs</span> <span class="token operator">=</span> <span class="token function">config</span><span class="token punctuation">(</span><span class="token string single-quoted-string">'app.blocked_ips'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span></pre>
</div>
</li>
</ol>
<hr />
<h3><strong>Optional: Use a Package</strong></h3>
<p>If you prefer a pre-built solution, you can use a package like <a href="https://github.com/spatie/laravel-ip" target="_blank" rel="noopener noreferrer">spatie/laravel-ip</a> to manage IP blocking.</p>
</div><div class="adsense responsive_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
				<!-- KS_Banner[468x60] -->
				<ins class="adsbygoogle"
				     style="display:inline-block;width:468px;height:60px"
				     data-ad-client="ca-pub-6704217550431577"
				     data-ad-slot="8750815243"></ins>
				<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
				</script></div><p>The post <a href="https://kodesmart.com/laravel/block-route-by-ip-address-in-laravel/">Block route by IP address in Laravel</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kodesmart.com/laravel/block-route-by-ip-address-in-laravel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Laravel Installation Guide for AlmaLinux</title>
		<link>https://kodesmart.com/laravel/laravel-installation-guide-for-almalinux/</link>
					<comments>https://kodesmart.com/laravel/laravel-installation-guide-for-almalinux/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Kodesmart]]></dc:creator>
		<pubDate>Tue, 28 Jan 2025 19:04:38 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<guid isPermaLink="false">https://kodesmart.com/?p=2122</guid>

					<description><![CDATA[<p>Step-by-Step Guide to Install Laravel, PHP, Apache, and MySQL on AlmaLinux Step 1: Update System Packages Update your system packages: sudo dnf update -y Step 2: Install PHP Enable the EPEL and Remi repositories: sudo dnf install epel-release -y sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y Enable the Remi PHP 8.x repository: sudo dnf module enable php:remi-8.2 [&#8230;]</p>
<p>The post <a href="https://kodesmart.com/laravel/laravel-installation-guide-for-almalinux/">Laravel Installation Guide for AlmaLinux</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><style>
code {
            background-color: #f4f4f4;
            padding: 2px 5px;
            border-radius: 3px;
            font-family: "Courier New", Courier, monospace;
        }
        pre {
            background-color: #f4f4f4;
            padding: 10px;
            border-radius: 5px;
            overflow-x: auto;
        }
        .step {
            margin-bottom: 30px;
        }
        .step h2 {
            border-bottom: 2px solid #2c3e50;
            padding-bottom: 5px;
        }
.step p{margin-bottom: 3px!important;}
</style></p>
<div class="container">
<h1>Step-by-Step Guide to Install Laravel, PHP, Apache, and MySQL on AlmaLinux</h1>
<div class="step">
<h2>Step 1: Update System Packages</h2>
<p>Update your system packages:</p>
<pre><code>sudo dnf update -y</code></pre>
</div>
<div class="step">
<h2>Step 2: Install PHP</h2>
<p>Enable the EPEL and Remi repositories:</p>
<pre><code>sudo dnf install epel-release -y
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm -y</code></pre>
<p>Enable the Remi PHP 8.x repository:</p>
<pre><code>sudo dnf module enable php:remi-8.2 -y</code></pre>
<p>Install PHP and required extensions:</p>
<pre><code>sudo dnf install php php-cli php-fpm php-mysqlnd php-zip php-gd php-mbstring php-curl php-xml php-bcmath php-json -y</code></pre>
<p>Verify the installation:</p>
<pre><code>php -v</code></pre>
</div>
<div class="step">
<h2>Step 3: Install Apache</h2>
<p>Install Apache:</p>
<pre><code>sudo dnf install httpd -y</code></pre>
<p>Start and enable Apache:</p>
<pre><code>sudo systemctl start httpd
sudo systemctl enable httpd</code></pre>
<p>Open the firewall for HTTP and HTTPS:</p>
<pre><code>sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload</code></pre>
<p>Verify Apache is running by visiting <code>http://&lt;your-server-ip&gt;</code> in your browser.</p>
</div>
<div class="step">
<h2>Step 4: Install MySQL (MariaDB)</h2>
<p>Install MariaDB:</p>
<pre><code>sudo dnf install mariadb-server mariadb -y</code></pre>
<p>Start and enable MariaDB:</p>
<pre><code>sudo systemctl start mariadb
sudo systemctl enable mariadb</code></pre>
<p>Secure MariaDB:</p>
<pre><code>sudo mysql_secure_installation</code></pre>
<p>Verify MariaDB is running:</p>
<pre><code>sudo mysql -u root -p</code></pre>
</div>
<div class="step">
<h2>Step 5: Install Composer</h2>
<p>Download and install Composer:</p>
<pre><code>php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"</code></pre>
<p>Move Composer to a global directory:</p>
<pre><code>sudo mv composer.phar /usr/local/bin/composer</code></pre>
<p>Verify the installation:</p>
<pre><code>composer --version</code></pre>
</div>
<div class="step">
<h2>Step 6: Install Laravel</h2>
<p>Create a new Laravel project:</p>
<pre><code>composer create-project --prefer-dist laravel/laravel project-name</code></pre>
<p>Navigate to the project directory:</p>
<pre><code>cd project-name</code></pre>
<p>Set up the <code>.env</code> file:</p>
<pre><code>cp .env.example .env</code></pre>
<p>Update the <code>.env</code> file with your database credentials:</p>
<pre><code>DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_user
DB_PASSWORD=your_database_password</code></pre>
<p>Generate an application key:</p>
<pre><code>php artisan key:generate</code></pre>
<p>Set proper permissions for Laravel storage and cache:</p>
<pre><code>sudo chown -R apache:apache storage bootstrap/cache
sudo chmod -R 775 storage bootstrap/cache</code></pre>
</div>
<div class="step">
<h2>Step 7: Configure Apache for Laravel</h2>
<p>Move your Laravel project to the Apache web directory:</p>
<pre><code>sudo mv project-name /var/www/html/</code></pre>
<p>Create an Apache configuration file for your Laravel project:</p>
<pre><code>sudo nano /etc/httpd/conf.d/laravel.conf</code></pre>
<p>Add the following configuration:</p>
<pre><code>&lt;VirtualHost *:80&gt;
ServerAdmin admin@example.com
DocumentRoot /var/www/html/project-name/public

&lt;Directory /var/www/html/project-name/public&gt;
AllowOverride All
Require all granted
&lt;/Directory&gt;

ErrorLog /var/log/httpd/laravel-error.log
CustomLog /var/log/httpd/laravel-access.log combined
&lt;/VirtualHost&gt;</code></pre>
<p>Restart Apache:</p>
<pre><code>sudo systemctl restart httpd</code></pre>
</div>
<div class="step">
<h2>Step 8: Verify Installation</h2>
<p>Open your browser and visit <code>http://&lt;your-server-ip&gt;</code>. You should see the Laravel welcome page.</p>
</div>
<h2>Dependencies Installed</h2>
<ul>
<li>PHP</li>
<li>Apache (httpd)</li>
<li>MariaDB (MySQL-compatible)</li>
<li>Composer</li>
<li>Laravel</li>
</ul>
<p>You’re now ready to start building your Laravel application on AlmaLinux! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
</div><div class="adsense responsive_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
				<!-- KS_Banner[468x60] -->
				<ins class="adsbygoogle"
				     style="display:inline-block;width:468px;height:60px"
				     data-ad-client="ca-pub-6704217550431577"
				     data-ad-slot="8750815243"></ins>
				<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
				</script></div><p>The post <a href="https://kodesmart.com/laravel/laravel-installation-guide-for-almalinux/">Laravel Installation Guide for AlmaLinux</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kodesmart.com/laravel/laravel-installation-guide-for-almalinux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Introduction to Laravel</title>
		<link>https://kodesmart.com/laravel/introduction-to-laravel/</link>
					<comments>https://kodesmart.com/laravel/introduction-to-laravel/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Kodesmart]]></dc:creator>
		<pubDate>Tue, 28 Jan 2025 16:57:25 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<guid isPermaLink="false">https://kodesmart.com/?p=2113</guid>

					<description><![CDATA[<p>Laravel is a popular open-source PHP web framework designed for building modern, robust, and scalable web applications. It follows the Model-View-Controller (MVC) architectural pattern, which separates the application logic, user interface, and data layers. Laravel is known for its elegant syntax, developer-friendly features, and extensive ecosystem, making it a top choice for PHP developers. Key [&#8230;]</p>
<p>The post <a href="https://kodesmart.com/laravel/introduction-to-laravel/">Introduction to Laravel</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="ds-markdown ds-markdown--block" style="--ds-md-zoom: 1.143;">
<p>Laravel is a popular open-source PHP web framework designed for building modern, robust, and scalable web applications. It follows the Model-View-Controller (MVC) architectural pattern, which separates the application logic, user interface, and data layers. Laravel is known for its elegant syntax, developer-friendly features, and extensive ecosystem, making it a top choice for PHP developers.</p>
<p><strong>Key Features of Laravel:</strong></p>
<ol start="1">
<li><strong>Eloquent ORM</strong>: A powerful object-relational mapper (ORM) that simplifies database interactions.</li>
<li><strong>Blade Templating Engine</strong>: A lightweight yet powerful templating engine for creating dynamic views.</li>
<li><strong>Artisan CLI</strong>: A command-line interface for automating repetitive tasks and generating boilerplate code.</li>
<li><strong>Migrations and Seeding</strong>: Tools for managing database schema changes and populating databases with test data.</li>
<li><strong>Routing and Middleware</strong>: Flexible routing system and middleware for handling HTTP requests.</li>
<li><strong>Security</strong>: Built-in features like CSRF protection, encryption, and authentication.</li>
<li><strong>Testing</strong>: Support for unit testing and PHPUnit integration.</li>
<li><strong>Laravel Ecosystem</strong>: Tools like Laravel Forge, Envoyer, Horizon, and Nova for deployment, task management, and administration.</li>
</ol>
<hr />
<h3>How to Get Started with Laravel</h3>
<ol start="1">
<li><strong>Install PHP and Composer</strong>:
<ul>
<li>Laravel 11 requires PHP (&gt;= 8.0) and Composer, a dependency manager for PHP.</li>
<li>Install PHP and Composer on your system.</li>
</ul>
<pre><code>
# For Ubuntu Servers
sudo apt-get install openssl php-bcmath php-curl php-json php-mbstring php-mysql php-tokenizer php-xml php-zip
<a href="https://laravel.com/docs/11.x/deployment#server-requirements">See Server Requirements</a>
</code></pre>
</li>
<li><strong>Install Laravel</strong>:
<ul>
<li>Use Composer to create a new Laravel project:
<div class="md-code-block">
<pre><span class="token function">composer</span> create-project --prefer-dist laravel/laravel project-name</pre>
</div>
</li>
</ul>
</li>
<li><strong>Set Up the Environment</strong>:
<ul>
<li>
<p>Configure the <code>.env</code> file with your database credentials and other settings.</p>
</li>
</ul>
</li>
<li>
<p><strong>Run the Development Server</strong>:</p>
<ul>
<li>
<p>Start the built-in development server:</p>
<div class="md-code-block">
<pre>php artisan serve</pre>
</div>
</li>
<li>
<p>Visit <code>http://localhost:8000</code> in your browser to see the Laravel welcome page.</p>
</li>
</ul>
</li>
<li>
<p><strong>Explore the Documentation</strong>:</p>
<ul>
<li>
<p>Laravel’s official documentation is comprehensive and beginner-friendly. Visit <a href="https://laravel.com/docs" target="_blank" rel="noopener noreferrer">Laravel Docs</a>.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h3>When to Use Laravel</h3>
<p>Laravel is ideal for:</p>
<ul>
<li>
<p>Building web applications with complex backend logic.</p>
</li>
<li>
<p>Rapid application development (RAD) due to its built-in tools and features.</p>
</li>
<li>
<p>Projects requiring robust authentication, API development, or real-time features (via Laravel Echo).</p>
</li>
<li>
<p>Applications that need scalability and maintainability.</p>
</li>
</ul>
<p>It may not be the best choice for:</p>
<ul>
<li>
<p>Extremely simple websites or static pages (use plain PHP or a lightweight framework).</p>
</li>
<li>
<p>Projects with very specific performance requirements (consider micro-frameworks like SlimPHP or Lumen).</p>
</li>
</ul>
<hr />
<h3>Laravel vs. Other Frameworks</h3>
<p><strong>Laravel vs. CakePHP</strong>:</p>
<ul>
<li>
<p><strong>Laravel</strong>:</p>
<ul>
<li>
<p>More modern and feature-rich.</p>
</li>
<li>
<p>Better documentation and community support.</p>
</li>
<li>Security in built-in</li>
<li>
<p>Eloquent ORM is more intuitive than CakePHP’s ORM.</p>
</li>
<li>
<p>Considered faster due to its routing efficiency.</p>
</li>
<li>Requires frontend tools (e.g., Vue.js, React) for modern UIs.</li>
</ul>
</li>
<li>
<p><strong>CakePHP</strong>:</p>
<ul>
<li>
<p>Simpler and easier to learn for beginners.</p>
</li>
<li>
<p>No reconfiguration is required.</p>
</li>
<li>Offers robust database integration.</li>
<li>
<p>Built-in tools for rapid development and code generation.</p>
</li>
</ul>
</li>
</ul>
<hr />
<h3>Integration Support and Documentation</h3>
<p><strong>Integration Support</strong>:</p>
<ul>
<li>Laravel integrates seamlessly with popular frontend frameworks like Vue.js, React, and Angular.</li>
<li>It supports third-party libraries and packages via Composer.</li>
<li>Laravel Mix simplifies asset compilation (CSS, JS) using Webpack.</li>
<li>APIs can be built easily with Laravel Sanctum or Passport for authentication.</li>
</ul>
<strong>Documentation and Help</strong>:
<ul>
<li>Laravel’s official documentation is one of the best in the industry, covering everything from installation to advanced features.</li>
<li>The Laravel community is active on platforms like GitHub, Stack Overflow, and Laracasts.</li>
<li>Laracasts offers video tutorials for beginners and advanced users.</li>
<li>Forums and Discord channels provide additional support.</li>
</ul>
<hr />
<h3>Conclusion</h3>
<p>Laravel is a powerful and versatile PHP framework that simplifies web application development. Its rich feature set, elegant syntax, and strong community support make it a top choice for developers. While it may have a slight learning curve and performance overhead, its benefits far outweigh the drawbacks for most projects. Whether you’re building a small application or a large-scale system, Laravel provides the tools and flexibility to get the job done efficiently.</p>
</div><div class="adsense responsive_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
				<!-- KS_Banner[468x60] -->
				<ins class="adsbygoogle"
				     style="display:inline-block;width:468px;height:60px"
				     data-ad-client="ca-pub-6704217550431577"
				     data-ad-slot="8750815243"></ins>
				<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
				</script></div><p>The post <a href="https://kodesmart.com/laravel/introduction-to-laravel/">Introduction to Laravel</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kodesmart.com/laravel/introduction-to-laravel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>CentOS Server Security &#124; Connecting to a remote MySQL or MariaDB Database</title>
		<link>https://kodesmart.com/tech-stuff/centos-server-security-connecting-remote-mysql-mariadb-database/</link>
					<comments>https://kodesmart.com/tech-stuff/centos-server-security-connecting-remote-mysql-mariadb-database/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Kodesmart]]></dc:creator>
		<pubDate>Mon, 23 Oct 2023 20:43:57 +0000</pubDate>
				<category><![CDATA[Tech Stuff]]></category>
		<guid isPermaLink="false">http://kodesmart.com/?p=2050</guid>

					<description><![CDATA[<p>If you rely on MySQL Workbench for Schema design, database administration or SQL development then at some point your gonna need to connect to a remote host. Today we take a look at Connecting to a remote MySQL or MariaDB Database and some of the things that may prevent you from doing so. 1. Can&#8217;t [&#8230;]</p>
<p>The post <a href="https://kodesmart.com/tech-stuff/centos-server-security-connecting-remote-mysql-mariadb-database/">CentOS Server Security | Connecting to a remote MySQL or MariaDB Database</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div id="kstut">
<div class="wrap">
<p>If you rely on MySQL Workbench for Schema design, database administration or SQL development then at some point your gonna need to connect to a remote host. Today we take a look at Connecting to a remote MySQL or MariaDB Database and some of the things that may prevent you from doing so.
</p>
<h3>1. <u>Can&#8217;t connect to local MySQL server through socket</u></h3>
<p> &#8211;ERROR 2002 (HY000)</p>
<p>If a remote connection isn&#8217;t being established, be it from you application or DBMS then one of the first things you should check is your firewall. One clue that this may be the issue will be error 2002 ( HY000 ) upon attempting a connection. Some persons may want to turn off the firewall altogether to bypass this but isn&#8217;t really recommended, since the firewall is an important part of your servers overall security mechanism. Instead, add a rule to firewall like the one below. This rule establishes a new firewall zone and tells it to accept traffic on DB port 3306 from any IP/IP Subnet specified.</p>
<pre><code>
# Mysql/MariaDB remote database access

firewall-cmd --new-zone=myremoterule --permanent
firewall-cmd --reload
firewall-cmd --permanent --zone=myremoterule --add-source=210.10.4.0/24
firewall-cmd --permanent --zone=myremoterule --add-port=3306/tcp
firewall-cmd --reload

</code></pre>
<p>&nbsp;</p>
<h3>2. <u>Host is not allowed to connect Problem</u></h3>
<p> When a database is setup, usually various user accounts are created to carry out and separate functions. MySQL offers the ability to restrict the host that each user is allowed to connect through. For example, an application living on the same webserver as the db may be restricted to connecting via localhost only as a security mechanism. Often times to allow remote connections to the database we may need to adjust the host setting for that user account.</p>
<pre><code>
# Check host setting for DB user: iDez
# If you only see results with localhost and 127.0.0.1, you cannot connect from an external source.

SELECT host FROM mysql.user WHERE User = 'iDez';

# Give db user:iDez remote access to databasefrom anywhere

GRANT ALL PRIVILEGES ON *.* TO 'iDez'@'%';

</code></pre>
<p>&nbsp;</p>
<p>OK so it&#8217;s still not working and your getting frustrated&#8230;</p>
<h3>3. <u>SELinux: allow httpd to connect to a specific port</u></h3>
<p> If Apache handles your web server requests and it&#8217;s an app that just won&#8217;t connect to the database then chances are SELinux may be the culprit here. To allow the Apache HTTP Server to communicate with MariaDB enable the following SELinux Boolean.</p>
<pre><code>
# Mysql/MariaDB remote database access

setsebool -P httpd_can_network_connect_db on

</code></pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Let me know in the comments if any of these worked for you. Also checkout <a href="https://kodesmart.com/tech-stuff/centos-server-security/">CentOS Server Security | Steps to Configuring SELinux</a></h3>
<p><space class="h40"></space><br />
<!-- KS AD SPACE --></p>
<div class="lpos fullspan primad ksad">
<div class="adsense square_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- KS_Square[250] -->
		<ins class="adsbygoogle"
		     style="display:inline-block;width:250px;height:250px"
		     data-ad-client="ca-pub-6704217550431577"
		     data-ad-slot="2704281648"></ins>
		<script>
		(adsbygoogle = window.adsbygoogle || []).push({});
		</script></div><div class="adsense square_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- KS_Square_2[250] -->
		<ins class="adsbygoogle"
		     style="display:inline-block;width:250px;height:250px"
		     data-ad-client="ca-pub-6704217550431577"
		     data-ad-slot="4181014840"></ins>
		<script>
		(adsbygoogle = window.adsbygoogle || []).push({});
		</script></div><br />
<br />
<div class="adsense square_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- KS_Square[250] -->
		<ins class="adsbygoogle"
		     style="display:inline-block;width:250px;height:250px"
		     data-ad-client="ca-pub-6704217550431577"
		     data-ad-slot="2704281648"></ins>
		<script>
		(adsbygoogle = window.adsbygoogle || []).push({});
		</script></div><div class="adsense square_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- KS_Square_2[250] -->
		<ins class="adsbygoogle"
		     style="display:inline-block;width:250px;height:250px"
		     data-ad-client="ca-pub-6704217550431577"
		     data-ad-slot="4181014840"></ins>
		<script>
		(adsbygoogle = window.adsbygoogle || []).push({});
		</script></div>
</div>
<p> <!-- KS AD SPACE -->
</div>
</div>
<div class="adsense responsive_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
				<!-- KS_Banner[468x60] --><br />
				<ins class="adsbygoogle"
				     style="display:inline-block;width:468px;height:60px"
				     data-ad-client="ca-pub-6704217550431577"
				     data-ad-slot="8750815243"></ins><br />
				<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
				</script></div>
<p>The post <a href="https://kodesmart.com/tech-stuff/centos-server-security-connecting-remote-mysql-mariadb-database/">CentOS Server Security | Connecting to a remote MySQL or MariaDB Database</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kodesmart.com/tech-stuff/centos-server-security-connecting-remote-mysql-mariadb-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>iFrame with Responsive Content Loading</title>
		<link>https://kodesmart.com/kode/iframe-with-responsive-content-loading/</link>
					<comments>https://kodesmart.com/kode/iframe-with-responsive-content-loading/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Kodesmart]]></dc:creator>
		<pubDate>Fri, 16 Oct 2020 15:34:12 +0000</pubDate>
				<category><![CDATA[Kode]]></category>
		<guid isPermaLink="false">http://kodesmart.com/?p=2027</guid>

					<description><![CDATA[<p>So your still using iframes&#8230;.what a drag.Anyhow, lets look at overcoming a few of its quirks. First off wouldn&#8217;t it be awesome if native iframes would snap to the size of whatever is inside? Yep, I think so too so lets build an iFrame with Responsive Content Loading. This means that once the source for [&#8230;]</p>
<p>The post <a href="https://kodesmart.com/kode/iframe-with-responsive-content-loading/">iFrame with Responsive Content Loading</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div id="kstut">
<div class="wrap">
<p>
So your still using iframes&#8230;.what a drag.<br />Anyhow, lets look at overcoming a few of its quirks. First off wouldn&#8217;t it be awesome if native iframes would snap to the size of whatever is inside? Yep, I think so too so lets build an iFrame with Responsive Content Loading. This means that once the source for the iframe changes so will its height and width. Secondly we&#8217;re gonna make it so that it loads whatever link is clicked. The iframe will therefore load and display the clinked link.
</p>
<pre><code>
&lt;div class=&quot;content-wrapper&quot;&gt; 
	&lt;section class=&quot;content&quot;&gt;
		&lt;div class=&quot;row&quot;&gt; 
			&lt;img id=&quot;loader&quot; src=&quot;images/loading.gif&quot; alt=&quot;loading gif&quot;/&gt; 
			&lt;div id=&quot;report&quot; class=&quot;iframe-container tabcontent&quot;&gt; 
				&lt;iframe id=&quot;dframe&quot; src=&quot;&quot;&gt; &lt;/iframe&gt; 
			&lt;/div&gt; 
		&lt;/div&gt; 
	&lt;/section&gt; 
&lt;/div&gt;
</code></pre>
<pre><code>
&lt;script src="js/jQuery.js"&gt;&lt;/script&gt;
&lt;script&gt;		
$(document).ready(function(){
  $('#smenu li a').on('click', function(e) {

    if ($(e.target).hasClass('active')) {
      return false;
    }

    $('#smenu li a.active').removeClass('active');
    $('#loader').show();
    var id_of_selected = $(this).attr('href');
    link_to_load = id_of_selected.replace(/^#/, '');

    if (id_of_selected.length) {
      $("#dframe").attr('src', link_to_load);
      $(this).addClass('active');
    }
  });

    $('#dframe').on('load', function () {
      $('#loader').hide();
    });
});
&lt;/script&gt;
</code></pre>
<p>&nbsp;</p>
<p><a target="_blank" id="" class="demo ksbutton" href="https://project.kodesmart.com/iframe-responsive">DEMO</a> | <a target="_blank" id="" class="download ksbutton" href="https://project.kodesmart.com/iframe-responsive/iframe.zip">DOWNLOAD</a></p>
<p><!-- KS AD SPACE --></p>
<div class="lpos fullspan primad ksad"><div class="adsense square_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- KS_Square[250] -->
		<ins class="adsbygoogle"
		     style="display:inline-block;width:250px;height:250px"
		     data-ad-client="ca-pub-6704217550431577"
		     data-ad-slot="2704281648"></ins>
		<script>
		(adsbygoogle = window.adsbygoogle || []).push({});
		</script></div><div class="adsense square_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
		<!-- KS_Square_2[250] -->
		<ins class="adsbygoogle"
		     style="display:inline-block;width:250px;height:250px"
		     data-ad-client="ca-pub-6704217550431577"
		     data-ad-slot="4181014840"></ins>
		<script>
		(adsbygoogle = window.adsbygoogle || []).push({});
		</script></div></div>
<p><!-- KS AD SPACE --></p>
</div>
</div>
<div class="adsense responsive_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
				<!-- KS_Banner[468x60] --><br />
				<ins class="adsbygoogle"
				     style="display:inline-block;width:468px;height:60px"
				     data-ad-client="ca-pub-6704217550431577"
				     data-ad-slot="8750815243"></ins><br />
				<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
				</script></div>
<p>The post <a href="https://kodesmart.com/kode/iframe-with-responsive-content-loading/">iFrame with Responsive Content Loading</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kodesmart.com/kode/iframe-with-responsive-content-loading/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to create a simple Search Bar</title>
		<link>https://kodesmart.com/kode/create-simple-search-bar/</link>
					<comments>https://kodesmart.com/kode/create-simple-search-bar/?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[Kodesmart]]></dc:creator>
		<pubDate>Fri, 17 Jan 2020 21:00:26 +0000</pubDate>
				<category><![CDATA[Kode]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[How to make]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[simple Search Bar]]></category>
		<guid isPermaLink="false">http://kodesmart.com/?p=2004</guid>

					<description><![CDATA[<p>#How to create a simple Search Bar Many websites and apps require search bars and in this tutorial I’ll show you how to make one in under 5 minutes. First, lets create an index.html and css/styles.css files and directory. A search icon download is provided for this tutorial, place the icon in the css directory. [&#8230;]</p>
<p>The post <a href="https://kodesmart.com/kode/create-simple-search-bar/">How to create a simple Search Bar</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2 class="western">#How to create a simple Search Bar</h2>
<p>Many websites and apps require search bars and in this tutorial I’ll show you how to make one in under 5 minutes.</p>
<p>First, lets create an index.html and css/styles.css files and directory. A search icon download is provided for this tutorial, place the icon in the css directory.</p>
<p><strong>The index.html file: The markup is as follows.</strong></p>
<p><strong>*The form and the h1 are only for presentation purposes only*</strong></p>
<pre>&lt;!doctype html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;Search Bar Tutorial&lt;/title&gt;
&lt;meta name="description" content="Search Bar Tutorial"&gt;
&lt;meta name="author" content="Kodesmart"&gt;
&lt;link rel="stylesheet" href="css/styles.css?v=1.0"&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form action="#"&gt;
&lt;h1&gt;Search Bar Tutorial&lt;/h1&gt;
&lt;input type="search" placeholder="Seach..."&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong>The css/styles.css file:</strong></p>
<pre>form{
width: 600px;
margin: 100px auto;
}

input[type=search]{
width: 400px;
height: 40px;
font-size: 16px;
padding: 0px 20px 0px 40px;
border-radius: 40px;
outline: none;
border: solid gray 2px;
background: url('Search.png') 7px center no-repeat;
}</pre>
<p>&nbsp;</p>
<h2 class="western">#Explanation of the code</h2>
<p>padding: 0px 20px 0px 40px;</p>
<p><b>Adds padding for the left icon space and the right side to prevent entered text from touching the edge of the search bar.</b></p>
<p>border-radius: 40px;</p>
<p><b>Adds the curve for our search bar.</b></p>
<p>border: solid gray 2px;</p>
<p><b>A simple solid gray border was added for contrast/separation with the background.</b></p>
<p>background: url(&#8216;Search.png&#8217;) 7px center no-repeat;</p>
<p><b>Finally adding our search icon to 7px from the lext, vertically centered and with no repeat/tiling of the image.</b></p>
<p>outline: none;</p>
<p><b>Removes any outline that the default input element might have from the browser.</b></p>
<p>You have completed a simple but stylish search bar which can be used for your own projects.</p>
<p>Thank you for reading!</p>
<p>&nbsp;</p>
<h2 class="western">#Download Link:</h2>
<p><a href="https://kodesmart.com/wp-content/uploads/2020/01/search_bar_tutorial.7z" download="">search_bar_tutorial</a></p>
<div class="adsense responsive_ad"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><br />
				<!-- KS_Banner[468x60] --><br />
				<ins class="adsbygoogle"
				     style="display:inline-block;width:468px;height:60px"
				     data-ad-client="ca-pub-6704217550431577"
				     data-ad-slot="8750815243"></ins><br />
				<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
				</script></div>
<p>The post <a href="https://kodesmart.com/kode/create-simple-search-bar/">How to create a simple Search Bar</a> appeared first on <a href="https://kodesmart.com">KodeSmart</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://kodesmart.com/kode/create-simple-search-bar/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
