<?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: Priyank Patel</title>
    <description>The latest articles on DEV Community by Priyank Patel (@human_priyank).</description>
    <link>https://dev.to/human_priyank</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F799384%2F5320beac-34d9-492c-a24a-cc017b02023d.jpg</url>
      <title>DEV Community: Priyank Patel</title>
      <link>https://dev.to/human_priyank</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/human_priyank"/>
    <language>en</language>
    <item>
      <title>Laravel 8 Paths Helpers - Explained</title>
      <dc:creator>Priyank Patel</dc:creator>
      <pubDate>Thu, 20 Jan 2022 14:41:43 +0000</pubDate>
      <link>https://dev.to/human_priyank/laravel-8-paths-helpers-explained-2k14</link>
      <guid>https://dev.to/human_priyank/laravel-8-paths-helpers-explained-2k14</guid>
      <description>&lt;p&gt;Laravel 8 has a lot of helper functions which provide a convenient way of working with strings, arrays and paths. It is almost impractical to know them all. Many developers know the most common ones, but there are some useful helpers if you dig a little deep inside documentations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Why to use Path Helpers in Laravel ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article, I will be explaining you about each one of them, Why we use them? In what situaton's do we need to use this laravel helper functions? all with practical code examples of using PATHS in Laravel 8.&lt;/p&gt;

&lt;p&gt;There are in total 8 in-built Path Helper functions provided by Laravel 8 Framework. These are basically &lt;em&gt;php&lt;/em&gt; methods which are very helpful while providing file downloads to your user or you want to show full url of the resource on the server to the user or admins there are many use cases that's why "Helpers" it is named...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 - app_path()&lt;/strong&gt; - The app_path function returns the fully qualified path to your application's &lt;em&gt;app&lt;/em&gt; directory. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2 - base_path()&lt;/strong&gt; - The base_path function returns the fully qualified path to your application's &lt;em&gt;root&lt;/em&gt; directory. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3 - config_path()&lt;/strong&gt; - The config_path function returns the fully qualified path to your application's &lt;em&gt;config&lt;/em&gt; directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4 - database_path()&lt;/strong&gt; - The database_path function returns the fully qualified path to your application's &lt;em&gt;database&lt;/em&gt; directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5 - mix()&lt;/strong&gt; - The mix function returns the path to a &lt;a href="https://laravel.com/docs/8.x/mix#versioning-and-cache-busting"&gt;versioned Mix file&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6 - public_path()&lt;/strong&gt; - The public_path function returns the fully qualified path to your application's &lt;em&gt;public&lt;/em&gt; directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7 - resource_path()&lt;/strong&gt; - The resource_path function returns the fully qualified path to your application's &lt;em&gt;resources&lt;/em&gt; directory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8 - storage_path()&lt;/strong&gt; - The storage_path function returns the fully qualified path to your application's &lt;em&gt;storage&lt;/em&gt; directory.&lt;/p&gt;

&lt;p&gt;Final thoughts - This is a very basic need of every Laravel application, to find the exact path of the files or resources on the server. Here Laravel provides an easy way to get those info and show it in frontend. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;PRO TIP&lt;/em&gt;&lt;/strong&gt; - &lt;br&gt;
You can use these path helpers in route file to get the path.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//How to get base path(Project Root) in Laravel ?
base_path();

**For usage in route file**
Route::get('/', function () {
    return base_path();
});

//How to get storage folder path in Laravel ?
storage_path(); 

//How to get app folder path in Laravel ?
app_path(); 

//How to get config folder path in Laravel ?
config_path(); 

//How to get datbase folder path in Laravel ?
database_path(); 

//How to get Mix Versioned File path in Laravel ?
mix(); 

//How to get public folder path in Laravel ?
public_path(); 

//How to get resource folder path in Laravel ?
resource_path()

//How to get storage folder path in Laravel ?
storage_path()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can bookmark this page for any future references on Path Helper Functions as i will be updating this article in future with more new releases from Laravel Framework.&lt;/p&gt;

&lt;p&gt;Connect with me on &lt;a href="https://dev.to/ticketmaster"&gt;Dev.to&lt;/a&gt; and &lt;a href="https://twitter.com/human_priyank"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>todayilearned</category>
      <category>beginners</category>
      <category>php</category>
    </item>
    <item>
      <title>Laravel Top Tip of the Week!</title>
      <dc:creator>Priyank Patel</dc:creator>
      <pubDate>Wed, 19 Jan 2022 19:02:25 +0000</pubDate>
      <link>https://dev.to/human_priyank/laravel-top-tip-of-the-week-2n3g</link>
      <guid>https://dev.to/human_priyank/laravel-top-tip-of-the-week-2n3g</guid>
      <description>&lt;p&gt;Hello Friends ! This is my top tips for sentient Laravel developers out there ! By the way, I will be sharing these top tips every week, so don't forget to follow me on &lt;a href="https://twitter.com/human_priyank"&gt;@Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You must have been thinking why i must read these article when there are thousands of them out there on internet. But here we follow some structure to provide the top tips, and I have structured it in such a manner that the reader should be able to know &lt;strong&gt;WHEN TO USE IT&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Question/Situation&lt;/em&gt;&lt;/strong&gt; - You want to know How to send more than one http request in Laravel? In other words, you want several requests to be dispatched at the same time instead of issuing the requests sequentially. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Answer&lt;/em&gt;&lt;/strong&gt; - TopTip #1 &lt;br&gt;
You might think about running http requests concurrently to improve performance. The HTTP client's 'pool' method makes this a trivial exercise.&lt;/p&gt;

&lt;p&gt;The pool method accepts a closure which receives an Illuminate\Http\Client\Pool instance, allowing you to easily add requests to the request pool for dispatching.&lt;/p&gt;

&lt;p&gt;Here's how you can use it !&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r7Bi0jNM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iyr876ziicfh9jgtn1bc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r7Bi0jNM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iyr876ziicfh9jgtn1bc.png" alt="Laravel pool method code snippet" width="880" height="661"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Final Thoughts - This was my first attempt on Dev.to and infact sharing something I feel is valuable and helpful for you people.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>webdev</category>
      <category>todayilearned</category>
      <category>todayisearched</category>
    </item>
  </channel>
</rss>
