mercredi 7 novembre 2018

How can I change "127.0.0.1:8000" to my desired url. (laravel)

I'm using laravel and I don't know how to customize the default url which is "127.0.0.1:8000" or "localhost:8000" to my desired url.

My expectation is to change 127.0.0.1:8000 to sample.dev when I do php artisan serve

Do I really need to move my projects to htdocs or www?

Please help...



via Chebli Mohamed

mardi 6 novembre 2018

NPM installation problem In Laravel in Windows 10

My NPM ver is 5.6.0 My Node ver is v8.11.3 Laravel Framework 5.7.12

I have some Problems When i want to install The npm in laravel which are as follows

npm install

npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

node-sass@4.10.0 install C:\xampp\htdocs\Newapp\node_modules\node-sass

node scripts/install.js

'node' is not recognized as an internal or external command, operable program or batch file.

npm WARN img-loader@3.0.1 requires a peer of imagemin@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! node-sass@4.10.0 install: node scripts/install.js

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the node-sass@4.10.0 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR! C:\Users\bamas\AppData\Roaming\npm-cache_logs\2018-11-07T03_33_04_531Z-debug.log

MY package.json is

{ "private": true, "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "npm run development -- --watch", "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "axios": "^0.18", "bootstrap": "^4.0.0", "cross-env": "^5.1", "jquery": "^3.2", "laravel-mix": "^2.0", "lodash": "^4.17.5", "popper.js": "^1.12", "vue": "^2.5.17" } }

I already tried everithing like cache clear re installing nodemodules but its not effect.. My NPM is alright Because whenever i run my other Nodejs script it work perfectly i am using gitbash....



via Chebli Mohamed

none Database Model two attributes in Laravel

i'm a newbie in Laravel Please Guide me.

1- Port is a Model and Coordinates is a none database Model. 2- 2 floats are lat and long in Port Model.

When a port is loaded from the database, the 2 floats are casted to a Coordinates-object. Second Question How to make a non-database model with two attributes.



via Chebli Mohamed

lundi 5 novembre 2018

Using multiple controllers in the same route gets route undefined

I get an error of undefined route when using multiple controllers in the same route:

Here is the code my controllers:

public function triealphabet(){
    $list_grocery = miscellaneous::all();
    $list_grocery = $list_grocery->sortBy('name');
    return view('markets.miscellaneous')->with('list_grocery',$list_grocery);}
public function triecreation(){
    $list_grocery = miscellaneous::all();
    $list_grocery = $list_grocery->sortBy('created_at');
    return view('markets.miscellaneous')->with('list_grocery',$list_grocery);}

and here are my routes code :

Route::get('/miscellaneous','groceryController@listGrocery')->name('groceriesmarket'); 
Route::get('/miscellaneous','groceryController@triealphabet')->name('triealphabet');
Route::get('/miscellaneous','groceryController@triecreation')->name('triecreation');

P.S: If I use an other route path like '/miscellanous-tri-alphabet' I don't get any other errors, but other than that I get an error of undefined route



via Chebli Mohamed

vendredi 2 novembre 2018

Can any one filter admin theme and give rank to the themes to use in laravel?

I am so confused to choose admin theme for laravel can anyone list me best admin panel as per its quality, and give description for what, that is flexible?



via Chebli Mohamed

kendo directive for anuglarjs how to update record with id and go to update page?

I have taken the id from selected field in kendo grid, and I am using angularjs directive. Now I don't understand how to update the selected Id record. I mean to say with the selected Id I want to go to update page. The work I have done is given below.

 (function () {
angular.module('moduleName').directive('kendoGridRowDblClick', kendoGridRowDblClick);

function kendoGridRowDblClick() {
    return {
        link: function (scope, element, attrs) {
            scope.$on("kendoWidgetCreated", function (event, widget) {

                if (widget !== element.getKendoGrid())
                    return;

                attachDblClickToRows(scope, element, attrs);

                //element.data("kendoGrid").bind('dataBound', function () {
                  //  attachDblClickToRows(scope, element, attrs);
                //});
            });
        }
    };

    function attachDblClickToRows(scope, element, attrs) {
         var id = $(element).find(".k-state-selected td:eq(1) span").html();
     console.log($(element).find(".k-state-selected td:eq(0) span").html());   
    }
})();

With td:eq(1) it gives me the correct id when I dblclick on a record in a grid, With console.log it gives me the span value which is given below, and i want to take the id and go to the new state for updating page. I have defined the span here which is hidden field

{field: "", hidden: true, template: "<span>Akhtar</span>"},

And ofcourse I have database fields too, but here I just want to go to an update state/page instead of just printing the span value Akhtar in console. Any help would be appreciated. Thanks in advanced



via Chebli Mohamed

jeudi 1 novembre 2018

Laravel package musonza/groups Laravel 5 user groups package how to start after running migrations?

I have been able to finish up but the migrations part but i don't know how to start I'm new to laravel and i want to use this package in a project i'm building. Any tutorials, guidance or recommendations is much appreciated.



via Chebli Mohamed