Skip to content

Instantly share code, notes, and snippets.

View ManojKiranA's full-sized avatar
🔍
Focusing

Manoj Kiran ManojKiranA

🔍
Focusing
  • Postiefs Technologies Private Limited
  • Coimbatore
View GitHub Profile
@ManojKiranA
ManojKiranA / Install.php
Last active November 15, 2019 15:06
Installtion of first Laravel Projects
laravel new projectname &&
composer require laravel/telescope --dev &&
composer require barryvdh/laravel-debugbar --dev &&
php artisan telescope:install &&
php artisan telescope:publish &&
php artisan migrate &&
php artisan telescope:publish &&
composer require spatie/laravel-activitylog &&
php artisan vendor:publish --provider="Spatie\Activitylog\ActivitylogServiceProvider" &&
php artisan migrate &&
@ManojKiranA
ManojKiranA / full.php
Last active December 21, 2021 01:39
Inertia Js Paginate
Route::get('/', function (\Illuminate\Http\Request $request) {
$initialSearch = $request->query('search', '');
$userQuery = User::query()
->when($request->filled('search'),function($query) use ($initialSearch){
$query->where('name','LIKE','%'.$initialSearch.'%')
->orWhere('email','LIKE','%'.$initialSearch.'%');
});
<?php
namespace App\Merge;
class Marge
{
protected $data = [];
public function setData($data)
{
@ManojKiranA
ManojKiranA / Links.vue
Created December 19, 2019 09:14
Inertia Js
@ManojKiranA
ManojKiranA / SingletonModel.php
Created January 25, 2020 02:04 — forked from mpociot/SingletonModel.php
Making it easier to work with single row models in Laravel
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class SingletonModel extends Model
{
protected function store($data = [])
{
@ManojKiranA
ManojKiranA / HasFilters.php
Created February 6, 2020 00:13 — forked from nkeena/HasFilters.php
A simple trait that provides robust filtering by a model's attributes
<?php
namespace App\Traits;
use Illuminate\Support\Str;
trait HasFilters
{
public function scopeFilter($query, $filters = [])
{
@ManojKiranA
ManojKiranA / LimitNumberOfItemsRule.php
Last active December 3, 2020 10:35
Laravel Validation Rules for limiting the minimum and maximum number of fileds in given array
<?php
namespace App\Rules;
use Illuminate\Support\Str;
use Illuminate\Contracts\Validation\Rule;
class LimitNumberOfItemsRule implements Rule
{
/** @var array */
@ManojKiranA
ManojKiranA / alpine-todo.html
Created May 18, 2020 11:40 — forked from kez/alpine-todo.html
Alpine.js Todo App Demo (with Tailwind). Please feel free to fork and refactor with improvements! Motivation/details here https://www.kdobson.net/2020/alpine-js-todo-demo/)
<!DOCTYPE html>
<html lang="en">
<head>
<title>Alpine.js Todo Demo</title>
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.js" defer></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tailwindcss/ui@latest/dist/tailwind-ui.min.css">
<meta charset="utf-8">
</head>
<?php
namespace App\Charts;
use App\Support\Livewire\ChartComponentData;
use ConsoleTVs\Charts\Classes\Chartjs\Chart;
/**
* Class WanSpeedTestsChart
*