<?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: Ayoub</title>
    <description>The latest articles on DEV Community by Ayoub (@adev03).</description>
    <link>https://dev.to/adev03</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%2F590566%2F8c3f33c7-9759-48ff-9c34-15bd86384cc1.jpg</url>
      <title>DEV Community: Ayoub</title>
      <link>https://dev.to/adev03</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adev03"/>
    <language>en</language>
    <item>
      <title>How To use .env in Reactjs Vite</title>
      <dc:creator>Ayoub</dc:creator>
      <pubDate>Tue, 03 Oct 2023 11:56:14 +0000</pubDate>
      <link>https://dev.to/adev03/how-to-use-env-in-reactjs-m4n</link>
      <guid>https://dev.to/adev03/how-to-use-env-in-reactjs-m4n</guid>
      <description>&lt;h2&gt;
  
  
  To use .env in react :
&lt;/h2&gt;

&lt;p&gt;1.You need to create .env file .&lt;/p&gt;

&lt;p&gt;2.Open the .env file and declare your environment variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VITE_REACT_APP_NAME=react app
VITE_REACT_APP_CLIENT_ID=adkksclsc.cscd52

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: React enforces the prefix &lt;strong&gt;REACT_APP&lt;/strong&gt; on every custom variable. Variable without &lt;strong&gt;REACT_APP&lt;/strong&gt; is ignored. So always create a custom variable like &lt;strong&gt;REACT_APP_CUSTOM_VARIABLE&lt;/strong&gt;.&lt;br&gt;
But if you are using vite you need to add the prefix vite .&lt;/p&gt;

&lt;p&gt;3.Now to print your environment variable you need to put process.env before your custom variable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{process.env.REACT_APP_NAME}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Now start your application npm start and refresh the browser to see the changes.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🚀 Discover Comprehensive Programming Language Roadmaps at roadmap.sh</title>
      <dc:creator>Ayoub</dc:creator>
      <pubDate>Tue, 22 Aug 2023 18:48:57 +0000</pubDate>
      <link>https://dev.to/adev03/discover-comprehensive-programming-language-roadmaps-at-roadmapsh-1l38</link>
      <guid>https://dev.to/adev03/discover-comprehensive-programming-language-roadmaps-at-roadmapsh-1l38</guid>
      <description>&lt;p&gt;🚀 Check out this awesome website that provides programming language roadmaps! 🌐 It's a comprehensive resource to guide you through learning different programming languages. 📚 Start your coding journey today! 💻 &lt;br&gt;
&lt;a href="https://roadmap.sh/"&gt;https://roadmap.sh/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>webdev</category>
      <category>roadmas</category>
      <category>learning</category>
    </item>
    <item>
      <title>I don't Know why laravel doesn't regonize that the user that sending reqeust it logged in ?? Help</title>
      <dc:creator>Ayoub</dc:creator>
      <pubDate>Tue, 06 Jun 2023 09:14:58 +0000</pubDate>
      <link>https://dev.to/adev03/i-dont-know-why-laravel-doesnt-regonize-that-the-user-that-sending-reqeust-it-logged-in-help-45jd</link>
      <guid>https://dev.to/adev03/i-dont-know-why-laravel-doesnt-regonize-that-the-user-that-sending-reqeust-it-logged-in-help-45jd</guid>
      <description>&lt;p&gt;this is react code&lt;br&gt;
const token = sessionStorage.getItem("token")&lt;br&gt;
      const response = await&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;axios.post("http://127.0.0.1:8000/api/cours", values, {
        headers: {
          Accept: "application/json",
          "Content-Type": "application/json",
          Authorization: `Bearer ${token}`
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and this laravel block code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; public function store(CoursFormRequest $request)
    {
        if (!auth()-&amp;gt;check()) {
            return $this-&amp;gt;error("", "user is not loged in", 401);
        }
        $request-&amp;gt;validated($request-&amp;gt;all());
        $cours = new Course();
        $cours-&amp;gt;title = $request-&amp;gt;title;
        $cours-&amp;gt;description = $request-&amp;gt;description;
        $cours-&amp;gt;Duration = $request-&amp;gt;duration;
        $cours-&amp;gt;language = $request-&amp;gt;language;
        $cours-&amp;gt;price = $request-&amp;gt;price;
        $cours-&amp;gt;category = $request-&amp;gt;category;
        $cours-&amp;gt;user_id = Auth::user()-&amp;gt;id;
        $cours-&amp;gt;image = "test";
        $cours-&amp;gt;save();
        return new CoursResource($cours);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and this the route :&lt;br&gt;
Route::group(["middleware" =&amp;gt; ["auth:sanctum"]], function () {&lt;br&gt;
    Route::resource("/cours", CoursController::class);&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;the problem is with the Auth::user()-&amp;gt;id &lt;br&gt;
i get cannot read id on null &lt;br&gt;
So helpp&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>laravel</category>
      <category>php</category>
    </item>
    <item>
      <title>How to fix CORS problem when sending data with axios from React.js to Laravel.js?</title>
      <dc:creator>Ayoub</dc:creator>
      <pubDate>Sun, 04 Jun 2023 08:10:59 +0000</pubDate>
      <link>https://dev.to/adev03/how-to-fix-cors-problem-when-sending-data-with-axios-from-reactjs-to-laraveljs-47eh</link>
      <guid>https://dev.to/adev03/how-to-fix-cors-problem-when-sending-data-with-axios-from-reactjs-to-laraveljs-47eh</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzl0izfy3jhcs25zpjv6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzl0izfy3jhcs25zpjv6v.png" alt="Image description" width="800" height="23"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i am also using sanctum and sanctum should take care of the cors but nope i get the problem ?&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>laravel</category>
      <category>programming</category>
    </item>
    <item>
      <title>Hello , i need know if there is any library that makes this kind of calender (Help!!)</title>
      <dc:creator>Ayoub</dc:creator>
      <pubDate>Sun, 14 May 2023 18:38:22 +0000</pubDate>
      <link>https://dev.to/adev03/hello-i-need-know-if-there-is-any-library-that-makes-this-kind-of-clender-5k2</link>
      <guid>https://dev.to/adev03/hello-i-need-know-if-there-is-any-library-that-makes-this-kind-of-clender-5k2</guid>
      <description>&lt;p&gt;So if you don't know this you can recommende a library that give you the abbility to select the the day and the time in that day ,&lt;br&gt;
i trying to add reservation functionality &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzugwyp4euz5oc91tyalk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzugwyp4euz5oc91tyalk.png" alt="Image description" width="800" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>php</category>
    </item>
    <item>
      <title>how can i fix this issue</title>
      <dc:creator>Ayoub</dc:creator>
      <pubDate>Fri, 26 Aug 2022 17:10:31 +0000</pubDate>
      <link>https://dev.to/adev03/how-can-i-fix-this-issue-2l25</link>
      <guid>https://dev.to/adev03/how-can-i-fix-this-issue-2l25</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F33z28b0t3wggenet0l9c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F33z28b0t3wggenet0l9c.png" alt="Image description" width="428" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>OOP JAVASCRIPT PROBLEM !!!</title>
      <dc:creator>Ayoub</dc:creator>
      <pubDate>Wed, 25 May 2022 20:03:42 +0000</pubDate>
      <link>https://dev.to/adev03/oop-javascript-problem--8jj</link>
      <guid>https://dev.to/adev03/oop-javascript-problem--8jj</guid>
      <description>&lt;p&gt;how define the type of variable in constractor javascript oo&lt;br&gt;
Class Personne{&lt;br&gt;
constractor(name){&lt;br&gt;
this.name = name&lt;br&gt;
}&lt;br&gt;
}&lt;br&gt;
how can i make the name type string&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>help</category>
    </item>
    <item>
      <title>#javascript</title>
      <dc:creator>Ayoub</dc:creator>
      <pubDate>Sat, 21 May 2022 10:38:50 +0000</pubDate>
      <link>https://dev.to/adev03/javascript-3nb1</link>
      <guid>https://dev.to/adev03/javascript-3nb1</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn82i7f9acu3qg2al1rbl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn82i7f9acu3qg2al1rbl.png" alt="Image description" width="614" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
