RachidLaasri

RachidLaasri

Member Since 4 Years Ago

Rabat, Morocco

Experience Points 190,235
Experience Level 39

4,765 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 6
Lessons
Completed
Best Reply Awards 199
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

06 Jan
2 months ago

RachidLaasri left a reply on How To Add A New (custom) Function That Can Be Chained With The Auth() Function

SessionGuard::macro('somethingNew', function(){
    return 'Laravel is awesome';
});
30 Mar
11 months ago

RachidLaasri left a reply on Identify Multi Model With Same Line

They must have the same namespace to do that.

29 Mar
11 months ago
28 Mar
11 months ago

RachidLaasri started a new conversation Telegram Group

Hello,

I have been looking for a Laravel Telegram group and haven't been able to find one so I created it.

If you are interested, join us on https://t.me/laraveltalk

I hope this isn't against the forum rules ?

07 Jan
2 years ago

RachidLaasri left a reply on Form Request, Updating A Unique Field

Try using

'name' => 'required|alpha_num_spaces|unique:categories,name,' . $this->segment(3)

RachidLaasri left a reply on Directory Per User For Their Pdf Uploads?

You can create a folder inside the storage/app folder, something like

  • storage
    • app
      • PDFs
        • user1
        • user2

This way all the files will not be accessible by the public and you can let the users download their files using Laravel Filesystem https://laravel.com/docs/5.3/filesystem

04 Nov
2 years ago

RachidLaasri left a reply on How To Chain Middleware?

public function handle($request, Closure $next)
{
    if ( Auth::check() && Auth::user()->isAdmin() )
    {
        return $next($request);
    }

    return redirect()->route('path/to/dashboard');
}

isAdmin is a method that returns true or false, you need to define it in your User model.

23 Oct
2 years ago

RachidLaasri left a reply on Error 500 When Visiting As Logged In User

I think it's normal because why would a logged in user visit the login page? You also mentioned disabling WithoutMiddleware makes it work, that means you are using some sort of "guest" middleware on those routes.

Try to open the same page using the browser, do you get any errors?

RachidLaasri left a reply on How To Create A Featured/Top Article In A Classifieds Php Application

Order them by most viewed? Add a 'views' column to your table and increment it when someone sees the ads.

RachidLaasri left a reply on Migrations

$table->float('weight', 8, 2); // if you are storing float numbers. $table->unsignedInteger('weight'); // for integer numbers

03 Aug
2 years ago
16 Jul
2 years ago
02 Jul
2 years ago

RachidLaasri left a reply on Laravel 5.3 Wish List

@gocanto I sent a PR but they closed it, so.. it is not gonna be included.

Here is a link : https://github.com/laravel/framework/pull/14192

14 Jun
2 years ago

RachidLaasri left a reply on GitHub : Pushing My Entire Project

Those lines are fine for most Laravel apps, if you have additional files that are specific for your app then just add them there.

12 Jun
2 years ago

RachidLaasri left a reply on Laravel 5.2 : `php Artisan Migrate` 's Error

Try replacing tinyInteger by integer.

09 Jun
2 years ago

RachidLaasri left a reply on Bug In Auth::loginUsinId() ??

Maybe because you need wrap your routes within a group route with web middleware?

14 Mar
3 years ago

RachidLaasri left a reply on VueJS Code Review/advise

I don't think it's possible, because you cannot execute that code if no one is on the page.

RachidLaasri left a reply on VueJS Code Review/advise

Try like that:

leaving:function() {
    if (! this.sentRequest && this.minutes == 5) {

        var p = this.$http.post('/demo/send', {
            to: this.to,
            from: this.from,
            text: this.text
        });
        this.sentRequest = true;
    }
    return null;
}

RachidLaasri left a reply on VueJS Code Review/advise

Can you explain more on what you are trying to do? maybe we can find a better way to do it?

RachidLaasri left a reply on VueJS Code Review/advise

Try to replace this

window.unload = this.leaving;

With :

window.onbeforeunload = this.leaving;

RachidLaasri left a reply on VueJS Code Review/advise

Hmm, do you get any errors? or nothing at all?

14 Feb
3 years ago

RachidLaasri left a reply on New Laravel Package

Nice package and good idea.

05 Feb
3 years ago

RachidLaasri left a reply on Change Default Login Path

You can create your custom routes.

RachidLaasri left a reply on Laravel Localization

Can you explain more? what are you trying to achieve?

04 Feb
3 years ago

RachidLaasri left a reply on [ Package ] - Laravel Web Installer

@bestmomo

1 - I believe that a documentation ( should be included with your script ) can hold that better than just putting all the explanation in the installer, but running **php artisan key:generate" at the end of the installation is a good idea.

2 - The package actually calls php aritsan migrate, php artisan db:seed and that should create the tables and save the data, But i am not sure if creating the database using the installer is a good idea.

28 Jan
3 years ago

RachidLaasri left a reply on Site Declines My Credit Card

You can email the site owner from this page https://laracasts.com/contact

RachidLaasri left a reply on Extend Helper Functions To Lumen

If you only need the asset method you can create your own the same way you do with Laravel.

http://laravel.io/forum/02-03-2015-best-practices-for-custom-helpers-on-laravel-5?page=1#reply-20611

RachidLaasri left a reply on Setup Different Frontend & Backend Endpoints In Laravel 5.1

Hi,

This is how you can structurer your Routes. Note that i am using the namespaces which means that my routes must be located in

  • Public Routes : App\Http\Controller\Frontend
  • Dashboard Routes : App\Http\Controller\Dashboard

And you can access your dashboard using http://site.com/dashboard, you can use any name you want by changing the the prefix in the route group.

Route::group(['namespace' => 'Frontend'], function(){

get('/', [
    'as' => 'home',
    'uses' => 'HomeController@index'
]);

// the rest of your public routes.

});

Route::group(['namespace' => 'Dashboard', 'prefix' => 'dashboard'], function() {

get('/', [
    'as' => 'dashboard.home',
    'uses' => 'HomeController@index'
]);

// the rest of your dashboard routes.

});

24 Jan
3 years ago

RachidLaasri left a reply on [ Package ] - Laravel Web Installer

@ayekoto Do you get any errors? It's working with Laravel 5.1 and Laravel 5.2.

29 Dec
3 years ago

RachidLaasri left a reply on How Get Attribute From Many To Many Relation

You should create an instance of salary_user to attach it.

18 Dec
3 years ago

RachidLaasri left a reply on Creating Two Tables With User_id

Who said you can't? Do you get any errors?

13 Dec
3 years ago

RachidLaasri left a reply on Create Middleware To Auth Admin Users

1- run :

php artisan make:middleware IsAdmin
```
2- Add it to the **routeMiddleware** array in your kernel file by opening **app/Http/Kernel.php**

'admin' => \App\Http\Middleware\IsAdmin::class,

3- Edit **isAdmin** file:
```
 public function handle($request, Closure $next)
    {
        if (Auth::user() &&  Auth::user()->admin == 1) {
            return $next($request);
        }

        return redirect('/');
    }
```
4- Apply the middleware to your route:
```
Route::get('admin_area', ['middleware' => 'admin', function () {
    //
}]);
```

RachidLaasri left a reply on $.post() Redirection Issue

Replace this:

$( '.disable_user_form' ).on( 'submit', function( e )

with this:

$('.disable_user_form input[type="submit"]').on('click', function(e){
09 Dec
3 years ago

RachidLaasri left a reply on Laravel Following System

There is this package but it's for 4 : https://github.com/fenos/Rally

I don't know if there is any for L5.

08 Dec
3 years ago

RachidLaasri left a reply on Getting Multiple Values

More than 2 of what?

RachidLaasri left a reply on Getting Multiple Values

@foreach($gallery_test as $image => $title)
    <li>
        {{ $title }}
        {{ $image }}
    </li>
@endforeach
06 Dec
3 years ago

RachidLaasri left a reply on Cpanel Email On Laravel App

Show us your try.

RachidLaasri left a reply on Make The Create And Update Route The Same?

Give us more details, what kind of info you are saving? because in order to achieve what you want is to have a unique column in your table.

RachidLaasri left a reply on Cpanel Email On Laravel App

Just add your SMTP info to the .env file.

RachidLaasri left a reply on How To Save The User's IP Address Along With Their Form Input?

public function store(BlogRequest $request)
{
    $data = array_merge($request->all(), ['id' => $request->ip(), 'blogtext' => 'text']);

    Blog::create($data);

    Session::flash('flash_message', "Your blog has been successfully created!");

    return redirect('/');
}
05 Dec
3 years ago

RachidLaasri left a reply on Laravel Official Boilerplate

There is plenty of boilerplates on GitHub pick one and fork it and start using it for your projects.

RachidLaasri left a reply on Install Package Dependencies

Can you post your folder structure & composer file.