dimanche 25 juin 2017

Laravel Date/Time Carbon Issue

i`m developing attendance management system.view is like this.

enter image description here what i need is if i select the time value and press Mark here button current data and time value need to be stored in the database according to trainee ID.

Here is the view for that .

   <table class="table table-striped">
              <thead>

               <th>Trainee ID</th>
                <th>Name with Initials</th> 
                <th>Time</th>
                <th>Mark Here!</th>
              </thead>

              <tbody>
                @foreach($items as $item)

          <tr>
             <td>
                <div class="form-group">
                <input type="text" name="trainee_id" class="form-control" value="">
                </div>
             </td>

              <td>

              
              </td>

              <td>
                <label><input type="checkbox" name="time" id="time" value="time">&nbsp; Time</label>
              </td>

                <td>
                <a class="btn btn-info" href="Bankdetails/">Mark Here</a>
              </td>
          </tr>
                @endforeach
              </tbody>

      </table>

I know that my controller is perfectly alright and need to be fixed.

` public function store(Request $request)
    {
        $queryType = $request->time;
        $carbon = new Carbon('queryType');
        attendancedetails::create($request->all());
                return view('traineeattendance.attendanceo');
    }`

Here is the necessary data model .

`class attendancedetails extends Model
{
    protected $table = "attendancedetails";
   protected $fillable = ['id',
   'attendance_date',
   'trainee_id',
   'name',
   'starting_time',
   'end_time',
   'site_visit_time'];
}`

Can anyone suggest me to get fixed this.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire