Is your website using SSL and why you should care?
Read the below blog to learn about Is your website using SSL and why you should care?
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_
Read the below blog to learn about Is your website using SSL and why you should care?
This document aims to provide step by step approach to implement RESTful APIs in laravel. Brief description of difference between GET and POST HTTP methods, REST methods is given. However understanding of REST architecture will be an added advantage.
Laravel provides methods by which one can implement RESTful APIs easily. With this CRUD (Create, Retrieve, Update, Delete) operations on database can be performed.
Let’s have a look at the difference between HTTP methods – GET and POST
The GET Method
The POST Method
The following table compares the two HTTP methods: GET and POST.
[ninja_tables id=”215366″]
Restful APIs
Architecture for developing web services
In RESTful APIs, we use the HTTP verbs as actions, and the endpoints are the resources (e.g., database) acted upon.
HTTP verbs are:
Restful APIs in Laravel using resource controllers
php artisan make:controller PhotoController –resource
Route::resource(‘photos’, ‘PhotoController’);
Actions Handled By Resource Controller
[ninja_tables id=”215372″]
Spoofing for PUT, PATCH and DELETE methods
<form action=”/foo/bar” method=”POST”>
@method(‘PUT’)
</form>
except,only, match resource routes
Route::resource(‘photos’, ‘PhotoController’)->only([
‘index’, ‘show’
]);
Route::resource(‘photos’, ‘PhotoController’)->except([
‘create’, ‘store’, ‘update’, ‘destroy’
]);
Route::match([‘get’, ‘post’], ‘/’, function () {
//
});
Methods in Controller
class UsersController extends BaseController
{
public function index() {}
public function show($id) {}
public function store() {}
}
Route precedence
Route::get(‘/users/{name}’, ‘SomeController@action’);
Route::get(‘/users/admins’, ‘SomeController@action’);
Protection against CSRF attacks
@method(‘PUT’)
<div class=”col-sm-9 offset-md-3″>
<button type=”submit” class=”btn btn-success”>{{__(‘Update record’)}}</button>
</div>
</form>
<form class=”form” method=”get” action=”{{action(‘HakenBranchControllerTest@action’,[ ‘name’ => ‘Laravel’])}}” enctype=”multipart/form-data” >
{{ csrf_field() }}
<div class=”col-sm-9 offset-md-3″>
<button type=”submit” class=”btn btn-success”>{{__(‘Route Precedence’)}}</button>
</div>
</form>
<form class=”form” method=”get” action=”{{route(‘admin’)}}” enctype=”multipart/form-data” >
{{ csrf_field() }}
<div class=”col-sm-9 offset-md-3″>
<button type=”submit” class=”btn btn-success”>{{__(‘Route Precedence’)}}</button>
</div>
</form>
<form class=”form” method=”get” action=”{{action(‘HakenBranchControllerTest@show’,[ ‘id’ => 7])}}” enctype=”multipart/form-data” >
{{ csrf_field() }}
<div class=”col-sm-9 offset-md-3″>
<button type=”submit” class=”btn btn-success”>{{__(‘Show a record’)}}</button>
</div>
</form>
<form class=”form” method=”get” action=”{{action(‘HakenBranchControllerTest@create’)}}” enctype=”multipart/form-data” >
{{ csrf_field() }}
<div class=”col-sm-9 offset-md-3″>
<button type=”submit” class=”btn btn-success”>{{__(‘Add new record’)}}</button>
</div>
</form>
<form class=”form” method=”get” action=”{{route(‘except’,[ ‘id’ => 7])}}” enctype=”multipart/form-data” >
{{ csrf_field() }}
<div class=”col-sm-9 offset-md-3″>
<button type=”submit” class=”btn btn-success”>{{__(‘Add new record’)}}</button>
</div>
</form>
Conclusion – Laravel provides support for RESTful APIs. Laravel scaffolding support for CRUD APIs helps to concentrate on business logic and fast development.
Presenty / Attendance App for schools, colleges and classes
Purpose of this app is to record presenty/ attendance of every student.
It has two parts:
(1) Contact us to get the access to https://presenty.fairshare.tech/
(2) You will see admin dashboard as below

(3) Add teachers

(4) Add batches which is a combination of class and subjects

(5) Add / Maintain students

(6) Download or view attendance

(7) Teacher app for marking attendance


QR Code Based Attendance – You will need to send your Gmail ID to info@fairshare.tech for permission.
QR Code Based Attendance that logs attendance in a Google Sheet.
Data will remain under your control and not on our servers.
Available on Play Store