Skip to content

Instantly share code, notes, and snippets.

View vijayrami's full-sized avatar
🎯
Magento2

Vijay Rami vijayrami

🎯
Magento2
  • India
View GitHub Profile
@vijayrami
vijayrami / LoginController.php
Created April 13, 2020 14:08
Redirect to custom URL after logout on Laravel
<?php
.....
use Illuminate\Http\Request;
class LoginController extends Controller
{
.....
/**
* Logout trait
composer require "santigarcor/laratrust"
Then in your config/app.php add the following to the providers array:
Laratrust\LaratrustServiceProvider::class,
add the following to the aliases array:
'Laratrust' => Laratrust\LaratrustFacade::class,
Run the next command to publish all the configuration files:
php artisan vendor:publish --tag="laratrust"
this will generate config\laratrust.php and \config\laratrust_seeder.php
@vijayrami
vijayrami / laravelbasics.txt
Last active May 16, 2020 11:28
Laravel Basic Stuff
go to htdocs directory and run:
composer create-project --prefer-dist laravel/laravel laravel
php artisan serve
Go to
App\Providers\AppServiceProvider
add below line at the begining.
use Illuminate\Support\Facades\Schema;
and in function boot add:
@vijayrami
vijayrami / Linux_Commands.md
Last active May 26, 2021 04:47
Linux Command Useful tips for developers

Search text inside folder

grep -Hrn 'texttosearch' /opt/lampp/htdocs/projectfolder/directory

grep -R --exclude-dir={css,js,img,lang} 'texttosearch' /opt/lampp/htdocs/projectfolder/directory

upload large .sql file from terminal

mysql -u root -ppassword databasename < myfile.sql

For Windows

@vijayrami
vijayrami / vendor_city_state.php
Last active April 8, 2016 06:18
Wordpress Get User Query
$country_m = $_REQUEST['country'];
$statu_m = $_REQUEST['state'];
$city_m = $_REQUEST['city'];
$query_args = array(
'role' => 'vendor',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'country',
@vijayrami
vijayrami / How To display error message in typo3
Created December 3, 2015 14:38
How To display error message in typo3
in typo3conf/LocalConfiguration.php file search for 'displayErrors'.
and set 'displayErrors' => 1,
Its done.
Now Error message will display at frontend.
@vijayrami
vijayrami / How To Add Javascript File From Typo3 Extension
Created December 3, 2015 14:22
How To Add Javascript File From Typo3 Extension
Add Below line in your typo3 extension controller file.
$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('extension_key') . 'Resources/Public/javascript/yourjsfile.js',$compress = FALSE, $forceOnTop = FALSE, $allWrap = '');
-- Change Extension key and your JS file path.
@vijayrami
vijayrami / How To disable cache in Typo3 extension
Created December 3, 2015 14:11
How To disable cache in Typo3 extension
Add below code in your Extension controller file.
$GLOBALS['TSFE']->set_no_cache();
@vijayrami
vijayrami / How to Change Typo3 Index Search Extension's Templates Path
Last active December 3, 2015 13:49
How to Change Typo3 Index Search Extension's Templates Path
From backend go into your root template.
In Setup, Add below code:
config.index_enable = 1
config.index_externals = 1
config.index_metatags = 1
plugin.tx_indexedsearch {
_CSS_DEFAULT_STYLE >
@vijayrami
vijayrami / How to Change Typo3 Powermail Extension's Templates Path
Created December 3, 2015 13:35
How to Change Typo3 Powermail Extension's Templates Path
From backend go into your root template (or in extension template where Powermail Extension is included).
In that, in Constants Editor Add below code:
plugin.tx_powermail {
view {
templateRootPath = EXT:yourtemplate/Resources/Private/Templates/Extensions/Powermail/Templates/
partialRootPath = EXT:yourtemplate/Resources/Private/Templates/Extensions/Powermail/Partials/
layoutRootPath = EXT:yourtemplate/Resources/Private/Templates/Extensions/Powermail/Layouts/
}