matheenulla

matheenulla

junior web developer at Bangalore

Member Since 3 Months Ago

bangalore

Experience Points
5,390
Total
Experience

4,610 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
30
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.

Level 2
5,390 XP
Dec
16
4 hours ago
Activity icon

Replied to OnDelete('cascade) Not Working

@martal it is working now thank you very much

Activity icon

Replied to OnDelete('cascade) Not Working

@martal ok thank bro for helping. I may delete not more than 10 records so I will go through the events and listeners. So I am seeing the documentation now. I will try that one now If I got some errors I will let you know thank you once again

Activity icon

Replied to OnDelete('cascade) Not Working

@martal I am using MySQL and I want If I delete a parent record I want all child record should be deleted. How to do that one?

Activity icon

Started a new Conversation OnDelete('cascade) Not Working

Hi

I Have 3 tables

1)policy (primary key)
2)project_declaration (foreign key for policy)
3)endorsement  (foreign key for policy)

when I delete a record in the policy table. The other records which are link to that table are not deleting. I am using onDelete('cascade) and I am using soft delete in all 3 tables.

my migration files


policies 

 Schema::create('policies', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('controll_number');
            $table->string('customer_name');
            $table->string('insured_name');
            $table->integer('policy_number');
            $table->string('policy_type');
            $table->date('start_date');
            $table->date('end_date');
            $table->string('insurance_company');
            $table->string('policy_sum_insured');
            $table->string('premium');
            $table->string('gst');
            $table->string('total_premium');
            $table->timestamps();
        });

project declaration

Schema::table('project_declerations', function (Blueprint $table) {

            $table->unsignedBigInteger('policy_number_id')->after('id')->nullable();
            $table->foreign('policy_number_id')->references('id')->on('policies')->onDelete('cascade');

            $table->unsignedBigInteger('Brand_id')->after('contact_person')->nullable();
            $table->foreign('Brand_id')->references('id')->on('brands')->onDelete('cascade');

            $table->date('intimation_date')->after('addredd')->default(now());

            
        });

endorsement

Schema::create('endorsements', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('legalentity');
            $table->unsignedBigInteger('policy_number');
            $table->string('location');
            $table->string('premium');
            $table->string('gst');
            $table->string('totalpremium');
            $table->date('start_date');
            $table->date('end_date');
            $table->string('suminsured');
            $table->text('description');
            $table->text('endorsement_filename');
            $table->foreign('legalentity')->references('id')->on('legal_entities')->onDelete('cascade');
            $table->foreign('policy_number')->references('id')->on('policies')->onDelete('cascade');
            $table->timestamps();
        });
Dec
13
3 days ago
Activity icon

Replied to Updating File Via Postman (returning Filename As Null)

@tykus yup it is working thank you very much

Activity icon

Started a new Conversation Updating File Via Postman (returning Filename As Null)

I am creating an API for updating the profile pic. while using postman I am getting null value when I use $request->file('filename)

my route

Route::put('/updatetudent/{id}','Api\[email protected]');

my controller

 public function update(Request $request,$id)
    {

       $filename = $request->file('photo');
       return response()->json(['filename' => $filename],200);
      
    }

in postman my headers

1)Content-Type = multipart/form-data
2)Accept = application/json
3)Authorization = Bearer  token

my output

{
    "filename": null
}
Dec
05
1 week ago
Activity icon

Awarded Best Reply on Laravel GroupBy Query (API Resource)

@sinnbeck @bugsysha I have made changes like this

 $exam_types = StudentsMark::whereIn('academic_id',$ids)->whereIn('student_id',$studentid)->distinct()->get(['exam_type','academic_id','student_id']);

       $marks = StudentMarksResource::collection($exam_types);

resource file is

public function toArray($request)

{    
    return [

        'exam_type' => $this->exam_type,
        'details' => StudentMarks::where('academic_id', $this->academic_id)
        ->where('student_id', $this->student_id)
        ->where('exam_type',$this->exam_type)
        ->get(),

    ];
}

thank you once again

Activity icon

Replied to Laravel GroupBy Query (API Resource)

@sinnbeck @bugsysha I have made changes like this

 $exam_types = StudentsMark::whereIn('academic_id',$ids)->whereIn('student_id',$studentid)->distinct()->get(['exam_type','academic_id','student_id']);

       $marks = StudentMarksResource::collection($exam_types);

resource file is

public function toArray($request)

{    
    return [

        'exam_type' => $this->exam_type,
        'details' => StudentMarks::where('academic_id', $this->academic_id)
        ->where('student_id', $this->student_id)
        ->where('exam_type',$this->exam_type)
        ->get(),

    ];
}

thank you once again

Activity icon

Replied to Laravel GroupBy Query (API Resource)

@sinnbeck @bugsysha finally the exact output what I want that I am getting now. Thank you very very very much for helping me. I was suffering this from last 2 days thank you once again

Activity icon

Replied to Laravel GroupBy Query (API Resource)

@bugsysha I tried that one I am getting an error Call to undefined method stdClass::first()

$marks = DB::table('students_marks')
        ->whereIn('academic_id',$ids)
        ->whereIn('student_id',$studentid)
        ->get()
        ->map(function($group){
            StudentMarksResource::collection($group);

          })
        ->groupBy('exam_type');
Activity icon

Replied to Laravel GroupBy Query (API Resource)

@bugsysha @sinnbeck I have one small doubt. I am totally new to this API and I don't know how they will build mobile apps using API. My Doubt is, we need to create API how a mobile app developer will say? or we just need to give API and rest of the things they will do? .

Dec
04
1 week ago
Activity icon

Replied to Laravel GroupBy Query (API Resource)

@bugsysha thank for replying I will try this and let you know

Activity icon

Replied to Unable To Call Post Route In Form Tag

@sinnbeck yes you are right it is going to correct route after that it is redirecting from the controller.

it was a mistake in the controller. I was scratching my head from the last 2 hours.

@sinnbeck I have one more problem give me some idea about this https://laracasts.com/discuss/channels/laravel/laravel-groupby-query-api-resource

thank you so much

Activity icon

Replied to Unable To Call Post Route In Form Tag

@sinnbeck oh ok I am checking

Activity icon

Replied to Unable To Call Post Route In Form Tag

@sinnbeck yes it is correct But is going to viewstudentmarks url

Activity icon

Started a new Conversation Unable To Call Post Route In Form Tag

Hi

When I click on the submit button it is not calling post method. Instead, it is calling some other URL

My form

<form method="post"  style="padding-top:30px;" action="{{ route('updatestudentmark',['id' => $stuid]) }}">


        {{csrf_field()}}
        <input type="hidden" name="type" value="{{$examtype}}">
        
      <div class="row text-center">
      <div class="col-lg-12 col-md-12 col-sm-12">
          <div class="row">

            <div class="col-lg-12">
                    <div class="form-group">
                            <div class="row text-left">
                            <div class="col-sm-4 col-lg-12 col-md-4">
                               <table class="table">
                                   <tr>
                                       <th>Subjects</th>
                                       <th>Marks Obtain</th>
                                       <th>Grade</th>
                                   </tr>
                                   @foreach($mark as $mrk)
                                   <tr>
                                     <td><input type="text" class="form-control" name="subject[]" readonly  value="{{$mrk->subject}}"></td>   
                                     <td><input type="number" name="marks[]" class="form-control" value="{{$mrk->marks}}"></td></td>
                                     <td><input type="text" class="form-control" value="{{$mrk->marksgrade}}" disabled></td>
                                   </tr>

                                   @endforeach

                                   @foreach($extra as $detail)
                                  
                                    <tr>
                                            <td>Total</td>
                                            <td>{{$detail->total}}</td>    
                                    </tr>
                                    <tr>
                                            <td>Average Grade</td>
                                            <td>{{$detail->grade}}</td>    
                                    </tr>
                                    <tr>
                                            <td>Percentage</td>
                                            <td>{{$detail->percentage.' %'}}</td>    
                                    </tr>
                                    @endforeach
                
                                </table>
                            </div>
                            </div>
                      
                    </div>

            </div>
           

          </div>

      </div>
    </div>
    
       {{--  @foreach($extra as $detail)
          <a  class="btn btn-success" href='{{ url("viewstudentmarks/{$detail->class_id}") }}'>Back</a>
         @endforeach --}}

               <input type="submit"  class="btn btn-primary">
        </form>

my route file

Route::post('updatestudentmark/{id}','[email protected]')->name('updatestudentmark');
Activity icon

Replied to Laravel GroupBy Query (API Resource)

@sinnbeck I have tried this also. how you have told me yesterday

     ```    $marks = DB::table('students_marks')
         ->whereIn('academic_id',$ids)
         ->whereIn('student_id',$studentid)
         ->get()->groupBy('exam_type')->map(function($group){
             return StudentMarksResource::collection($group);
         });```
Activity icon

Replied to Laravel GroupBy Query (API Resource)

@sinnbeck No that is for time table. that is working fine. This is for student marks, In this I am not getting the data in the above format

Activity icon

Started a new Conversation Laravel GroupBy Query (API Resource)

Hi

I am trying to get a student marks details that are group by exam_type. I need to create a API in below format. But I am unable to do that one. I need help with building query.

{

  "success": true,
  "data": [

      {
        "exam_type": "Annually",
         "details":[
                       {

              // all student marks details  group by exam_type

                  "student_id": 89,
                 "subject": "English",
                 "marks": "50",
                 "marksgrade": "B",
                 "total": "300",
                   "grade": "B",
                  "percentage": "50",
                  "year": "2019"
              },
             {

              // all student marks details  group by exam_type

                  "student_id": 89,
                 "subject": "Mathematics",
                 "marks": "50",
                 "marksgrade": "B",
                 "total": "300",
                   "grade": "B",
                  "percentage": "50",
                  "year": "2019"
              },

           ],

      }
]

}

what I have tried

$marks = StudentMarksResource::collection(StudentsMark::whereIn('academic_id',$ids)
->whereIn('student_id',$studentid)->get()->groupBy('exam_type')); 

Resource file

  public function toArray($request)
   {
       
       return [
           
           'exam_type' => $this->exam_type,
           'class_id' => Course::find($this->class_id),
           'batch_id' => Batch::find($this->batch_id),
           'student_id' => Student::find($this->student_id),
           'subject' => $this->subject,
           'marks' => $this->marks,
           'marksgrade' => $this->marksgrade,
           'total' => $this->total,
           'grade' => $this->grade,
           'percentage' => $this->percentage,
           'year' => $this->year,
           
       ];
   }


how i am sending the data


return response()->json(['success' => true,'data' =>  $marks,'status' => 200]);

Dec
03
1 week ago
Activity icon

Replied to Property [academic_id] Does Not Exist On This Collection Instance

@sinnbeck thank you very very much it is working

Activity icon

Started a new Conversation Property [academic_id] Does Not Exist On This Collection Instance

Hi

I am using an API resource. I am getting this error in collection instance

  $timetables = TimetableResource::collection(DB::table('time_tables')
        ->whereIn('academic_id', $ids)
        ->whereIn('class', $classid)->get()->groupBy('day'));

and my TimetableResource file

 public function toArray($request)
{
    return [
        'academic_id' => $this->academic_id,
        'day' => $this->day,
        'class' => Course::find($this->class),
        'subject' => Subject::find($this->subject),
        'teacher' => Teacher::find($this->teacher),
        'timeslot' => $this->timeslot

    ];
}
Dec
02
2 weeks ago
Activity icon

Awarded Best Reply on How To Change The Response Messages In Tymon JWT Package

solved

in app/Exceptions/Handler.php write the above code

    public function render($request, Exception $exception)

      {

        if ($request->is('api/*') || $request->expectsJson() || $request->is('webhook/*')) {
            if ($exception instanceof Tymon\JWTAuth\Exceptions\TokenInvalidException) {

               return response()->json(['errors'=>'Invalid Token']);

            }
        }
     return parent::render($request, $exception);

    }```
Activity icon

Replied to How To Change The Response Messages In Tymon JWT Package

solved

in app/Exceptions/Handler.php write the above code

    public function render($request, Exception $exception)

      {

        if ($request->is('api/*') || $request->expectsJson() || $request->is('webhook/*')) {
            if ($exception instanceof Tymon\JWTAuth\Exceptions\TokenInvalidException) {

               return response()->json(['errors'=>'Invalid Token']);

            }
        }
     return parent::render($request, $exception);

    }```
Activity icon

Started a new Conversation How To Change The Response Messages In Tymon JWT Package

Hi I want to change response messages in the Tymon JWT package. For example while fetching the data without using token I am getting this message

"message": "Token Signature could not be verified.",
    "exception": "Tymon\JWTAuth\Exceptions\TokenInvalidException",

 I want to change that response like instead of the message  I need to pass errors

   "errors": "Invalid token.",


   `
Nov
23
3 weeks ago
Activity icon

Replied to How To Send JSON Response In Laravel

@nakov No, Now I will go through it thank you for your response

Activity icon

Started a new Conversation How To Send JSON Response In Laravel

Hi, I want to send a JSON response like where ever the Id is there I want to send their particular details.

example shown below

what I am getting

[

    {

    "id": 7,
    "academic_id": 2,
    "assignment_type": "Class Wise",
    "subject": 4,
    "batch": 1,
    "course": 2,

}

]

How I want

[

{

     "id": 7,
    "academic_id": 2,
    "assignment_type": "Class Wise",
    "subject": {
            "id":4,
            "subjectname" : "Physic",
      },
    "batch": 1,
    "course": {
            "id":2,
            "name" : "10th",
      },

}

]

Nov
22
3 weeks ago
Activity icon

Started a new Conversation A Non-numeric Value Encountered Error In Maatwebsite While Importing

my controller

public function import(Request $request)
{
    
    Excel::import(new TeacherImport, $request->file('teacherimport'));
    return redirect('/teachers')->with('success','Teacher Imported Successfully');
 
}

my import file

class TeacherImport implements ToModel

{

public function model(array $row)
{

    $ids = Academic::select('id')->active()->first();

    return new Teacher([
        'academic_id' => $ids->id,
        'first_name' => $row[0],
        'last_name' => $row[1],
        'email' => $row[2],
        'mobile' => $row[3],
        'qualification' => $row[4],
        'dob' =>  \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($row[5]),
        'age' => $row[6],
        'state' => $row[7], 
        'city' => $row[8],  
        'address' => $row[9]
    ]);
}

}

Activity icon

Replied to A Non-numeric Value Encountered

@fylzero I am posting a new question so you can understand

Activity icon

Replied to A Non-numeric Value Encountered

@fylzero ok this is mycontroller

public function import(Request $request)
{
    
    Excel::import(new TeacherImport, $request->file('teacherimport'));
    return redirect('/teachers')->with('success','Teacher Imported Successfully');
 
}
Activity icon

Replied to A Non-numeric Value Encountered

@fylzero hey mine is different this is my file

public function model(array $row)
{

    $ids = Academic::select('id')->active()->first();

    return new Teacher([
        'academic_id' => $ids->id,
        'first_name' => $row[0],
        'last_name' => $row[1],
        'email' => $row[2],
        'mobile' => $row[3],
        'qualification' => $row[4],
        'dob' =>  \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($row[5])->format('d-m-y'),
        'age' => $row[6],
        'state' => $row[7], 
        'city' => $row[8],  
        'address' => $row[9]
    ]);
}
Activity icon

Replied to A Non-numeric Value Encountered

@fylzero I have tried but it is giving the same error

Activity icon

Replied to A Non-numeric Value Encountered

@van1310 hey I am also getting same error how did you solve this one?

Nov
20
3 weeks ago
Activity icon

Replied to How To Use Group By In Laravel

@manelgavalda thank you very much it's working now

Activity icon

Replied to How To Use Group By In Laravel

@manelgavalda I am getting this error

SQLSTATE[42000]: Syntax error or access violation: 1055 'schoolmanagement.time_tables.id' isn't in GROUP BY (SQL: select * from `time_tables` where `academic_id` in (24) and `class` in (2, 4) group by `day`)"
Activity icon

Replied to How To Use Group By In Laravel

@manelgavalda I have done strict to false but it is not working

Activity icon

Replied to How To Use Group By In Laravel

@manelgavalda No, it's not working. The query is correct?

Activity icon

Started a new Conversation How To Use Group By In Laravel

hi,

I am to retrieve data based on the day using groupBy. But I am getting an error like this

syntax error or access violation: 1055

what I have tried

public function index(){

    $ids = Academic::active()->pluck('id');
    if(Auth()->user()->getRoleNames() == '["Parent"]')
    {
        $id = Auth()->user()->Parents_id;
        $parent = ParentName::find($id);
        $students = $parent->students;

        foreach($students as $stu)
        {
            $classid[] = $stu->class_id;
        }

        $timetables = DB::table('time_tables')->whereIn('academic_id', $ids)->whereIn('class', $classid)->groupBy('day')->get();

      //  $timetables = TimeTable::whereIn('academic_id', $ids)->whereIn('class', $classid)->get();

        return response()->json($timetables);


    }
Nov
18
4 weeks ago
Activity icon

Replied to Unable To Import MySQL Database In Server(Shared Hosting)

@sinnbeck thank you very much I will upgrade my MySQL server and check

Activity icon

Replied to Unable To Import MySQL Database In Server(Shared Hosting)

@sinnbeck yes you are right there is a big difference in version

in local I am using 10.4.6 and in the server, I am using 5.5.61-38.13

how to solve this problem?

Activity icon

Replied to Unable To Import MySQL Database In Server(Shared Hosting)

No, last week I have hosted then it was working. Then how to check the version of mysql?

Activity icon

Replied to Unable To Import MySQL Database In Server(Shared Hosting)

Ya I have seen so many discussion but unable to solve

Activity icon

Started a new Conversation Unable To Import MySQL Database In Server(Shared Hosting)

hi In local it is working fine. While importing the MySQL database in the server, it is importing all the tables not importing the primary and foreign key relationships. In between, I am getting an error like this

#1071 - Specified key was too long; max key length is 767 bytes

Nov
13
1 month ago
Nov
11
1 month ago
Activity icon

Replied to Can We Use Model Inside A Jquery Function?

@nakov It is working now thank you very very much

Activity icon

Replied to Can We Use Model Inside A Jquery Function?

yes, I just tried it now. It is giving all the text