rushand

rushand

Member Since 7 Months Ago

Experience Points
6,110
Total
Experience

3,890 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
50
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.

Level 2
6,110 XP
Aug
19
1 month ago
Activity icon

Replied to Create Method Does Not Exist Error Even Its On The Controller

Thankyou for the rply,, But still its the same

Aug
18
1 month ago
Activity icon

Replied to Create Method Does Not Exist Error Even Its On The Controller

I checked,Its on the route list

Activity icon

Replied to Create Method Does Not Exist Error Even Its On The Controller

Thnakyou for the rply, I tried but it didn't worked out,, Apparently it does not allow me to use 'create' method(or any other method) Under controller named AnnouncementController, I tried creating a new controller named NoticeController it it works fine

Activity icon

Started a new Conversation Create Method Does Not Exist Error Even Its On The Controller

Route


Route::get('announcements/create','[email protected]');

Controller

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class AnnouncementController extends Controller
{
    public function create(){
      dd('test');
    }
}
?>

Error Msg

BadMethodCallException
Method App\Http\Controllers\AnnouncementController::create does not exist.
http://127.0.0.1:8000/announcements/create

Kindly help me to solve this issue

Jun
28
2 months ago
Activity icon

Awarded Best Reply on Internal Server Error

Thank you all for your responses, I got the issue solved, Issue was that in my datatable there was an extra column which wasnt null as default,also I wasnt seding data to fill this specific column on ajax request, So that it created an sql error , which appeared as a server error , on console log.

Activity icon

Replied to Internal Server Error

Thank you all for your responses, I got the issue solved, Issue was that in my datatable there was an extra column which wasnt null as default,also I wasnt seding data to fill this specific column on ajax request, So that it created an sql error , which appeared as a server error , on console log.

Jun
27
2 months ago
Activity icon

Replied to Internal Server Error

how to access the laravel log file?

Jun
26
2 months ago
Activity icon

Replied to Internal Server Error

Thankyou for the response, all mentioned points followed already, following console log displayed when the add button clicked

VM6:1 POST http://cms.test/timeslots 500 (Internal Server Error)
(anonymous) @ VM6:1
send @ jquery.min.js:2
ajax @ jquery.min.js:2
(anonymous) @ create:604
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2
Activity icon

Started a new Conversation Internal Server Error

Error o Console

VM2397:1 POST http://cms.test/timeslots 500 (Internal Server Error)
(anonymous)	@	VM2397:1
send	@	jquery.min.js:2
ajax	@	jquery.min.js:2
(anonymous)	@	create:604
dispatch	@	jquery.min.js:2
v.handle	@	jquery.min.js:2

View

<script>
$(document).ready(function(){
    $('#create_record').click(function(){
      //  $('#formModal').modal('show');
    $('.modal-title').text("Add New Record");
        $('#action_button').val("Add");
        $('#action').val("Add");
        $('#formModal').modal('show');
     });

$('#sample_form').on('submit', function(event){
 event.preventDefault();
 if($('#action').val() == 'Add')
 {
  $.ajax({
   url:"{{ route('timeslots.store') }}",
   method:"POST",
   data: new FormData(this),
   contentType: false,
   cache:false,
   processData: false,
   dataType:"json",
   success:function(data)
   {
    var html = '';
    if(data.errors)
    {
     html = '<div class="alert alert-danger">';
     for(var count = 0; count < data.errors.length; count++)
     {
      html += '<p>' + data.errors[count] + '</p>';
     }
     html += '</div>';
    }
    if(data.success)
    {
     html = '<div class="alert alert-success">' + data.success + '</div>';
     $('#sample_form')[0].reset();
     $('#user_table').DataTable().ajax.reload();
    }
    $('#form_result').html(html);
   }
  })
 }


});



});
</script>

Controller

    public function store(Request $request){


        $rules = array(
            'title'=>  'required',
             'day'=>  'required',
            'start_time'=>'required',
            'end_time'=>'required',


        );

        $error = Validator::make($request->all(), $rules);

        if($error->fails())
        {
            return response()->json(['errors' => $error->errors()->all()]);
        }


        $form_data = array(
            'title'=>  $request->title,
            'day'=>  $request->day,
            'start_time'=>  $request->start_time,
            'end_time'=>  $request->end_time,


        );

        Timeslot::create($form_data);

        return response()->json(['success' => 'Data Added successfully.']);
    }

All Work and validation error msgs shows successfully Issu is it dosent store any data to the database and return a Server Error on log

Jun
24
2 months ago
Activity icon

Replied to Multiple Day Values With Time

Thankyou for the rply, I'll try this

Activity icon

Started a new Conversation Multiple Day Values With Time

I need to store multiple day values with time (selected as checkbox) following code in my view

<div class="form-row">
        <div class="form-group col-md-4">
            <table>
            <tr>
                <th>Day</th>
                <th>Select</th>
                <th>Start Time</th>
                <th>End Time</th>
            </tr>
            <tr>

                <td>Monday</td>
                <td> <input type="checkbox" value="monday" name="day[]"></td>
                <td><input type="time" class="form-control" id="start_time"  name="start_time_0"  value="{{old('start_time') ?? $class->start_time}}"></td>
                <td><input type="time" class="form-control" id="end_time"  name="end_time_0"    value="{{old('end_time') ?? $class->end_time}}"></td>
            </tr>
            <tr>
                <td>Tuesday</td>
                <td><input type="checkbox" value="tuesday" name="day[]"></td>
                <td><input type="time" class="form-control" id="start_time"  name="start_time_1"  value="{{old('start_time') ?? $class->start_time}}"></td>
                <td><input type="time" class="form-control" id="end_time"  name="end_time_1y"    value="{{old('end_time') ?? $class->end_time}}"></td>
            </tr>
            <tr>
                <td>Wednesday</td>
                <td><input type="checkbox" value="wednesday" name="day[]"></td>
                <td><input type="time" class="form-control" id="start_time"  name="start_time_3"  value="{{old('start_time') ?? $class->start_time}}"></td>
                <td><input type="time" class="form-control" id="end_time"  name="end_time_3"    value="{{old('end_time') ?? $class->end_time}}"></td>
            </tr>
            <tr>
                <td>Thursday</td>
                <td> <input type="checkbox" value="thursday" name="day[]"></td>
                <td><input type="time" class="form-control" id="start_time"  name="start_time_4"  value="{{old('start_time') ?? $class->start_time}}"></td>
                <td><input type="time" class="form-control" id="end_time"  name="end_time_4"    value="{{old('end_time') ?? $class->end_time}}"></td>
            </tr>
            <tr>
                <td>Friday </td>
                <td><input type="checkbox" value="friday" name="day[]"></td>
                <td><input type="time" class="form-control" id="start_time"  name="start_time_5"  value="{{old('start_time') ?? $class->start_time}}"></td>
                <td><input type="time" class="form-control" id="end_time"  name="end_time_5"    value="{{old('end_time') ?? $class->end_time}}"></td>
            </tr>

        </table>
    </div>
</div>

IN request I get all the values mixed up I need only the stat_time and end time values of the checked(tick marked )days,, How to retrive>>

Jun
23
2 months ago
Activity icon

Replied to Header May Not Contain More Than A Single Header, New Line Detected

Thanks for your quick responses , I have amended my code as following

Make User Button

                    <form action="{{route('users.create')}}" class="float-left" method="POST">
                      <input type="hidden" value="{{$student->person->id}}" name="person_id">
                      <button class="btn btn-outline-success mb-2 float-left" style="text-decoration:none"><i class="far fa-user-circle"></i> Make User</button>
                       @csrf
                    </form>

Since I needed to pass the person ID to the create method im using a post route, But create route is a get route by default..

What I have tried 1/ passed the make user button as a get route, and with the person id

<td class="data-fixed-columns ml-3 col-md-2"><a href="{{route('users.create',$student->person->id)}}">Make User</a> </td>

But I dont know how to retrive the $student->person->id insite the create method

Activity icon

Replied to Header May Not Contain More Than A Single Header, New Line Detected

Create method only loads the create form ,that form submits data to store method,,

Activity icon

Started a new Conversation Header May Not Contain More Than A Single Header, New Line Detected

I have a view to list all students, and a button(form) to make each student as a users button code

 <form action="{{route('make.user')}}" class="float-left" method="POST">
      <input type="hidden" value="{{$student->person->id}}" name="person_id">
      <button class="btn btn-outline-success mb-2 float-left" style="text-decoration:none"><i class="far fa-user-			 
         circle"></i> Make User</button>
 @csrf
</form>

Controller

    public function create(Request $request)
    {
        $person=Person::select('id','first_name','last_name','reg_id','email')->where('id',$request->person_id)->get()->first();
        $roles=Role::select('id','name')->get();
        return redirect (view('user.create',compact('roles','person')));
    }

Route

Route::group(['middleware' => 'admin'], function () {
    
    Route::resource('/users', 'AdminUsersController');
    
});

Error

ErrorException
Header may not contain more than a single header, new line detected
http://cms.test/make-user
Jun
10
3 months ago
Activity icon

Started a new Conversation Load Custom Data Tables On Session

{{Auth::user()->name }}

Returns the details of current authenticated user, likewise is it possible to retrive data other tables which has a foreign key from users table.

ex: If a Student logged in I need to display logged Students Name, Or a Teacher logged in I need to display logged teachers name,

These names should be shown in a admin layout which included in every view throughout the application Both teacher and student tables has foreign key user_id which refers user table

How to do this?

May
28
3 months ago
Activity icon

Replied to Update Route Repeats Twice

No, It does not solve it

May
27
3 months ago
Activity icon

Replied to How To Pass A Id To The Controller Via The Route And View??

Thanks all for the kind help,,, problem solved

Activity icon

Started a new Conversation Update Route Repeats Twice

After Editing and Clicking Update my update route url displays as following in browser with a 404 error

 http://cms.test/profile_picture/196/profile_picture/196

Route

Route::get('profile_picture/{student}/edit_propic', '[email protected]_propic')->name('edit_propic');
Route::PATCH('profile_picture/{student}', '[email protected]_propic')->name('update_propic');

Controller

    public function update_propic(StudentRequest $request,Student $student,Photo $photo){
        dd($request);
        if($request->hasfile('photo_id')){
            $file=$request->file('photo_id');
            $name=time().$file->getClientOriginalName();
            $file->move('images',$name);
            $photo->where('id',$student['photo_id'])->update(['file'=>$name]);

        }
        $student->update($request);

        return view(route('student.profile',compact('student')));
    }
May
26
3 months ago
Activity icon

Replied to How To Pass A Id To The Controller Via The Route And View??

Returns me to the same page institutes/index rather redirecting

Activity icon

Started a new Conversation How To Pass A Id To The Controller Via The Route And View??

My Current Route

Route::post('institutes/{id}/del', '[email protected]_confirm');

View

 <form action="institutes/{{$institute->id}}/del" method="post"> 
        <button class=" flex-column btn-sm  btn-outline-danger my-1 mx-1 w-100"><i class="fas fa-trash-alt"></i> 	 
          Delete
</button>

                     @csrf
                  </form>

Controller

    public function del_confirm(Institute $institute,InstituteRequest $request)
    {

         return view('institutes.delete',compact('institute'));
    }
May
05
4 months ago
Activity icon

Replied to How To Pass A Different Forign Key Name Without Using Usual

Thankyou u verymuch for the help :)

May
04
4 months ago
Activity icon

Replied to How To Pass A Different Forign Key Name Without Using Usual

Parent Table (courses) primary key column is id, also Im passing the forign key name as a parameter,

    public function course(){
        return $this->belongsTo('App\Course','course');
    }

CourseClass Controller Index function

    public function index()
    {
        $classes=CourseClass::where('status', 1)->get();
        return view('course_class.index',compact('classes'));
        
    }
Activity icon

Replied to How To Pass A Different Forign Key Name Without Using Usual

Thankyou for the reply,,

course field Its not nullable,Since a single CourseClass must belong to a Course, and a Course can have multiple Courseclasses

Ex: Course : "English" class: Morning Class , Evening Class, NightClass

I didnt go with the table name classes since I cant have a model named Class

Activity icon

Started a new Conversation How To Pass A Different Forign Key Name Without Using Usual

CourseClass model

    public function course(){
        return $this->belongsTo('App\Course','course');
    }

CourseClass index

 <td>{{$class->course->title}}</td>

Error Code

Facade\Ignition\Exceptions\ViewException
Trying to get property 'title' of non-object (View: C:\xampp\htdocs\cms\resources\views\course_class\index.blade.php)
http://cms.test/classes
course_classes table field  for course  I used  'course' instead 'course_id'

Simply renaming the field on course_classes table would solve the issue, but as for documentation it says we can pass a different named foreign key
May
03
4 months ago
Activity icon

Replied to Facade\Ignition\Exceptions\ViewException Missing Required Parameters For [Route: Time.update]

Thanks for the rply,, My route list for the resource as following

        | GET|HEAD  | time/create                      | time.create          | App\Http\Controllers\[email protected]                         | web,timeslot     |
|        | PUT|PATCH | time/{time}                      | time.update          | App\Http\Controllers\[email protected]                         | web,timeslot     |
|        | GET|HEAD  | time/{time}                      | time.show            | App\Http\Controllers\[email protected]                           | web,timeslot     |
|        | DELETE    | time/{time}                      | time.destroy         | App\Http\Controllers\[email protected]                        | web,timeslot     |
|        | GET|HEAD  | time/{time}/edit                 | time.edit            | App\Http\Controllers\[email protected]                           | web,timeslot
May
02
4 months ago
Activity icon

Started a new Conversation Facade\Ignition\Exceptions\ViewException Missing Required Parameters For [Route: Time.update]

Facade\Ignition\Exceptions\ViewException Missing required parameters for [Route: time.update] [URI: time/{time}]. (View: C:\xampp\htdocs\cms\resources\views\timeslot\edit.blade.php) http://cms.test/time/4/edit Error : return new static("Missing required parameters for [Route: {$route->getName()}] [URI: {$route->uri()}].");

} //Link to Edit

<a href="{{route('time.edit',$timeslot->id)}}">{{$timeslot->timeslot_title}}</a>

---Controller---

public function edit(Timeslot $timeslot){
  return view('timeslot.edit',compact('timeslot'));

}
public function update(TimeslotRequest $request, Timeslot $timeslot){

    $timeslot->update($request->all());
      return redirect(route('time.index'));

}

-----Edit Form----

@extends('layouts.admin')
@section('content')
<h1>Edit Timeslot  Details </h1>
<form action="{{route('time.update',$timeslot->id)}}" method="POST">
    @method('PATCH')
    @include('timeslot.form')
    <button type="submit" class="btn btn-primary">Update Timeslot</button>

</form>
@endsection

---Route--

Route::group(['middleware' => 'timeslot'], function () {
    
    Route::resource('/time', 'TimeslotController');
    
});

Im using laravel 6 ,I have similar Controller with similar views in the same application which works fine,,Still cannot find the error even after comparing both...

Activity icon

Replied to How To Post A Question?

Thankyou All for the help,,, :)

Activity icon

Started a new Conversation How To Post A Question?

Im bit new here, When I copy my code parts into the question , most of the code is disappeared, how to define a separate code blog in a question

Apr
26
4 months ago
Activity icon

Started a new Conversation The POST Method Is Not Supported For This Route. Error

Im using a resource route,,

=====Form==== @extends('layouts.admin') @section('content')

Add New User

id}}">{{ $role->name }} @endforeach @error('role_id') {{$message}} @enderror Status
    <option value="{{1}}" >{{ 'Active' }}</option>
    <option value="{{0}}" >{{ 'Innactive' }}</option>

  </select>
  <div class="text-danger">@error('status_id') {{$message}} @enderror</div>   
</div>

@csrf Create User

@endsection

=====Route==== Route::resource('/users', 'AdminUsersController');

Mar
30
5 months ago
Activity icon

Started a new Conversation How To Genarate A QR Code For Each Customer Id

My Customer Controller store method as following, My requirement is to auto generate a qr code when adding new customer, qr code should saved as a png in the database,, later scanning this qr code should directed to a url which genrate a profile view of the customer,, Currently Im using show() to view a single customer

Im using https://www.simplesoftware.io/simple-qrcode/?ref=madewithlaravel.com to genarate qr

public function create()

public function store() { Customer::create($this->validateRequest());

    return redirect('customers');

} public function show(Customer $customer) {

   return view('customers.show',compact('customer'));

}

private function validateRequest() { return request()->validate([ 'name'=>'required|min:3', 'email'=>'required|email', 'company_id'=>'required', 'status'=>'required',

    ]);

}