<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Laravel_learn on Medium]]></title>
        <description><![CDATA[Stories by Laravel_learn on Medium]]></description>
        <link>https://medium.com/@geofindblog?source=rss-38b342a563e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FF3jti-QhvqNSTYj4WFyDA.png</url>
            <title>Stories by Laravel_learn on Medium</title>
            <link>https://medium.com/@geofindblog?source=rss-38b342a563e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 17:33:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@geofindblog/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Manipulating Data with Ease: Understanding the Power of Map, Filter, and Fold in PHP]]></title>
            <link>https://geofindblog.medium.com/manipulating-data-with-ease-understanding-the-power-of-map-filter-and-fold-in-php-1a750e80944c?source=rss-38b342a563e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a750e80944c</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php-developers]]></category>
            <category><![CDATA[php-development]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Laravel_learn]]></dc:creator>
            <pubDate>Sun, 05 Feb 2023 03:22:42 GMT</pubDate>
            <atom:updated>2023-02-05T03:29:09.590Z</atom:updated>
            <content:encoded><![CDATA[<p>The Map, Filter, and Fold Functions: Understanding Their Significance in PHP As a programming language, PHP is widely used for web development, and lists are a universal aspect of programming. They are important for storing multiple values, with the basic list type in PHP being the associative array, also known as a hash table.</p><p>Besides this type, there are other list types available in PHP, such as the SPL fixed array, object storage, doubly linked lists, heaps, and stacks. Additionally, there exist immutable lists and collections which form another grouping. Regardless of the list type, manipulating data stored in lists is an important requirement in programming. While it is possible to manipulate list data using iterative control structures such as for, while, foreach loops and the like, the map, filter, and fold functions provide a more stylistically appropriate and efficient way to modify lists.</p><p>These functions are referred to as higher-order functions, and they create new list data by applying functions in one go, with each function differing from the others algorithmically.</p><p><strong>The Map Function</strong></p><p>The map function is used to apply a function to each value in a list. The PHP userland has an array_map function, which is convenient for this purpose, and multiple arrays can be parsed by the array_map function.</p><p>The following example demonstrates the mapping of the factorial function on each value in a list of numbers using the array_map function:</p><blockquote>&lt;?php</blockquote><blockquote>define(‘NUMBERS’, [1, 2, 3, 4, 5]);</blockquote><blockquote>function factorial(int $val): int {</blockquote><blockquote>return $val &lt; 2 ? 1 : factorial($val-1) * $val;</blockquote><blockquote>}</blockquote><blockquote>$result = array_map(‘factorial’, NUMBERS); }</blockquote><p>The output of the array_map operation ($result) is an array of factorials. The same operation can also be performed using the map function from the bingo-functional library. The code would look like this:</p><blockquote>&lt;?php require __DIR__ . ‘/vendor/autoload.php’;</blockquote><blockquote>use function Chemem\Bingo\Functional\map; define(‘NUMBERS’, [1, 2, 3, 4, 5]);</blockquote><blockquote>function factorial(int $val): int { return $val &lt; 2 ? 1 : factorial($val — 1) * $val;</blockquote><blockquote>}</blockquote><p>In this case, the performance of both the array_map and map functions are similar for the factorial function mapping case. However, the map function can’t allow for multiple array function mappings, unlike the array_map function, which can include another list in the array_map sequence and generate a more comprehensive two-list result. Fusion with array_merge() and the Spread Operator The following example maps the same factorial function onto each value in two different lists (FACT_KEYS and NUMBERS):</p><blockquote>&lt;?php require __DIR__ . ‘/functions.php’;</blockquote><blockquote>define(‘NUMBERS’, [1, 2, 3, 4, 5]);</blockquote><blockquote>define(‘FACT_KEYS’, [‘1!’, ‘2!’, ‘3!’, ‘4!’, ‘5!’]);</blockquote><blockquote>$result = array_merge( …array_map( fn (string $key, int $value): array =&gt; [$key =&gt; factorial($value)],</blockquote><p>FACT_KEYS, The PHP spread operator (…) is used in the array”</p><p><strong>The Filter Function</strong></p><p>The filter function is used to extract values from a list based on a specified condition. The PHP userland has an array_filter function, which is convenient for this purpose. The following example demonstrates the filtering of numbers greater than 3 in a list of numbers using the array_filter function:</p><blockquote>&lt;?php</blockquote><blockquote>define(‘NUMBERS’, [1, 2, 3, 4, 5]);</blockquote><blockquote>$result = array_filter(NUMBERS, fn($val): bool =&gt; $val &gt; 3);</blockquote><p>The output of the array_filter operation ($result) is an array of numbers greater than 3. The same operation can also be performed using the filter function from the bingo-functional library. The code would look like this:</p><blockquote>require __DIR__ . ‘/vendor/autoload.php’;</blockquote><blockquote>use function Chemem\Bingo\Functional\filter; define(‘NUMBERS’, [1, 2, 3, 4, 5]);</blockquote><blockquote>$result = filter(fn($val): bool =&gt; $val &gt; 3, NUMBERS);</blockquote><p>The Fold Function The fold function is used to reduce a list to a single value by applying a function to the elements of a list in a sequential manner. The PHP userland has an array_reduce function, which is convenient for this purpose. The following example demonstrates the calculation of the sum of all elements in a list of numbers using the array_reduce function:</p><blockquote>define(‘NUMBERS’, [1, 2, 3, 4, 5]);</blockquote><blockquote>$result = array_reduce(NUMBERS, fn($carry, $val): int =&gt; $carry + $val, 0);</blockquote><p>The output of the array_reduce operation ($result) is the sum of all elements in the list. The same operation can also be performed using the fold function from the bingo-functional library. The code would look like this:</p><blockquote>require __DIR__ . ‘/vendor/autoload.php’;</blockquote><blockquote>use function Chemem\Bingo\Functional\fold; define(‘NUMBERS’, [1, 2, 3, 4, 5]);</blockquote><blockquote>$result = fold(fn($carry, $val): int =&gt; $carry + $val, 0, NUMBERS);</blockquote><p>The map, filter, and fold functions provide an efficient and elegant way to manipulate lists in PHP. They allow for the application of functions to lists in a single go, providing an alternative to the iterative control structures commonly used for list manipulation. The use of these functions leads to a more concise and maintainable codebase, with improved performance compared to the equivalent iterative control structures. Whether using the standard PHP userland or the functional libraries, these functions should be a staple in the toolkit of every PHP developer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a750e80944c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We specify the target directory for the uploaded file in PHP. One var is probably confusing.]]></title>
            <link>https://geofindblog.medium.com/how-do-i-specify-the-target-directory-for-an-uploaded-file-in-php-7438a3dba883?source=rss-38b342a563e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7438a3dba883</guid>
            <category><![CDATA[php-development]]></category>
            <category><![CDATA[php-developers]]></category>
            <category><![CDATA[phpunit]]></category>
            <category><![CDATA[php7]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Laravel_learn]]></dc:creator>
            <pubDate>Wed, 21 Dec 2022 12:07:53 GMT</pubDate>
            <atom:updated>2022-12-21T12:17:30.179Z</atom:updated>
            <content:encoded><![CDATA[<p>Sometimes I get confused about small things.</p><p>Hey, take a look at this example.</p><p>If I have a directory named phpfiles. In this directory if I have only 2 files one is abc.txt and second is abc2.txt.</p><p>So if you’re using Windows, you’ve probably seen a box bar at the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*5QRwGk0Wiqw4Zt1pDZ2i9w.png" /></figure><h4><strong>So let’s say if I want to access a file, I’ll just use this bar.</strong></h4><p>To access abc.txt I will put C:\Users\example user\Desktop\phpfiles\abc.txt</p><p>I have opened this file without any error.</p><p>so it’s OK</p><p>But if I change this url it will definitely show me the error that this file does not exist.</p><p>Same thing happens in php script when we want to put a file in a directory and we put URL of the directory path with filename but the file doesn’t exist yet so why doesn’t it show errors.</p><h4><strong>Let’s see the example:</strong></h4><p><strong>$temp_file = $_FILES[‘file’][‘tmp_name’];<br>$target_dir = ‘/path/to/phpfiles/’;<br>$target_file = $target_dir . basename($_FILES[‘file’][‘name’]);</strong></p><h4><strong>After that we used</strong></h4><p>move_uploaded_file($temp_file, $target_file)</p><p>So that means the file doesn’t exist but we are calling it before moving it. <strong>$target_file = $target_dir . basename($_FILES[‘file’][‘name’]);</strong></p><h4>Here, how I solved this confusion. let’s’ see</h4><p>First, let’s start with the basics. When a user uploads a file using a form on a web page, the file is temporarily stored on the server in a <strong>special location</strong>. This is done to ensure that the file is fully <strong>uploaded</strong> before it is moved to its final destination. The temporary location of the uploaded file is specified by the tmp_name element of the $_FILES array, which is a global array that contains all the information about uploaded files.</p><p>Now, let’s say you want to move the uploaded file from its temporary location to a new destination on the server. This is where the move_uploaded_file function comes in. This function is used to move an uploaded file from its temporary location to a new location on the server.</p><p>To use move_uploaded_file, you need to specify two things: the current location of the file (i.e., the temporary location on the server), and the new location where you want to move the file. The first argument to the function (the current location of the file) is specified using the tmp_name element of the $_FILES array, while the second argument (the new location) is specified using a variable that you define in your script.</p><p>1 When a user uploads a file using a form on a web page, the file is temporarily stored on the server in a special location.</p><p>2 The PHP $_FILES array is a global array that contains information about the uploaded file, such as its name and temporary location on the server.</p><p>3 The move_uploaded_file function is used to move the uploaded file from its temporary location to a new location on the server.</p><p>4 To use move_uploaded_file, you need to specify two things: the current location of the file (i.e., the temporary location on the server), and the new location where you want to move the file.</p><p>5 The move_uploaded_file function returns true if the file was successfully moved, and false if there was an error.</p><p>So our whole confusion is about the $target_file we specified.</p><blockquote><strong>$target_file = $target_dir . basename($_FILES[‘file’][‘name’]);</strong></blockquote><p>The $target_file variable is used to specify the final destination of the uploaded file on the server. It is constructed by concatenating the $target_dir variable (which specifies the target directory on the server where the file should be moved to) with the base name of the uploaded file (obtained from $_FILES[&#39;file&#39;][&#39;name&#39;]).</p><p>The base name of the uploaded file is the file name without any preceding directories. For example, if the file is named “example.txt” and it is located in the “documents” directory, the base name of the file would be “exampled”.</p><p>The $target_file variable is used in conjunction with the move_uploaded_file function, which is used to move the uploaded file from its temporary location on the server to the final destination specified by the $target_file variable.</p><p><strong>So that was the only point.</strong></p><p><strong>At the time the </strong><strong>$target_file variable is constructed, the file itself has not yet been moved to the target directory. The </strong><strong>$target_file variable is simply being constructed in preparation for the file move, which occurs later in the script when the </strong><strong>move_uploaded_file function is called.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7438a3dba883" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel features for Development & Easier building]]></title>
            <link>https://geofindblog.medium.com/laravel-features-for-development-easier-building-32300c8d7fc4?source=rss-38b342a563e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/32300c8d7fc4</guid>
            <category><![CDATA[laravel8]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[laravel-development]]></category>
            <dc:creator><![CDATA[Laravel_learn]]></dc:creator>
            <pubDate>Fri, 18 Nov 2022 05:52:30 GMT</pubDate>
            <atom:updated>2022-11-18T05:52:30.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VTx7ZqQRkkmfDHGN9Msz1A.png" /></figure><p>There are many new features in Laravel 9 that make web development more powerful than ever.</p><p>With these new features, you can really speed up your app development process and spend less time on building it, instead focus on what matters most: building great stuff!</p><p>Built-in authentication with a simple, yet powerful, Eloquent model. You just need to create a table in your database and then use the built-in ORM to make sure that every user has their own unique ID. Modern front end components for AngularJS and VueJS developers who want to use something other than plain HTML/CSS for their templates (like Bootstrap). This makes it easier for all developers on your team who don’t know HTML/CSS by default but do know JavaScript or PHP!</p><blockquote>One of the best features of Laravel is its built-in command line interface (CLI). The CLI allows you to quickly scaffold new projects, run migrations and generate scaffolding for your models</blockquote><p>You can use the new features to build more secure apps. By default, Laravel has built-in encryption mechanisms for transporting your data over the network and storing sensitive information in a database. This means that you don’t need to worry about security as much as with other frameworks — but still be sure to take precautions when handling sensitive data such as credit card numbers or social security numbers! You can use the new features to build more scalable apps.</p><h4>Multiple Language Files</h4><p>One of the most powerful new features in Laravel 9 is the ability to use multiple language files. This means that you can now create a separate language file for each section of your website. This is extremely helpful for large websites that need to support multiple languages.</p><p>For example, let’s say you have a website with three sections: a blog, a forum, and a shop. Previously, you would have had to create one language file for the entire website. However, with Laravel 9, you can now create a separate language file for each section. This makes it much easier to manage your website’s language files.</p><h4>New Routing System</h4><p>Another exciting new feature in Laravel 9 is the new routing system. This system makes it easier to create and manage routes. It also makes it easier to create RESTful APIs.</p><p>Previously, creating a RESTful API was a bit of a hassle. However, with the new routing system, it’s much easier. You can now easily create routes that return JSON data. This makes it much easier to create APIs that can be used by mobile apps or other websites.</p><h4>Final thoughts</h4><p>Laravel 9 is a powerful new web development framework that includes many exciting new features. We explored two of the most powerful new features: the ability to use multiple language files and the new routing system. These two features alone make Laravel 9 a powerful tool for web developers.</p><p>If you have any questions about this guide or want more information about Laravel 9, please don’t hesitate to reach out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32300c8d7fc4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Headless Laravel vs WordPress, Which Should You Choose?]]></title>
            <link>https://geofindblog.medium.com/headless-laravel-vs-wordpress-which-should-you-choose-8116d1b8ab0d?source=rss-38b342a563e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/8116d1b8ab0d</guid>
            <category><![CDATA[headless]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[laravel-headless]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Laravel_learn]]></dc:creator>
            <pubDate>Fri, 11 Nov 2022 10:26:25 GMT</pubDate>
            <atom:updated>2022-11-11T10:39:29.590Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xY6SG6xbavwjXdXqJUb35A.png" /><figcaption>Laravel vs WordPress</figcaption></figure><p>So, you’re considering a CMS for your next project. Great! But which one should you choose? WordPress or Laravel?</p><p>Both platforms have their pros and cons, but in the end, the decision comes down to what works best for your specific needs. Here’s a breakdown of some of the key differences between WordPress and Laravel:</p><h3>What Is WordPress?</h3><p>WordPress is a content management system (CMS). What that means is that it’s a platform that you can use to create and manage your website’s content. It’s the most popular CMS in the world, and for good reason — it’s easy to use, and it has a huge community of developers and users who can help you out if you need it.</p><p>WordPress is based on a template system, which means that you can choose a pre-made template or theme for your site, or you can create your own. And once you have your template set up, adding new content is a breeze. You just need to log in to your WordPress dashboard, add your content, and hit publish.</p><p>The other thing that makes WordPress, so popular is its flexibility. You can use it to create any type of website you want, from a simple blog to a full-blown ecommerce store.</p><h3>What Is Headless Laravel?</h3><p>So what is this headless thing all the Laravel people are talking about? In a nutshell, it’s a way to use Laravel as a backend for your web application, while using a different front-end framework for your user interface.</p><p>It’s a great option if you want the flexibility to use different frameworks for different parts of your application. For example, you might want to use React for your main interface, while using Vue.js for your admin area.</p><p>And if that’s something that interests you, keep reading — I’m going to compare WordPress and Laravel in more detail and help you decide which one is right for you.</p><h3>Key Differences Between WordPress and Laravel</h3><p>So, what are the key differences between WordPress and Laravel? Here’s a quick overview:</p><p>WordPress is more popular, with a larger user base and more plugins and themes available. It’s also easier to use, making it a good choice for businesses that want a simple website without too much custom coding.</p><p>Laravel is more complex and requires more technical knowledge, but it offers more flexibility and can be tailored to create more complex websites. It’s also faster and more secure than WordPress.</p><p>So, which one is right for you? That depends on your needs and your level of technical expertise. If you’re not sure, it might be a good idea to consult with a web developer to help you make the right decision.</p><h3>Which One Should You Choose?</h3><p>So, you’re trying to decide between WordPress and Laravel? It can be tough to decide, but don’t worry, we’re here to help. In this article, we’ll take a look at the pros and cons of each platform, so you can make an informed decision.</p><p>First, let’s start with WordPress. WordPress is the most popular CMS in the world, and for good reason — it’s easy to use, and it’s very versatile. You can use it for everything from a simple blog to a full-blown ecommerce website.</p><p>Laravel, on the other hand, is a more modern platform that’s built for speed and flexibility. It’s perfect for larger websites with more complex requirements. However, it can be a little more difficult to use than WordPress.</p><p>So, which one should you choose? It really depends on your needs and what you’re trying to achieve. If you’re looking for a simple website that doesn’t require too much complexity, then WordPress is the way to go. If you need a more robust platform with more features and flexibility, then Laravel is the better option.</p><h3>Conclusion</h3><p>In the end, the right CMS for you will come down to your specific needs and preferences. If you’re looking for a user-friendly platform that’s great for beginners, WordPress is a good option. If you’re looking for more flexibility and power, Laravel may be a better choice.</p><p>No matter which platform you choose, make sure to do your research and find a reputable developer to help you get the most out of your CMS. With the right tools and knowledge, you can create a website that meets your exact needs and fulfills your every ambition.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8116d1b8ab0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tips to Know You in Laravel]]></title>
            <link>https://geofindblog.medium.com/tips-to-know-you-in-laravel-58afd90ee4cd?source=rss-38b342a563e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/58afd90ee4cd</guid>
            <category><![CDATA[laravel-development]]></category>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php-developers]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Laravel_learn]]></dc:creator>
            <pubDate>Sat, 08 Oct 2022 21:21:33 GMT</pubDate>
            <atom:updated>2022-10-08T21:21:33.216Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X-Ygr5noLagpd14WdKYyIQ.png" /></figure><h4>How fluent Class can reduce your time usage.</h4><p>A fluent class is a good way to get your variable-store data as an array.</p><p>A fluent class is a General structure</p><p>This means that we can now handle data fluently and easily.</p><p>Ok, How to use it.</p><h4>use Illuminate\Support\Fluent;</h4><blockquote>$data = [‘name’ =&gt; ‘John’];</blockquote><blockquote>$data = new Fluent($data);</blockquote><blockquote>return the name or default name</blockquote><blockquote>return $data-&gt;get(‘name’, ‘Robbert’);</blockquote><h4>Return 403</h4><p>If you want to return a 403 error and you use like this</p><blockquote>$example = $example::find($id);</blockquote><blockquote>if($example == null){</blockquote><blockquote>abort(403);</blockquote><blockquote>}</blockquote><blockquote>return $example;</blockquote><p>But how to return 403 without an if condition?</p><blockquote>$example = Category::where(‘id’, $id)-&gt;firstOr(fn () =&gt;abort(403));</blockquote><h4>You want to return the last day’s data from the database.</h4><blockquote>example::where(‘created_at’ , ‘’, now()-&gt;subDay())-&gt;get();</blockquote><h4>But how can we shorten this line of code?</h4><p>We can shorten this line of code by using resent()</p><blockquote>User::recent()-&gt;get();</blockquote><h4>Are you using faker in laravel? but haven’t created an image from faker?</h4><p>Good news you can now create fake photos by using an user image.</p><blockquote>$factory-&gt;define(User::class, function (Faker $faker)){</blockquote><blockquote>return [</blockquote><blockquote>‘name’=&gt; $faker-&gt;name,</blockquote><blockquote>‘UserImage’ =&gt; $faker-&gt;image(storge_path(‘image’), 50, 50);</blockquote><blockquote>]</blockquote><blockquote>}</blockquote><h4>Result:</h4><p>Know that you’ve learned four tricks that can help you make your code faster and easier.</p><p><strong>Everything we do is practice for something bigger than where we are right now. Practice only leads to improvement.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58afd90ee4cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Something you need to know in Laravel]]></title>
            <link>https://geofindblog.medium.com/something-you-need-to-know-in-laravel-41cc40327464?source=rss-38b342a563e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/41cc40327464</guid>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[laravel8]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[laravel-development]]></category>
            <dc:creator><![CDATA[Laravel_learn]]></dc:creator>
            <pubDate>Mon, 03 Oct 2022 05:47:46 GMT</pubDate>
            <atom:updated>2022-10-03T05:47:46.724Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SS4G-Al0js9aW82gjQNXAQ.png" /></figure><p><strong>Let’s start with validation.</strong><br>Validation is necessary when you want some specific information from the user as per your requirement. Validating forms is an important part of any web application, as it ensures that the user input is clean and complete before performing any actions on it.</p><h4>Here’s how you can add validation to your user data.</h4><blockquote>$validatedData = $request-&gt;validate([<br> ‘name’ =&gt; ‘required|max:255’,<br> ‘price’ =&gt; ‘required’,<br> ]);</blockquote><p><strong>Find data</strong></p><p><strong>To search data from the database in laravel application</strong></p><blockquote>$example = Exapmle::findOrFail($id);</blockquote><blockquote>$example = database::find($id);</blockquote><p><strong>Save data into the database</strong></p><blockquote>$example-&gt;email = $data[&#39;email&#39;];<br> $example-&gt;save();</blockquote><p><strong>How to delete Two different ways</strong></p><blockquote>example::where(‘id’,$id)-&gt;delete();</blockquote><blockquote>use DB;</blockquote><blockquote>DB::delete(‘delete from example where id = ?’,[$id]);</blockquote><p><strong>Two different ways to select all data from a database</strong></p><blockquote>use DB;</blockquote><blockquote>$users = DB::select(‘select * from example’);</blockquote><blockquote>$user = user::all();</blockquote><p><strong>Putting data into a session in a Laravel application</strong></p><p>There are many ways to put data into a session in a Laravel application.</p><p>But here we will use simple.</p><blockquote>$req-&gt;session()-&gt;put(‘user’,$user);</blockquote><p>Here we are calling the function that after login the username will enter the session.</p><p><strong>Destroying Sessions</strong></p><p>If the user doesn’t log out, then the Session object remains active. To destroy the existing Session object, use the following code:</p><p>\Session::flush(); // Empty the Session Cache</p><p>// \Session::forget(‘user_id’); // Clear just one specific Session variable</p><p><strong>Result</strong></p><p>Hope you learned something if you got something new keep it in mind and always learn something new in Laravel.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41cc40327464" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel artisan command to Know]]></title>
            <link>https://geofindblog.medium.com/laravel-artisan-command-to-know-e570f24b651c?source=rss-38b342a563e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e570f24b651c</guid>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[laravel8]]></category>
            <category><![CDATA[laravel-development]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Laravel_learn]]></dc:creator>
            <pubDate>Sat, 01 Oct 2022 10:29:50 GMT</pubDate>
            <atom:updated>2022-10-01T10:34:56.671Z</atom:updated>
            <content:encoded><![CDATA[<h4>Laravel’s php artisan CLI can do a lot of things, but one of its most useful functions is the ability to quickly generate boilerplate code for new controllers, models, and database migrations.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*72D-FNh4gbfn3DYfkbgFiA.png" /></figure><blockquote>In this blog post, we’ll take a look at some of the most commonly used php artisan commands to help you get started with Laravel development.</blockquote><p>Laravel’s Artisan command line interface (CLI) extends Symfony’s Console component, providing a more powerful and convenient experience for tasks such as database migrations, seeding, and package management.</p><h4>php artisan</h4><p>The php artisan command is the entry point for all Artisan commands. This command can be used to list all available Artisan commands or to execute a specific Artisan command.</p><h4>php artisan make:controller:</h4><p>This command will generate a new controller class for you.</p><h4>php artisan make:model:</h4><p>This command will generate a new model class for you.</p><h4>php artisan make:migration:</h4><p>This command will generate a new database migration file for you.</p><h4>php artisan migrate:</h4><p>This command is used for pending database migration.</p><h4>php artisan serve:</h4><p>This command is used to start the development server for you.</p><h4>PHP artisan make:model example -m</h4><p>The above command is used to create a model and migration at the same time.</p><blockquote>Commands to install Bootstrap in a Laravel application.</blockquote><h4>Configure Bootstrap</h4><blockquote>1) laravel/ui<br>2) composer require laravel/ui<br>3) php artisan ui bootstrap<br>4) npm install bootstrap<br>5) php artisan ui bootstrap — auth for login page authentication</blockquote><h4>php artisan make:model example -mcr</h4><p>Creating a model plus migration plus controller command at the same time</p><h4>php artisan make:model Product -c</h4><p>Create model and controller in one command</p><h4>php artisan db:seed — class UserSeeder</h4><p>This command is used to insert seed data into the database.</p><h4>php artisan list</h4><p>For checking list of command.</p><h4>Result</h4><p>These are just a few of the most commonly used php artisan commands. For a full list of available commands, you can run php artisan — help from the command line.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e570f24b651c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Laravel Tips for Beginners dude]]></title>
            <link>https://geofindblog.medium.com/laravel-tips-for-beginners-dude-20490fb30a91?source=rss-38b342a563e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/20490fb30a91</guid>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[php-developers]]></category>
            <category><![CDATA[laravel-framework]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Laravel_learn]]></dc:creator>
            <pubDate>Fri, 30 Sep 2022 07:55:54 GMT</pubDate>
            <atom:updated>2022-10-01T09:12:40.480Z</atom:updated>
            <content:encoded><![CDATA[<p>Ok we are going to master everything about Laravel without having to pay for a pro</p><p>This is getting started so let’s walk you through how to create a project in Laravel. Warning You must know some basics of Laravel.<br>Than you should start your journey from here.</p><h4>1 Creating a project command</h4><p>Composer Create-Project Laravel / Laravel App</p><p>This command is used to create a laravel project.</p><h4>You: I know this.</h4><blockquote>Me: Oh, I know too.</blockquote><h4>2 Look at the structure of the laravel, how cute isn’t it?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*CaOOSAd8ed9peY1VlYm5kQ.png" /></figure><p>If you are older then don’t worry,</p><p>It’s exactly like when you create your project in core php you create folder and file so you can easily work. The same thing laravel is using in its structure. No need to know everything about it, we’ll talk more, don’t worry.</p><h3>3 $table-&gt;</h3><p>Do you know what this thing is? It’s a very dangerous thing.<br>Look how sharp his form is that thing I called oh arrow I know.<br>He uses it to say what he wants. I have seen this thing Laravel migration file. Because migration requires it to add something.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/1*W_88ibvo9yuT-AzfVRindw.png" /><figcaption>migration file</figcaption></figure><h3>Sorry I forget the first step.</h3><p>If you don’t know how to install the Laravel application on your computer, check here<br>First, go and install<br>Composer<br>If you don’t know how to install Composer.<br>Search on Google and you will see what you have to do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*gOR_eNV4GmsZMwzpyHn3UQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*_pl02ojGsrJIZGP-BbUIJg.png" /></figure><p>You know how to click the download button. don’t you know</p><h4>You are now a toddler in learning Laravel. But you will soon become a Laravel developer dad, don’t worry.</h4><blockquote>Alright</blockquote><h4>php artisan make:controller GameController — resourse.</h4><p>This thing is great, the command line is used to create a crud controller without struggle, isn’t it fun? Try it in your Laravel project and create a crude controller without writing a single code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*f7baS8YioGT0EHuX-Yj8wg.png" /></figure><h3>So what have you learned?</h3><p>You have learned.</p><p>1 This command) php artisan make:controller GameController — resourse.</p><p>2 This command) Composer Create-Project Laravel / Laravel App</p><p>3 How to install composer</p><p>4 $table-&gt;</p><h3>Result.</h3><p>Now you are good and have learned more than a starter. Well if there is a next post then this is probably the next tutorial if not. Please wait. We will win. The sea remains.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20490fb30a91" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>