Thursday, June 29, 2017

Helper Method in laravel

1. view
2.

Laravel Routing

1. Route::any("test",function(){

});

2. Route::match(['get', 'post'], '/test', function () {
});
 
 
3. Route::get("abc", TestController@abcFunction);
 
4. Route::post("abc", TestController@abcFunction); 
 
5. Route::controller('admin', TestController); missingMethod($parameter=array)
 
6. php artisan route:list
 
7. Route(/test/{number}, TestController@test);
 
8. Route::get('user/{name}', function ($name) {})->where('name', '[A-Za-z]+'); 
 
9. Route::middleware(['first', 'second'])->group(function () {
    Route::get('/', function () {
        // Uses first & second Middleware
    });

    Route::get('user/profile', function () {
        // Uses first & second Middleware
    });
});
 
10. Route::namespace('Admin')->group(function () {
    // Controllers Within The "App\Http\Controllers\Admin" Namespace
});  
 
11. Route::group(["prefix"=>'admin','middleware'=['web']],function(){
}); 
 
12. Route::controller("admin-panel", ) 
 

Thursday, June 15, 2017

Sublime Learning

Create Project In Sublime

Select Project . It will select all files


1. Open Window in tab
command + ,
"open_files_in_new_window": false


2. Find + Replace
commmand + alt()  + F

3. Search File in particular directory

Command +P

4. Search  functions
Command + R


5. Switching File
Shift+Command + ] and shift + Command + [








Learning Laravel




If Not installed composer install it

curl -sS https://getcomposer.org/installer | php




sudo mv composer.phar /usr/local/bin/
vim ~/.bash_profile
alias composer="php /usr/local/bin/composer.phar"
composer global require "laravel/installer"
export PATH=~/.composer/vendor/bin:$PATH


Create Project In Laravel
 
laravel new blog
composer update --no-scripts 
cp .env.example .env
php artisan key:generate
 
 
Open .env file 
Change User name and Password  and database for mysql
php artisan migrate
 
create table in laravel
php artisan make:migration create_users_table --create=users 
 
php artisan migrate 
 
php artisan make:model Task 

1. Routes files
app/http/routes.php


2. view files
resources/views/

3. js/css files
public
authController.js

4. Query Enabling

DB::enableQueryLog();
      
DB::getQueryLog();

Wednesday, June 14, 2017

Mac(OSX) MONGODB PHP Driver

brew doctor
 
brew update
 
brew upgrade  

xcode-select --install

brew install pkg-config

brew install autoconfbrew install openssl

ln -s ../opt/openssl/include/openssl .

sudo pecl install mongodb

sudo cp /etc/php.ini.default /etc/php.ini

php -i | grep php.ini

subl /etc/php.ini

sudo apachectl restart