Archive | Laravel

RSS feed for this section

Laravel few basic command

Create Project: composer create-project –prefer-dist laravel/laravel laravalstartup Controller Create: php artisan make:controller HomepageController Model Create: php artisan make:model Student. Migration Create: php artisan make:migration create_post_table –create=posts Migrate Tables: php artisan migrate Last 5 Migrate Tables: php artisan migrate:refresh –step=5 Database table drop & recreate: php artisan migrate:refresh Clear view cache: php artisan view:clear (12) 000

Read full story Comments { 0 }

Laravel raw custom query with pagination

Custom Query with pagination: Controller:       public function blogs_list() { $title=”List of blog post”; $data = $this->paginateArray( DB::select(“SELECT blogs.id, blogs.title, blogs.description, blogs.created_at, categories.id, categories.category_name FROM (categories categories INNER JOIN post_category_map post_category_map ON (categories.id = post_category_map.category_id)) RIGHT OUTER JOIN blogs blogs ON (blogs.id = post_category_map.post_id) WHERE (categories.id = 1)”)); return view(‘crud.blog_list’)->with(‘title’,$title)->with(‘blogposts’,$data); } public function paginateArray($data, $perPage = […]

Read full story Comments { 0 }

Easy way to install Laravel in windows

Install Composer Download Windows installer and install it. Install Laravel Via Composer Create-Project Open a terminal (cmd) and go to the directory  where you want to install. then use following command composer create-project laravel/laravel –prefer-dist If you getting an error saying: failed to clone https://github.com/php-fig/log.git, git was not found, check that it is installed and in […]

Read full story Comments { 0 }

How to set git enviroment variable

You need to add the directory you installed git to to your PATH environment variable. Right click on Computer. Click Advanced System Settings Click Environment Variables inside the Advanced Menu Under System Variables, scroll to PATH Add ;”C:\path\to\git\bin”;”C:\path\to\git\cmd” Test the git command in the command prompt to see if it worked. Git is usually located […]

Read full story Comments { 1 }