laravel_tutorial
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Laravel<br />
app/Http/routes.php<br />
Route::get('insert','StudInsertController@insertform');<br />
Route::post('create','StudInsertController@insert');<br />
Step 6: Visit the following URL to insert record in database.<br />
http://localhost:8000/insert<br />
Step 7: The output will appear as shown in the following image.<br />
Retrieve Records<br />
After configuring the database, we can retrieve the records using the DB facade with<br />
select method. The syntax of select method is as shown in the following table.<br />
Syntax<br />
array select(string $query, array $bindings = array())<br />
Parameters<br />
<br />
<br />
$query(string) – query to execute in database<br />
$bindings(array) – values to bind with queries<br />
Returns<br />
Description<br />
array<br />
Run a select statement against the database.<br />
Example<br />
Step 1: Execute the below command to create a controller called StudViewController.<br />
php artisan make:controller StudViewController --plain<br />
Step 2: After successful execution, you will receive the following output:<br />
67