marouanaf

Member Since 2 Years Ago

Experience Points
5,590
Total
Experience

4,410 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
34
Lessons
Completed
Best Reply Awards
1
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 2
5,590 XP
Jun
06
6 days ago
Activity icon

Replied to Send Session To View Not Working

Hi @ethar, @silencebringer pointed you correctly, to retrieve the data that you send you can use the following code, otherwise you can check the link that @silencebringer mentioned to learn how to pass it via the session

@if(!empty($message))
  <div class="alert alert-success"> {{ $message }}</div>
@endif
Activity icon

Awarded Best Reply on Problems Validating Foreign Key With Validate Method

I think we still have a typo here

 'category_id' => 'required'|'exists:categories,id',

try this one:

 'category_id' => 'required|exists:categories,id',

the | should be inside the quotes

Activity icon

Replied to Problems Validating Foreign Key With Validate Method

I think we still have a typo here

 'category_id' => 'required'|'exists:categories,id',

try this one:

 'category_id' => 'required|exists:categories,id',

the | should be inside the quotes

Activity icon

Replied to Problems Validating Foreign Key With Validate Method

Hi @head0nf1re , I assume you have an id field in your categories table, if yes, then the following line:

 'category_id' => 'required'|'exists:categories,category_id',

should be:

 'category_id' => 'required'|'exists:categories,id',
Jun
05
1 week ago
Activity icon

Replied to Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

Yes, the same, a 404, is that can be considered enough, or do you suggest more tests regarding that? or maybe some other things to check? Thanks in advance @snapey

Activity icon

Replied to Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

Hi, @snapey yes, I did edit the document root and remove that line from the .htaccess file and it's perfect now.

for your question about the .env file, now I did not, the structure of my files are as follow:

/var/www/html 

the html folder (I should change the name of that file I think :-) ) contains my Laravel app in its normal structure (contains the app, public, resources, vendor... directories and .env ... files)

When I run the following command

stat -c %a .env

I get 644, but I think that the permission for the webserver owner right? How can I best check if a file of my app is exposed, because when I try for example https://mydomain.ltd/env I get a 404 so is that enough, or do I need another way of checking? thank you in advance

Jun
03
1 week ago
Activity icon

Awarded Best Reply on Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

@tykus & @martinbean thank you so much for your help it appeared that the problem was actually caused by a line that I added in my public folder when I was adding the forceSSl code this line of code removes public from the url (copied from stockoverflow)

    # Remove public folder form URL
    RewriteRule ^(.*)$ public/ [L]
Activity icon

Replied to Laravel On Vultr

Hi @jamesyoung , thank you so much for your reply, yesterday and today I was playing with it a little bit and I actually figured out how this works, it's pretty much what you said, especially the DocumentRoot part, so thank you ;)

Activity icon

Replied to Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

@tykus & @martinbean thank you so much for your help it appeared that the problem was actually caused by a line that I added in my public folder when I was adding the forceSSl code this line of code removes public from the url (copied from stockoverflow)

    # Remove public folder form URL
    RewriteRule ^(.*)$ public/ [L]
Activity icon

Replied to Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

Hi @martinbean I checked several times, they exist, all was normal until I added the certificate.

Activity icon

Replied to Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

exactly,

GET https://mydomain.tld/css/style.bundle.css net::ERR_ABORTED 404 (Not Found)
Activity icon

Replied to Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

my-domain/css/....css That didn't change after adding the certificate

Activity icon

Replied to Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

{{ asset('media/logos/favicon.ico') }}

{{ asset(css/style.bundle.css) }}

Activity icon

Replied to Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

Hi @tykus

I tried using secure_asset helper but it's not working either

and yes I did correct the APP_URL after you mentioned it but in vain

Activity icon

Started a new Conversation Laravel Assets Not Working After Let's Encrypt ON PRODUCTION

Hi All,

I just activated the Let's Encrypt certificate on my apache server on Vultr as described here:

https://www.vultr.com/docs/setup-letsencrypt-on-linux

the certificate is working as expected but now all the links to the public assets are not working anymore so no CSS or images are appearing on my web app.

would you please share your ideas about the problem with me?

Thanks in advance

Jun
02
1 week ago
Activity icon

Started a new Conversation Laravel On Vultr

Hi,

I have a cloud hosting on vultr, I installed apache, php, node js, composer and cloned my app from my git repo then I run composer install and npm run production and all went well. this is my /var/www/ stracture :

/var/www/html

inside the html directory there is

 laravel app directory, html file, index.html file and index.save file

when I access my ip adress on the browser I keep seing the apache default page which I find logic as I did not cahnge that.

my question here is how to change that and point the ip adress to my laravel app index.php page?

also I want to let you know that I can access the app files in the url by accessing myip/my-app-name which is not safe and neither correct

so could you please give me some guidlines to what to do

thanks in advance

May
31
1 week ago
Activity icon

Started a new Conversation Vultr For My Laravel & Vue Js App

Hi All,

I just finished the creation of a web app (ERP), I want to take your opinion about hosting my app on Vutlr, what is the best plan that they offer (taking into consideration the scalability as we may have a lot of clients which means that we will use the hosting to host the same app for many clients).

I'm also wondering about what CloudWAys offers as a plus if I used it!

Thanks

May
21
3 weeks ago
Activity icon

Replied to Tailwind Css With Vue Js

Thank you @tykus your answer was exactly what I needed to understand! for Bootstrap-Vue (not only bootstrap) it's a library that provides some components that I used to use especially the table component, it makes things easy for me (filtering, ordering .. data in the table) do you suggest any alternatives that provide the same thing with but not based on bootstrap? https://bootstrap-vue.org/docs/components

Activity icon

Started a new Conversation Tailwind Css With Vue Js

Hi Every one,

I was trying to use tailwind CSS for one of my recent projects with Vue js and Laravel, But As I read on the docs.

These libraries and Tailwind UI itself all require Vue 3+. We do not currently offer support for Vue 2.

I used it with a Vue 3 project (the first time I used Vue 3) but I found some libraries that do not support Vue 3 yet like bootstrap-Vue.

My question is, have anyone tried working with Tailwind CSS alongside Vue 2? is this possible and does not pose any problems of support?

Thanks!

May
13
4 weeks ago
Activity icon

Awarded Best Reply on Phpunit Command Not Working

Thank you fo the aswers guys

@manelgavalda Actualy I tried doskey command and It works

doskey phpunit=php vendor/phpunit/phpunit/phpunit

but as you said I want it to be permanent, but I didn't find the bash file to edit it

I am using windows by the way

Activity icon

Awarded Best Reply on Laravel Enso Datatables With Vuejs

For anyone who has the same question, I actually didn't use Laravel Enso data tables for this project, I used Bootstrap Vue b-table for this, and for the pagination, I used a laravel-vue-pagination, It worked perfectly for my needs ;)

Activity icon

Replied to Laravel Enso Datatables With Vuejs

For anyone who has the same question, I actually didn't use Laravel Enso data tables for this project, I used Bootstrap Vue b-table for this, and for the pagination, I used a laravel-vue-pagination, It worked perfectly for my needs ;)

May
12
1 month ago
Activity icon

Replied to Laravel Authentication With Vue JS On The Frontend

Thank you @martinbean for your quick response, would you please explain to me why it's best for this situation and whether I'm forced to change to Sanctum and build a login Vue component or it's secure to let it as it is currently, the most important to me right now is the security of my app and also not to change to something that may take me extra time but without a real benefit? Thanks in advance

Activity icon

Started a new Conversation Laravel Authentication With Vue JS On The Frontend

Hi All,

I have a question regarding an application that I'm working on currently, I'm using Laravel (V6) on the backend and Vue js (V2) on the front end, my question is about the authentication, I'm using the default authentication provided by Laravel (please see my auth.php file below), my routes are on web.php and I also put

Route::get('/{any}', "[email protected]")->where('any', '.*')->middleware('auth');;

I'm using a Vue router, so the only thing I used Laravel Blade for is the login page and the master page (layouts) that contains my SPA, so is that OK and totally secure? or should I implement the login also as a Vue component and use a driver like Sanctum to implement the login?

I don't know if my questions are clear but please correct me and guide me to an article if I mentioned anything irrelevant.

<?php

use App\User;

return [

    /*
    |--------------------------------------------------------------------------
    | Authentication Defaults
    |--------------------------------------------------------------------------
    |
    | This option controls the default authentication "guard" and password
    | reset options for your application. You may change these defaults
    | as required, but they're a perfect start for most applications.
    |
    */

    'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

    /*
    |--------------------------------------------------------------------------
    | Authentication Guards
    |--------------------------------------------------------------------------
    |
    | Next, you may define every authentication guard for your application.
    | Of course, a great default configuration has been defined for you
    | here which uses session storage and the Eloquent user provider.
    |
    | All authentication drivers have a user provider. This defines how the
    | users are actually retrieved out of your database or other storage
    | mechanisms used by this application to persist your user's data.
    |
    | Supported: "session", "token"
    |
    */

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'token',
            'provider' => 'users',
            'hash' => false,
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | User Providers
    |--------------------------------------------------------------------------
    |
    | All authentication drivers have a user provider. This defines how the
    | users are actually retrieved out of your database or other storage
    | mechanisms used by this application to persist your user's data.
    |
    | If you have multiple user tables or models you may configure multiple
    | sources which represent each model / table. These sources may then
    | be assigned to any extra authentication guards you have defined.
    |
    | Supported: "database", "eloquent"
    |
    */

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],

        // 'users' => [
        //     'driver' => 'database',
        //     'table' => 'users',
        // ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Resetting Passwords
    |--------------------------------------------------------------------------
    |
    | You may specify multiple password reset configurations if you have more
    | than one user table or model in the application and you want to have
    | separate password reset settings based on the specific user types.
    |
    | The expire time is the number of minutes that the reset token should be
    | considered valid. This security feature keeps tokens short-lived so
    | they have less time to be guessed. You may change this as needed.
    |
    */

    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_resets',
            'expire' => 60,
        ],
    ],

];

Thank you in advance!