Browsed by
Category: Laravel

Rest api development with lumen – part 1 : Environment setup

Rest api development with lumen – part 1 : Environment setup

Step 1 : Open command line tool or terminal for mac/ linux  and run this command for lumen installer . If you have not composer installed then download and install it from here ; https://getcomposer.org/ composer global require “laravel/lumen-installer” Step 2 :   Create a lumen project with following command   composer create-project –prefer-dist laravel/lumen restapi Step 3 :      Go the project directory and run the project  php -S localhost:8000 -t public      Step 4 : Database file setup . Open .env file and setup database file . For mysql it looks like –  If you have no database create database for localhost . You need to install XAMP/WAMP . APP_ENV=local APP_DEBUG=true APP_KEY= APP_TIMEZONE=UTC LOG_CHANNEL=stack LOG_SLACK_WEBHOOK_URL= DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=lumen_api DB_USERNAME=root DB_PASSWORD= CACHE_DRIVER=file QUEUE_DRIVER=sync change the database name , password…

Read More Read More

Laravel 5.5 : include css , js and image for boostrap theme .

Laravel 5.5 : include css , js and image for boostrap theme .

Put your assets in the public folder public/css public/images public/fonts public/js And then called it using Laravel   {{ URL::asset(‘js/scrollTo.js’); }} // Generates the path to public directory public/js/scrollTo.js {{ URL::asset(‘css/css.css’); }} // Generates the path to public directory public/css/css.css {{ URL::asset(‘image/one.png’); }} //Generates the path to public directory public/image/one.png or {{ HTML::script(‘js/scrollTo.js’); }} // Generates the path to public directory public/js/scrollTo.js {{ HTML::style(‘css/css.css’); }} // Generates the path to public directory public/css/css.css  {{ HTML::style(‘image/one.png’); }} //Generates the path to…

Read More Read More

Laravel – Please provide a valid cache path

Laravel – Please provide a valid cache path

In laravel sometime cache not valid problem shows . What’s the reason ? Reason is there had no cache path in the storage directory . To solve this problem , try this : create these folders under storage/framework: sessions views cache Now its worked! More         

Script php artisan clear-compiled handling the pre-update-cmd event returned with error code 255

Script php artisan clear-compiled handling the pre-update-cmd event returned with error code 255

In laravel there may be shown the following error when working with bellow laravel 5.3 projects . Cause composer structure has been changed .   So how to solve it : Its easy way to just replace the code in composer.php (Only bold sections) :   { “name”: “laravel/laravel”, “description”: “The Laravel Framework.”, “keywords”: [“framework”, “laravel”], “license”: “MIT”, “type”: “project”, “require”: { “php”: “>=5.6.4”, “laravel/framework”: “5.4.*”, “laravel/tinker”: “~1.0” }, “require-dev”: { “fzaninotto/faker”: “~1.4”, “mockery/mockery”: “0.9.*”, “phpunit/phpunit”: “~5.7” }, “autoload”: {…

Read More Read More

How to install and fix all errors after clone laravel project from github ?

How to install and fix all errors after clone laravel project from github ?

Installation Follow the instructions below to install the project Clone the repository using git clone composer install npm install Create .env by copying the env.example file php artisan key:generate php artisan migrate Set administrator info in UserTableSeeder.php // Optional php artisan db:seed run gulp or gulp watch (Install gulp (sudo npm install -g gulp) if needed) // optional

Laravel : Specified key was too long error

Laravel : Specified key was too long error

Laravel 5.4 or later  made a change to the default database character set, and it’s now utf8mb4 which includes support for storing emojis. This only affects new applications and as long as you are running MySQL v5.7.7 and higher you do not need to do anything. For those running MariaDB or older versions of MySQL you may hit this error when trying to run migrations: [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is…

Read More Read More