jahstation

Experience

860

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 1 Lesson Completed
  • 0 Favorites

6th February, 2018

jahstation left a reply on Simple Regex Validation Fails • 2 weeks ago

thanks! it works! just added "[" and ]

            'regex:/[\[email protected]$\*\(\)_=\?;\':\[\]\",.]/',

2nd February, 2018

jahstation started a new conversation Simple Regex Validation Fails • 3 weeks ago

I need a way to add a regex to a validator, but it seem a little bit problematic to me, even I followed as described in the doc to put all rules on array.

I need that my password can contain at least (or more) these symbols " [][email protected]$*()_-=?;':",. "

so the regex to me is something like [list of symbols]

I write my code as:

$rules = array(
        'password' =>array('required',
        'min:6','confirmed',
        'regex:[[email protected]$*()_=?;\':\",.]'),
        'userName'=> array('required','min:3','max:25'),
        'email' => array('required','email'),
        'type' => array('required','max:13'),
    );

but every time an error is raised!

(1/1) ErrorException preg_match(): Compilation failed: nothing to repeat at offset 3 in ValidatesAttributes.php (line 1050)

22nd January, 2018

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

hi to all I found a possible reason... and its so strange to me, a class, i cant remeber now wich one sorry, from the Auth package (vendor/laravel/framework/src/illuminate/foundation/auth/) was simply cut before the end! so there was half method and the class (or the trait i cant remeber) was not properly closed! I solve it simply by copying file from another laravel installation... the main thing is that composer update ran without error!!!!!

thanks to all contributors

18th January, 2018

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

yes im revert to the last working backup... but to me is still no sense that a composer update broke all! thanks anyway for your tips

17th January, 2018

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

no is the template where ive based all my laravel app... funny!

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

another cool feature for me: if i open the home from the "icognito mode" the framework show me the page but the login not works anymore

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

no... this is the code present even online -where the site still works- and i didnt touch anything in this class

public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->guest()) { if ($request->ajax() || $request->wantsJson()) { return response('Unauthorized.', 401); } else { return redirect()->guest('login'); } }

    return $next($request);
}

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

your function show me the user!

trying to troubleshooting ive found that the code that rise the error is inside Class "Authenitcate" function "handle"

Auth::guard($guard)->guest()

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

adding the complete path on the model so "App\Models\User" and then import it on web.php, it works!

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

this is the composer update output:

composer update Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 1 install, 27 updates, 0 removals

  • Updating tijsverkoyen/css-to-inline-styles (2.2.0 => 2.2.1) Loading from cache
  • Updating symfony/polyfill-mbstring (v1.5.0 => v1.6.0) Loading from cache
  • Updating symfony/var-dumper (v3.3.10 => v3.4.3) Loading from cache
  • Updating symfony/routing (v3.3.10 => v3.4.3) Loading from cache
  • Updating symfony/process (v3.3.10 => v3.4.3) Loading from cache
  • Installing symfony/polyfill-php70 (v1.6.0) Loading from cache
  • Updating symfony/http-foundation (v3.3.10 => v3.4.3) Loading from cache
  • Updating symfony/event-dispatcher (v3.3.10 => v3.4.3) Loading from cache
  • Updating symfony/debug (v3.3.10 => v3.4.3) Loading from cache
  • Updating symfony/http-kernel (v3.3.10 => v3.4.3) Loading from cache
  • Updating symfony/finder (v3.3.10 => v3.4.3) Loading from cache
  • Updating symfony/console (v3.3.10 => v3.4.3) Loading from cache
  • Updating ramsey/uuid (3.7.1 => 3.7.2) Loading from cache
  • Updating symfony/translation (v3.3.10 => v3.4.3) Loading from cache
  • Updating mtdowling/cron-expression (v1.2.0 => v1.2.1) Loading from cache
  • Updating erusev/parsedown (1.6.3 => 1.6.4) Loading from cache
  • Updating doctrine/inflector (v1.1.0 => v1.2.0) Loading from cache
  • Updating watson/bootstrap-form (1.1.11 => 1.1.14 Downloading: 100% .
  • Updating spatie/laravel-permission (1.13.0 => 1.15.0) Downloading: Connectin Downloading: 100%
  • Updating ixudra/curl (6.13.0 => 6.16.0) Downloading: 100%
  • Updating symfony/yaml (v3.3.10 => v3.4.3) Downloading: 100%
  • Updating phpunit/php-file-iterator (1.4.2 => 1.4.5) Loading from cache
  • Updating phpunit/php-token-stream (1.4.11 => 2.0.2) Loading from cache
  • Updating phpdocumentor/type-resolver (0.3.0 => 0.4.0) Loading from cache
  • Updating phpdocumentor/reflection-docblock (3.2.2 => 4.2.0) Loading from cache
  • Updating phpspec/prophecy (v1.7.2 => 1.7.3) Loading from cache
  • Updating myclabs/deep-copy (1.6.1 => 1.7.0) Loading from cache
  • Updating phpunit/phpunit (5.7.22 => 5.7.26) Downloading: 100% Writing lock file Generating autoload files

Illuminate\Foundation\ComposerScripts::postUpdate php artisan optimize Generating optimized class loader The compiled services file has been removed. [email protected]:~/workspace/vAss$ php artisan serve

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

the only operation made from before (site working) and after (site broken) is to run "composer update" that was run without errors, and no edit over the composer.json. the template is still to update so!

so im with a broken site with a non update template that have a bug! :D whatta lovely day!

ive no idea about what i can show you to try to solve the probelm... the file that u mention are not edited!

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

ok maybe i made a wrong step runnings composer update. but i didnt think to broke all!

by the way no edit con composer.json file

jahstation left a reply on Column Not Find After Run A "composer Update" • 1 month ago

no this not solve my problems, and the controller are not modified from before/after composer update!

I read that can be a problem about primary key of the user and i try to add: protected $primaryKey = 'id';

on my user's model, but again this didnt fix my issue

jahstation started a new conversation Column Not Find After Run A "composer Update" • 1 month ago

I run gentelella admin template over laravel 5.4, after seeing that there is some bug that are fixed with the new relase of Gentelella I tried to run: composer update on my root project folder to fix issue, the command was ok with no error rised during exectution.

After i try to access to the home page of my project but ive received this error message:

(2/2) QueryException SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause' (SQL: select * from users where `` = 1 limit 1) in Connection.php (line 647)

where i wrong something? thanks thanks

16th January, 2018

jahstation left a reply on Auth Without A Model • 1 month ago

I found this tutorial online, it can be usefull? https://www.georgebuckingham.com/blog/laravel-52-auth-custom-user-providers-drivers/

to me is a likkle bit complicate to follow because it mix concept from auth and no... so i dont really get some basic point...

on the laravel manual is showed as silly thing, but isnt to me!

jahstation left a reply on Auth Without A Model • 1 month ago

thanks a lot, ill check and ill let u know if it works for me! cheers

jahstation started a new conversation Auth Without A Model • 1 month ago

I've a project where for a quick start ive implemented security with auth using the classic "user model". Now ive to update it using an external login service (REST). Wich is the most convenient way to do it without trashing all the auth part?

27th December, 2017

jahstation left a reply on A Simple Client/server Game • 1 month ago

apologize maybe is a silly question, but to me is not clear how to laravel have a connection/socket with a specific user. Keep in mind that maybe im complete out of the road...

jahstation started a new conversation A Simple Client/server Game • 1 month ago

I'd like to understand if it possible implements an application in a pure multi client/server way... don't mind about the specific thing but I'd like implementes a server that invite in a sort of "room" (page) just 3 -or more- user registred on the platform (for the start is enough that only those can login on this specific page) and then those users sends "something" to the server, the server waiting for all players reply's and then close the room/page.

So: -the server sets a temporary room for some given users; -the users(clients) invited can only access to this page; -clients send something back to the server; -server waiting for "N" client reply, then send them back a message, and the room is no more active;

the first 2 step are not so complicated in my mind but i cannot imagine how to do the last 2 step, any tips are so wellcome.

thanks

7th September, 2017

jahstation left a reply on Problem Serving Stored File In Local • 5 months ago

ok im feel a little bit stupid now... the problem comes from some special char in the file name... thanks a lot for every tips they helped me alot in understanding how storage works!

6th September, 2017

jahstation left a reply on Problem Serving Stored File In Local • 5 months ago

im really confused! thanks for your help bashy!

  1. saving file like:

  $pathComplete=$request->ddt_file->storeAs($patz,$fileName);

And then save it on the db is the right choice?

  1. as I said there is a folder for each user under Storage/app/public/users: 1- Storage/app/public/users/user1 2- Storage/app/public/users/user2 n- Storage/app/public/users/userN And so on. Is it the correct way to do it?

I'm lost on a thing that seems so easy!!!

jahstation left a reply on Problem Serving Stored File In Local • 5 months ago

$url=Storage::url('users/USERX/FILEx.png');
echo "<img src='".asset($url)."' />";

give me a broken link! even if the src seems ok like:

<img src="http://localhost:8000/storage/users/USERX/FILEx.png">

with or without the edit that you suggest me!

jahstation left a reply on Problem Serving Stored File In Local • 5 months ago

in my db there is a relative path from users so something like "users/USERX/fileX.png"

what you mean by chancing the root.....

thanks

jahstation started a new conversation Problem Serving Stored File In Local • 5 months ago

I've a form that upload even some files for user in a personal user's folder. I've done that with code like:

if(! Storage::disk('public')->has("users/".$username."_".Auth::user()->id)) { Storage::makeDirectory("public/users/".$username."_".Auth::user()->id); } $patz="public/users/".$username."_".Auth::user()->id; $now= new \Carbon\Carbon(); $fileName = 'ddt_'.$username."_".$now->toAtomString().'.'.$request->ddt_file->getClientOriginalExtension(); $pathComplete=$request->ddt_file->storeAs($patz,$fileName);

then i save the url in db table for having it ready to serve!

This save my files on: /storage/app/local/users/USERX/fileX_date_.originalextension

Then i made a sym link with the instruction php artisan storage:link

But then there is no way to show this file to front end! On my config/filesystem.php there is: 'public' => [ 'driver' => 'local', 'root' => storage_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ],

when im using commands like: $url=Storage::url('users/USERX/FILEx.png'); the result is a string like: /storage/users/USERX/fileX.png if i put it in assett() function not works!

where I wrong?

24th July, 2017

jahstation started a new conversation Change Table For Entrust And Auth • 6 months ago

I need to move my default user table as a more complex one that will be "companies", so i need to understand how to move all models and relations of those (Auth and https://github.com/Zizaco/entrust ) for make it works again because now is just a big mess!

I put all field from user in new table called companies, then is better to manual rename the other migrations or is best to solve it from config file and how? thanks to any contributor

4th July, 2017

jahstation left a reply on Validation Rules Abstraction • 7 months ago

rules are the same how can i name error bag then

28th June, 2017

jahstation left a reply on Validation Rules Abstraction • 7 months ago

hold on ive some more problem:

im using modal for creating form on the html/blade page, one is for a new data the other is for editing.

so how can i add this feature with the approach that you show me:

Named Error Bags If you have multiple forms on a single page, you may wish to name the MessageBag of errors, allowing you to retrieve the error messages for a specific form. Simply pass a name as the second argument to withErrors:

return redirect('register') ->withErrors($validator, 'login');

jahstation left a reply on Validation Rules Abstraction • 7 months ago

ok i think that now is clear thanks a lot! to resume: -i can make a general request for store and update method too -i can add a method like message() to the req class to personalize some of the message? cheers

jahstation left a reply on Validation Rules Abstraction • 7 months ago

ehy @Snapey can you please link me some example of this approach style, thanks

27th June, 2017

jahstation started a new conversation Validation Rules Abstraction • 7 months ago

Hi to all, I've a silly question for some expert that drive me crazy and maybe is so simple to solve: validation how to make it aviable for any method on a controller.

If i write a store method inside a controller and i put some validation everything works perfect:

public function store(Request $request) { $this->validate($request, [ 'name' => 'required|max:255', 'business_name' => 'required', 'address' => 'required', 'email' => 'required|email|max:255', 'phone' => 'required|alpha_num', 'vat_number' => 'required|regex:/^[0-9]{11}$/', ]); ..... }

but I'd like to have these rules aviable for any method thats need validation, for example for the update method. And even try to personalize some message; So I add 2 protected variables in my controller called "$rules" and "$message" then ive included the "use Illuminate\Support\Facades\Validator;"

so is like: protected static $messages = [ 'required' => 'The :attribute field is required.', ];

protected static $rules= [
    'name' => 'required|max:255',
    'business_name' => 'required',
    'address' => 'required',
    'email' => 'required|email|max:255',
    'phone' => 'required|alpha_num',
    'vat_number' => 'required|regex:/^[0-9]{11}$/',
];

Then on the method I try to call something like:

public function store(Request $request){

$validator = Validator::make($request, $rules, $messages);

But from that point: 1- the variable rules/message are not aviable, why? 2- is it the correct abstraction? 3- if the Validator::make fail then how the errors are sended back to frontend? do i need to explict it or the old code that using $errors on blade template is still working?

11th November, 2016

jahstation left a reply on Elixir.ready Is Not A Function • 1 year ago

the componets are not loaded by the browser.. . i followed this one step by step! https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/13 and how u suggested i put:

npm install vue
npm install -g vue-cli
npm install --save-dev babel-preset-es2015
npm install --save-dev buble-loader buble
npm install -g buble
npm install laravel-elixir-babel --save-dev

then after registering the components on resources/assets/js/app.js and compiling right with gulp, i've inserted the component on my home page. But i can see just a blank panel with nothing... why?

jahstation left a reply on Elixir.ready Is Not A Function • 1 year ago

super! it works, finally! many thanks:

[11:41:46] Using gulpfile ~/workspace/passUrbelog/gulpfile.js
[11:41:46] Starting 'all'...
[11:41:46] Starting 'sass'...
[11:41:49] Finished 'sass' after 2.68 s
[11:41:49] Starting 'webpack'...
[11:41:58] 
[11:41:58] Finished 'webpack' after 8.77 s
[11:41:58] Finished 'all' after 11 s
[11:41:58] Starting 'default'...
┌───────────────┬───────────────────────────────┬────────────────────────────────┬────────────────────┐
│ Task          │ Summary                       │ Source Files                   │ Destination        │
├───────────────┼───────────────────────────────┼────────────────────────────────┼────────────────────┤
│ mix.sass()    │ 1. Compiling Sass             │ resources/assets/sass/app.scss │ public/css/app.css │
│               │ 2. Autoprefixing CSS          │                                │                    │
│               │ 3. Concatenating Files        │                                │                    │
│               │ 4. Writing Source Maps        │                                │                    │
│               │ 5. Saving to Destination      │                                │                    │
├───────────────┼───────────────────────────────┼────────────────────────────────┼────────────────────┤
│ mix.webpack() │ 1. Transforming ES2015 to ES5 │ resources/assets/js/app.js     │ public/js/app.js   │
│               │ 2. Writing Source Maps        │                                │                    │
│               │ 3. Saving to Destination      │                                │                    │
└───────────────┴───────────────────────────────┴────────────────────────────────┴────────────────────┘
[11:41:58] Finished 'default' after 9.05 ms

jahstation left a reply on Elixir.ready Is Not A Function • 1 year ago

thanks ejdelmonico , im trying to understand better Laravel and passport. Webpack was installed after some reading in Laracast/Laravel/Github/stackoverflow etc. forum... like: https://github.com/JeffreyWay/Laravel-Elixir-v6-Vue-example/issues/1 https://github.com/JeffreyWay/laravel-elixir-vueify/issues/26 https://github.com/laracasts/Laravel-Elixir-Vueify-Setup/issues/5 http://stackoverflow.com/questions/40505513/typeerror-elixir-ready-is-not-a-function

So ill try to install what you suggest me and ill let you know, but i cant understand, as told before, why i made just a fresh laravel 5.3 install and then i followed step by step: https://laravel.com/docs/5.3/passport unitill here https://laravel.com/docs/5.3/passport#frontend-quickstart where compiling the js files fails badly with the menthioned error.

Node is LTS version as suggested around... cheers

10th November, 2016

jahstation left a reply on Elixir.ready Is Not A Function • 1 year ago

Sorry for the mess, updated... both browserify and webpack was installed after some reading on some forums but with no solution... im going to remove both.

jahstation left a reply on Elixir.ready Is Not A Function • 1 year ago

function test() {
  console.log("notice the blank line before this function?");
}

jahstation left a reply on Elixir.ready Is Not A Function • 1 year ago

{ "private": true, "scripts": { "prod": "gulp --production", "dev": "gulp watch" }, "devDependencies": { "bootstrap-sass": "^3.3.7", "gulp": "^3.9.1", "jquery": "^3.1.0", "laravel-elixir": "*", "laravel-elixir-browserify-official": "^0.1.3", "laravel-elixir-vue-2": "0.2.0", "laravel-elixir-webpack-official": "^1.0.9", "lodash": "^4.16.2", "vue": "^2.0.1", "vue-resource": "^1.0.3" } }

jahstation left a reply on Elixir.ready Is Not A Function • 1 year ago

thi is my package.json: { "private": true, "scripts": { "prod": "gulp --production", "dev": "gulp watch" }, "devDependencies": { "bootstrap-sass": "^3.3.7", "gulp": "^3.9.1", "jquery": "^3.1.0", "laravel-elixir": "*", "laravel-elixir-browserify-official": "^0.1.3", "laravel-elixir-vue-2": "0.2.0", "laravel-elixir-webpack-official": "^1.0.9", "lodash": "^4.16.2", "vue": "^2.0.1", "vue-resource": "^1.0.3" } }

ant this one is gulpfile.js:

const elixir = require('laravel-elixir'); require('laravel-elixir-vue-2');

elixir(function(mix) { mix.sass('app.scss'); mix.webpack('app.js'); });

9th November, 2016

jahstation left a reply on Laravel 5.3 Elixir Gives Error When I Run Gulp For First Time • 1 year ago

yes same problem here switch many node version, many vue versione and different elixir version... nothing solved. heeeeeeeeeeeeeeeeeeeeeeelp please ive done nothig different from the lacast tutorial or laravel official guide to passport!

jahstation left a reply on Elixir.ready Is Not A Function • 1 year ago

ive doing nothing special than stop at this step of this "official" passport tutorial: https://laravel.com/docs/5.3/passport#frontend-quickstart <--- thats the step that asking for compiling with gulp and where ive this issue

8th November, 2016

jahstation started a new conversation Elixir.ready Is Not A Function • 1 year ago

Following some tutorial about laravel 5.3 and passport i got this error trying to copyling the js file. I search around and all replies are something like "specific "laravel-elixir-vue-2": "^0.2.0"," but on my package.json is set right... any helps?

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.