Belhedi

Belhedi

Member Since 6 Months Ago

Sidi Bouzid

Experience Points 4,800
Experience Level 1

200 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 39
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

08 Aug
1 week ago

Belhedi left a reply on How To Fix The Disappearance Of Bootstrap Template From My Laravel Project

what ? I'm using laravel not php native mate !

Belhedi started a new conversation How To Fix The Disappearance Of Bootstrap Template From My Laravel Project

I downloaded a project from godaddy shared hosting to edit him but when i access to the application from my localhost the template is gone (design, css, js, buttons etc...). it show me only white page with simple html codes(words)

Belhedi left a reply on How To Fix “ No Such File Or Directory”error When I Access To The Home Page

thanks body it worked but the bootstrap is gone the design is gone :(

Belhedi left a reply on How To Fix “ No Such File Or Directory”error When I Access To The Home Page

well his version is 5.8 and mine is 5.7 but there's no diffeent no ?

Belhedi left a reply on How To Fix “ No Such File Or Directory”error When I Access To The Home Page

I don't know my friend if you understand my problem or not , I should edit an application or website hosted in godaddy.com so I tried to download it and edit it from my localhost and then I will reupload it in the hosting.

Second, the index.php folder is in the root folder.

Artisan commands like artisan serve works but when I type out the adress of localhost:8000 it show me the errors in the top .

I tried to run the make:migration command and worked !

The version is 5.8.

I don't know various commands mate !

Belhedi left a reply on How To Fix “ No Such File Or Directory”error When I Access To The Home Page

Didn't work guys , PS: I downloaded the whole project from godaddy hosting, Is there any change of settings when doing this operation ?

07 Aug
1 week ago

Belhedi left a reply on How To Fix “ No Such File Or Directory”error When I Access To The Home Page

hello my friend first , thanks for your reply second i work as a freelancer and my work is to edit a website , this website is hosted in godaddy.com than i tried to download this website from godaddy and edit him from my computer and I tried to the command composer instal and composer update and still not working...

Belhedi left a reply on How To Fix “ No Such File Or Directory”error When I Access To The Home Page

when I create a simple laravel test project it works but I want to edit the dowloaded project mate !

Belhedi started a new conversation How To Fix “ No Such File Or Directory”error When I Access To The Home Page

I downloaded a laravel project from a shared hosting and I want to edit him in my localhost but when I type out the home adress: localhost:8000/ it shows me those two errors :

Warning: require_once(C:\Users\Rafaa\Downloads\Compressed.idea/public/index.php): failed to open stream: No such file or directory in C:\Users\Rafaa\Downloads\Compressed.idea\server.php on line 21.

Fatal error: require_once(): Failed opening required 'C:\Users\Rafaa\Downloads\Compressed.idea/public/index.php' (include_path='C:\xampp\php\PEAR') in C:\Users\Rafaa\Downloads\Compressed.idea\server.php on line 21

07 Jun
2 months ago

Belhedi left a reply on Open A Register Form Only In Sunday

@MTHOMAS - already done mate :)

Belhedi left a reply on Open A Register Form Only In Sunday

@SIANGBOON - thnx but what is ($date) ??

Belhedi started a new conversation Open A Register Form Only In Sunday

Hi There. I'm using Laravel 5.7 and I want to open a specific page (register page) only in sundays HJow to do that ?

04 Jun
2 months ago

Belhedi left a reply on Multiple Users With Same Login Page

@CJJ - thnx for replying. But what do yo mean by adding : ->where('teacher', 1) ??

Belhedi started a new conversation Multiple Users With Same Login Page

Hi guys I want to put all my different users (teachers, students, admins) in the same table but how can I differentiate between them when I add the relationships in this table. For example : the teachers belongs to a departement table, and the students belongs to another table which is faculty table ! The problem is when I add those relationships to the users table it will add automatically to all types of users (teachers, students, admins...).

23 May
2 months ago

Belhedi left a reply on Show Data In A Certain Period

I don't have any idea about carbon , what is it ?

Belhedi left a reply on Show Data In A Certain Period

Nope mate , the date here is a dynamic data , it changes automatically, it's not fixed with two variables like you did

Belhedi started a new conversation Show Data In A Certain Period

hi Guys I use laravel 5.7 and I want to retrieve data from database and show them in a certain period like 3 days for exemaple and after these 3 days another action will be executed.

22 May
2 months ago

Belhedi started a new conversation Open An Registration Page In Specific Day

Hi guys.

  1. I'm new to laravel and I use the 5.7 version . I have a tutoriel registration page , I want in the normal days like monday , thursday etc.. when I open this page it shows me the message "Sorry you can register only in sunday" and when sunday is come , the register form show up

  2. when the users post their tutorial , I create a page that show these tutoriels to be voted by the students and the vote stay 3 days when 3 days is completed the students enter to the tutoriels page and they found vote time is over. I don't want a code I want and idea guys please help.

12 May
3 months ago

Belhedi started a new conversation Multiple User With Same Login Page

Hi every one.. I'vs started my project with wrong way , so I have 5 users then I built 5 tables ..each user have a separate table I have did this approach cause i run away from the problems of the relationship with the same table for example i have a teacher user and a faculty user , when these two are in the same table i don't knew how to do the relationship cause the teacher belongs to one faculty and the faculty has many teachers and these two are in the same table which is (user) So user belongs to user ?? / user hasMany user ?? PS: the faculty here is a user and cal connect to the database. So now I have 5 tables and 5 login pages and I want to have same login page with these 5 users pls help

26 Apr
3 months ago
25 Apr
3 months ago

Belhedi started a new conversation Retrieve Data With Eloquent Relationships

Hi guys.. I have a model called (Departement) which have a one to many relationship with the (Teacher) model :

class Departement extends Model
{
    protected $fillable = [
    'name', 'speciality', 'faculty_id'];

    public function teachers()
    {
        return $this->hasMany(Teacher::class);
    }

And the Departement model has a one to many relationship with the Faculty model :

class Faculty extends Authenticatable
{
    public function departements()
    {
        return $this->hasMany(Departement::class);
    }
}

I use in my application the faculty as a user which can login and logout , then i can add a teacher in my teachers table when i was connected as a faculty , i would to attach the departement id in my teaches table So in the register form i listed the departements names and when i select mathematic departement which has an id = 3 , in the teachers table this value stored in the departements_id column . I did that but it doesn't work:

'departement_id' => Faculty::find($facultyId)->departements()->where('name', $request['departementName'])->get()

Belhedi left a reply on Retrieve Data With Eloquent Relationships

there is a syntax error mate :/

24 Apr
3 months ago

Belhedi started a new conversation Retrieve Data With Eloquent Relationships

Hi guys.. I have a model called (Departement) which have a one to many relationship with the (Teacher) model :

class Departement extends Model
{
    protected $fillable = [
    'name', 'speciality', 'faculty_id'];

    public function teachers()
    {
        return $this->hasMany(Teacher::class);
    }



}

And the Departement model has a one to many relationship with the Faculty model :

class Faculty extends Authenticatable
{
    public function departements()
    {
        return $this->hasMany(Departement::class);
    }
}

I use in my application the faculty as a user which can login and logout , then i can add a teacher in my teachers table when i was connected as a faculty , i would to attach the departement id in my teaches table So in the register form i listed the departements names and when i select mathematic departement which has an id = 3 , in the teachers table this value stored in the departements_id column . I did that but it doesn't work:

'departement_id' => Faculty::find($facultyId)->departements()->where('name', $request['departementName'])->get()
13 Apr
4 months ago

Belhedi started a new conversation Field 'faculty_id' Doesn't Have A Default Value

Hi every one I want to update my departements table and this table has a foreign key which is faculty_id , the primary key of the faculty table but when i execute update method which modify the name and the speciality field it shows me that error : SQLSTATE[HY000]: General error: 1364 Field 'faculty_id' doesn't have a default value (SQL: insert into departements the update method :

public function update(Request $request, $id)
    {
       $request->validate([
        'name' => ['required', 'string', 'max:255'],
        'speciality' => ['required', 'string', 'max:255'],
      ]);

       $departement = new Departement([
        'name' => $request->get('name'),
        'speciality'=> $request->get('speciality')
      ]);

      $departement->save();

      return redirect('/departements')->with('success', 'Département modifié avec succés');
    }
07 Apr
4 months ago

Belhedi left a reply on Accept Only Integer Arguments In Edit Function

Dude ?

I want a code or an approach to my words below 1)..2)..3)..

Belhedi left a reply on Accept Only Integer Arguments In Edit Function

@SNAPEY - the problem that i want this approach in my function but all i did is this :

public function edit($id)
    {   
        $admin = Admin::find(Auth::guard('admin')->user()->id);
        if ($admin->id == $id)
            return view('admin.edit');
        else
            abort('403');
    }

Belhedi started a new conversation Accept Only Integer Arguments In Edit Function

Good Morning guys. I'm new in laravel and I've just finished the Laravel 5.7 from scratch serie , and I have a problem whish is : I want when an admin for example types in the adress : localhost:8000/admin/dashboard/edit/1 it shows the edit form of the admin which his id = 1 , the problem is when the admin for example type 'hi' or any string instead of (1) it shows 404 not found and when he types (2) it shows a message that is forbidden to enter the dashboard of the other admin whish his id = 2 so there are 4 conditions : I have 2 admins , I'm connected as admin 1 :

  1. when I type ..../1 : it shows me the edit form to edit my information 2)when I type ..../goodmorning : it shows me 404 not found 3)when I type ..../2 : forbidden 4)when I type /4 : not found (cause there is 2 admins). help please and as simple as you can cause i'm totally new :/
27 Mar
4 months ago

Belhedi left a reply on How To Add Admin User In My Application

@TOKOIWESLEY - I'm new to laravel and 2 days ago I have finished the laravel 5.7 from scratch and i want to know how to convert your words into a code ..

Belhedi left a reply on How To Add Admin User In My Application

@RICHARD - Thnx man , but i would know when the admin is toredt in the database ? cause i want a code wchich respect my application's conception

Belhedi left a reply on How To Add Admin User In My Application

@RICHARD - yeah every one should login , the admin , the teacher and also the student. "but you have to declare their roles separately" how ?

Belhedi left a reply on How To Add Admin User In My Application

@TYKUS - well i didn't do the authentication yet cause i didn't know how to add the admin like I said it's a conception problem .

Belhedi left a reply on How To Add Admin User In My Application

Thnx man for replying.

But exactly create a field role for any table (in other words : the admin should be stored in which table ? the teacher or the student) ?

I guess the field role works perfectly when I have a single Model that called User which collect the whole users of my application and role column identify every user if he is teacher or student or admin

but in my example the teacher and the student have a different models.

Belhedi started a new conversation How To Add Admin User In My Application

Hi every one. I have a conception problem that is I have 3 users in my application (Student, Teacher and Admin). But I want the student and the teacher be in a different models so I have a Teacher model and Student model but the admin isn't a teacher either a student so what I do ? I create a new model for one record isn't best solution or i put it with the teacher or student ? I have no idea !!