soufyaneyassin

Member Since 2 Months Ago

Experience Points
970
Total
Experience

4,030 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
5
Lessons
Completed
Best Reply Awards
0
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 1
970 XP
Apr
29
1 week ago
Activity icon

Started a new Conversation Modals Inside Modals Laravel Backpack

hey everyone, i have question about inline create operation in laravel backpack : is there possible way to create modals inside the inline create operation? i mean it's like "inline create" inside inline create ?

Apr
19
2 weeks ago
Activity icon

Started a new Conversation AddClause() With Restrictions Laravel Backpack

hey everyone, i am trying to filter results in listOperation for the user to see only his organizations and that's working fine with the following code :

if (backpack_user()->hasRole('Partner')){

        CRUD::addClause('whereHas', 'users', function($query) use ($user){
            $query->where('user_id', '=', $user->id);
        } );

now the problem is when i change the route for example if i write organization/40/show and wrote any number i want i can see other organizations and i want to restrict him for doing so

Apr
13
3 weeks ago
Activity icon

Started a new Conversation PHPUnit Test Laravel

hey everyone i'am trying to run the following test:

 public function a_user_can_register()
    {

    $user = User::factory()->create();
    $response = $this->post('/register', $user);
    $response->assertRedirect('/register-step-2');
    $this->assertDatabaseHas('users', $user);
          
}

but i am getting this error :

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

Apr
10
4 weeks ago
Activity icon

Started a new Conversation Spatie Laravel Permission Pivot Table

hey everyone, i have two models User and organization and a third one partnerProject which is the pivot table that contains "organization_id" and "user_id" and "role_id", after the insertion i only get organization_id and user_id but the role_id is always null (i am using spatie laravel permission) which means i don't have a role_id column inside users table . i tried the following :

    public function users(){

    return $this->belongsToMany(User::class, PartnerProject::class, 'organization_id', 'user_id')
    	    ->withPivot('role_id', 'organization_id')
      	    ->withTimestamps();
}
Apr
07
1 month ago
Activity icon

Replied to Inline_create Laravel Backpack

after searching in the backpack files, i found out that inline_create is specified to fields of type "relationship" so if u would like to add it to other fields u need to customize those fields and include something like

@include('crud::fields.relationship.'.$field['type'])

Activity icon

Started a new Conversation Inline_create Laravel Backpack

hello everyone, i'am trying to add inline_create in select2_from_ajax_multiple in laravel backpack but i dont get the add button,

 $this->crud->addField([

        	'label' => 'Partners',
    	    'type' => 'select2_from_ajax_multiple',
      	 	 'name' => 'partners', // the relationship name in your Model
       		 'entity' => 'partners', // the relationship name in your Model
            'attribute' => 'full_name', // attribute on Article that is shown to admin
            'pivot' => true, // on create&update, do you need to add/delete pivot table entries?
           'tab' => 'Relations',
          'model' => "App\Models\User",
           'placeholder' => 'Select a partner',
          'minimum_input_length' => 2,
          'method' => 'POST',
          'data_source' => backpack_url("project/fetch/partners"),
         'default' => $default,
         'inline_create' => true 
       ]);
Mar
21
1 month ago
Activity icon

Started a new Conversation Create Custom Select Field Laravel Backpack

hey everyone, i am working with laravel backpack, i want a custom select field that actually contains two select fields that depends on each other, i found some suggestions on backpack documentation butit doesn't meet my requirements, what i tried is the following :

 $this->crud->addField([
        'type' => 'select_from_array',
        'name' => 'taskable_type',
        
        'label' => 'task type',
   
        'attribute' => 'taskable_type',
        'options'   => ['project','organization'],
          ]);

          $this->crud->addField([ // select2_from_ajax: 1-n relationship
            'label'                => "Task element", // Table column heading
            'type'                 => 'select2_from_ajax_multiple',
            'name'                 => 'Taskable_id', // the column that contains the ID of that connected entity;
            'entity'               => 'taskable', // the method that defines the relationship in your Model
            'attribute'            => 'taskable_id', // foreign key attribute that is shown to user
            'data_source'          => backpack_url('api/task'), // url to controller search function (with /{id} should return model)
            'placeholder'          => 'Select a task', // placeholder for the select
            'include_all_form_fields' => false, //sends the other form fields along with the request so it can be filtered.
            'minimum_input_length' => 0, // minimum characters to type before querying results
            'dependencies'         => ['taskable_type'], // when a dependency changes, this select2 is reset to null
            // 'method'                    => 'GET', // optional - HTTP method to use for the AJAX call (GET, POST)
        ]);

so when i select the organization in the first select, the second select displays me the organizations name and same think for projects. but it's not working

Mar
20
1 month ago
Activity icon

Replied to Model::getMorphClass() Cannot Be Called Statically

actualy that method getMorphClass() gives me the result ( App\Models\Task ) but what i need is to retrive the parent models which are ( App\Models\project and App\Models\organization ) , is it possible in morphto relationship to do that?

Activity icon

Started a new Conversation Model::getMorphClass() Cannot Be Called Statically

i am trying to displays the types of the parents models (morphmany relationship) but it keeps giving me that error , what i did is the following :

      $this->crud->addField([
                'type' => 'select',
                'name' => 'taskable_type',
       			 'entity' => 'taskable',
    		    'label' => 'task type',
      		    'model'     => "App\Models\Task",
                'attribute' => 'taskable_type',
                'options'   => (function ($query) {
                $query = Task::getMorphClass();
            return $query;
        }),

if any one knows the solution or another way to display the models types in select field it will be helpful.

Mar
19
1 month ago
Activity icon

Started a new Conversation Add A Select2 Field That Depends On Another Field On Morphto Relationship

hi everyone , i am using laravel backpack and i have 3 models related with morphTo relationship :

  • Task : that has the following method: public function taskable() { return $this->morphTo(); }
  • Project : public function tasks() { return $this->morphMany(Task::class, 'taskable'); }
  • Organization : public function tasks() { return $this->morphMany(Task::class, 'taskable'); }

now what i am trying to do is add a two crud fields ( task crud ) that have two selects the first one is to select either organization type or project type and then the second select displays me the organizations or the projects, i tried something from backpack documentation but i dont know how to do it with morphto relationships. the code that i tried is :

   $this->crud->addField([
           'type' => 'select',
           'name' => 'taskable',
        'entity' => 'taskable',
        'label' => 'task type',
        'attribute' => 'taskable_type',
    ]);
    $this->crud->addField([ // select2_from_ajax: 1-n relationship
         'label'                => "task name", // Table column heading
        'type'                 => 'select2_from_ajax_multiple',
        'name'                 => 'taskable', // the column that contains the ID of that connected entity;
         'entity'               => 'taskable', // the method that defines the relationship in your Model
         'attribute'            => 'taskable_id', // foreign key attribute that is shown to user
      
      'placeholder'          => 'Select a task', // placeholder for the select
         'minimum_input_length' => 0, // minimum characters to type before querying results
         'dependencies'         => ['taskable_id'], // when a dependency changes, this select2 is reset to null
         // 'method'                    => 'GET', // optional - HTTP method to use for the AJAX call (GET, POST)
     ]);

if anyone has an idea how to implement this?, thank you

Mar
07
2 months ago
Activity icon

Started a new Conversation Laravel Jetstream Menu Items

hey everyone, i'am working with laravel jetstream, i added some items next to dahsboard item but i have a problem with routes (how to customize the route for this menu items) ?