<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
robertseghedi / laravel-advanced-security example snippets
// your providers
RobertSeghedi\LAS\LASProvider::class,
use RobertSeghedi\LAS\Models\LAS;
public function add_post(Request $req)
{
$post = new Post();
$post->title = $req->input('title');
$post->description = $req->input('description');
$post->user = Auth::user()->id;
$post->ip = LAS::ip(); // grabs the user IP
$post->browser = LAS::browser(); // grabs the user browser
$post->os = LAS::os(); // grabs the user OS
$saved_post = $post->save();
if($saved_post) return redirect()->back()->with('success', 'Article posted.');
}
public function insert_log($user_id = null)
{
$user = User::find($user_id);
$log = LAS::log($user_id, "$user->name joined the chat.");
if($log) return redirect()->back();
}
config/app.php
php artisan migrate
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.