Sunday, March 12, 2017

Laravel 5 CRUD application not functioning as i want

im new to the laravel but i have to create fill in the blanks in paragraph through Create form.all what i need is when i press submit button on create form those parameters should fill this index.blade.phps paragraph`s blanks.see this.

@extends('layouts.app')
@section('content')
@foreach($items as $item)
                         <tr>
 <p>This is to hereby certify that, pursuant to .....  the Contract  between ..... under the said contract,including all but not least, for ...... main and miscellaneous eqipment ..... have successfully supplied on dd/mm/yy</p>

                        </tr>
    @endforeach
@endsection

Here is the index.blade.php which i created

    @extends('layouts.app')

@section('content')

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

                         <p>This is to hereby certify that, pursuant to <td></td>  the Contract  between <td></td> under the said contract,including all but not least, for <td></td> main and miscellaneous eqipment for <td></td> have successfully supplied on dd/mm/yy</p>

                        </tr>
    @endforeach
@endsection

if i create new parameters through create function then submit index view file repeated that paragraph with filled blanks.but i want is when i press submit keep the paragraph same but need to change parameters only.can anyone suggest what should go here.

here is my controller functions

    public function index()
{
     $items = SummeryForm::all();
    return view('summeryform/index', compact('items'));
}


public function create()
{
     return view('summeryform/create');
}


public function store(Request $request)
{
    $item = new SummeryForm;
    // $item ->id = Auth::user() ->id;
    $item ->po = $request ->po; 
    $item ->company = $request ->company;
    $item ->boq_name = $request ->boq_name;
    $item ->project_name = $request ->project_name;
    $item ->save();

         SummeryForm::create($request->all());
            return redirect()->route('summeryform.index')
                    ->with('success','Item created successfully');
}

Thank you.



via Dasun

Advertisement