text: Member Since 3 Years Ago
  1,840ash left a reply on Sublime PHP Linter
  The linter only checks for syntax errors and the second example is not syntactically wrong. You may want to consider using an IDE like PHPStorm if you need something with a deeper understanding of the actual logic.
  Nash left a reply on Error When Making A New Model
  It seems that your application is not connecting to the database. Are you using Heroku's config vars correctly?
  Nash left a reply on How Can I Avoid To Stop Writting Script In Ckeditor ?
  Replacing the
  script tag is not enough to prevent XSS. You need to carefully sanitize the content and only allow certain tags and attributes. HTMLPurifier can help you with this.
  Nash left a reply on How To Get EXIF Data From An Image On S3?
  How are you storing the image to S3, is the EXIF data really passed along or are you creating a new image? Try using
  ->orientate() when storing/uploading the image instead of during download.
  Nash left a reply on Adding A Bash Script In Laravel Forge Scheduler
  Nash left a reply on Getting File Via FTP Driver
  When you say "select the directory to save the file" do you mean 1. to Laravel's storage or 2. on your own computer (when downloading a file through the browser)?
  In case 1, something like this should do the trick:
  $file = Storage::disk('ftp')->get($filename); Storage::disk('some-other-disk')->put($new_filename, $file);
  In case 2, you need to change the default download location or set it to "always ask" in your browser's settings.
  Nash left a reply on Npm Run Prod, Commits, And Forge
  It could be caused by a change in how package-lock.json is structured in newer versions of npm, you might be running different versions on your dev machine and prod server.
  Nash left a reply on Problem With Installation Of Laravel 5.5 Project
  Your error message suggests that the mbstring PHP extension is missing from your system.
  You didn't specify which distro you are using but
  sudo apt-get install php-mbstring or
  sudo apt-get install php7.1-mbstring should work for Debian and Ubuntu. Otherwise, just do a search for "<your-distro-here> php install mbstring" and you should get plenty of answers.
  Nash left a reply on Npm Run Prod, Commits, And Forge
  It should work like that and not rewrite anything. How does the "new" package.json file differ from the original one? What does your deployment script and error message look like?
  Nash left a reply on Babel Issue Running Npm Run Dev After Upgrade To Mix
  The error message suggests that it is trying to find a babel module that isn't there, so it must be referenced somewhere?
  Try deleting the
  node_modules folder and the
  package-lock.json file and run
  npm install again. Also check if you have any old dependencies or references to old packages in your code or package.json file.
  Nash left a reply on Babel Issue Running Npm Run Dev After Upgrade To Mix
  From the mix upgrade guide:
  Babel 7 support
  The naming convention for official Babel plugins has changed. They are now scoped under the @babel namespace.
  Update your package.json and change all occurences of "babel-plugin-[name]":
  - "babel-plugin-[name]": "6.x"
  + "@babel/plugin-[name]": "7.x"
  If you've created a .babelrc file in your project, update all plugin name references:
  - "plugins": ["babel-plugin-transform-object-rest-spread"]
  + "plugins": ["@babel/plugin-proposal-object-rest-spread"]
  Nash left a reply on @if(!empty) Statement
  You have your statement backwards, it should be:
  @if (!empty($quote->customer->phone)) <!-- If NOT empty, show phone --> <b>Phone:</b> {{ $quote->customer->phone }} @else <!-- Else (if empty) show nothing / do something else --> Sorry, phone is empty @endif
  Nash left a reply on Database Query For Footer, What Is The Best Way To Do It?
  Yes, you can use the query builder but a view composer might be a better choice here.
  Nash left a reply on Database Query For Footer, What Is The Best Way To Do It?
  A view composer or sharing data with all views should do the trick. Consider caching the query if the content rarely changes.
  Nash left a reply on Wrong URL
  Change the APP_URL to the right domain and compare your vhost + windows hosts file settings against these posts on StackOverflow:
  Nash left a reply on Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]
  Nash left a reply on Help With Multi Domain Sessions
  Set the
  SESSION_DOMAIN to
  ".your-domain.tld" (instead of
  "") if you want it to work for subdomains. Clear browser cache and cookies before use.
  Nash left a reply on Can't Paginate Search Result Records?
  You need to append the query string parameters, for example:
  $results->appends(request()->query())->links() // for older versions (removing 'page' is not required in newer versions) $results->appends(request()->except('page'))->links()
  Nash left a reply on The Exit Status Code '1' Says Something Went Wrong
  You probably need the Windows version (since you appear to be running WAMP as opposed to a Linux environment):
  Also, some old issue mentions the need for double quotes inside the single quotes in Windows, e.g.
  '"C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe"'
  Nash left a reply on The Exit Status Code '1' Says Something Went Wrong
  And is it in
  E:\Nikki\Wamp\www\laravel-site\vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 like your config suggests?
  Nash left a reply on How Do I Search For Html In Google Chrome Elements
  CTRL+F in devtools
  Nash left a reply on The Exit Status Code '1' Says Something Went Wrong
  Have you installed wkhtmltopdf and do you have the correct path in your config file?
  See "Wkhtmltopdf installation":
  Nash left a reply on PHP Laravel Framework 5.5.40 / 5.6.x < 5.6.30 - Token Unserialize Remote Command Execution
  This issue has already been addressed. If you are using an up-to-date version of Laravel and you don't use cookie serialization, you should be in the clear. The vulnerability also needs the app key to be exploited.
  Nash left a reply on Cashier For Braintree Abandoned!?
  Well Braintree still has a PHP SDK but you would have to integrate it yourself if Cashier no longer supports it. If Cashier is still working you may be fine for now but there's no telling whether it will break in a future update. You could fork the Laravel Braintree package but it's probably no small task to keep it up to speed with Laravel and any potential Braintree API changes. You could also consider switching to Stripe and integrating PayPal manually.
  Edit: based on the commit-history it would appear that it was abandoned just 4 days ago so that might be why there hasn't been a notice yet? You could wait a bit and see if there's more on the topic soon.
  Nash left a reply on Cashier For Braintree Abandoned!?
  What is the best option now?
  Stripe?
  Nash left a reply on Laravel Mail Working Locally But Not On Server
  Try with
  MAIL_ENCRYPTION=tls as well
  Nash left a reply on Deep Replication (Model + Relations)
  @holm There is also a package named Cloner that could help with this.
  Laravel news article:
  Nash left a reply on Undefined Variable: Products For PDF
  Nash left a reply on How To Show Existed Category Name In My Post Edit Form
  @bikal Probably just a basic edit function that fetches the post and some categories and passes them to the view, for example:
  public function edit(Post $post) { $categories = \App\Category::all(); return view('posts.edit', compact('categories', 'post')); }
  But I obviously can't know what OP's controller really looks like...
  Nash left a reply on Laravel 5.8 Memory Leak
  I haven't looked into this but if you really think you've found an actual memory leak, you should probably open up an issue at the official github repo so that the devs can comment on it:
  Nash left a reply on Edit: Regex For Email
  Something like this, for example. Modify to your own needs:
  Validator::make($request->all(), [ 'email' => [ // the standard "email" rule 'email', // custom validation rule (using closures) function ($attribute, $value, $fail) { // split the string at every "." $exploded = explode('.', $value); // check if the last item matches "fr" or "com" if (! in_array(end($exploded), ['fr', 'com'])) { $fail($attribute.' is invalid.'); } }, ], ])
  Nash left a reply on Edit: Regex For Email
  Then ask for that instead of the "equivalent of FILTER_VALIDATE_EMAIL for Laravel".
  You could probably do this using the regex rule or a custom validation rule in combination with the standard email rule.
  Nash left a reply on Edit: Regex For Email
  That would be the
  Nash left a reply on Capture Exec Output
  Return it where? Are you actually doing anything with the
  $output variable? What does
  dd($output) return?
  Nash left a reply on Capture Exec Output
  The second parameter in
  exec is an array containing every line of the output from the command.
  exec('your command here', $output_array);
  Nash left a reply on PHP Artisan Not Stopping
  Are you using the Linux (WSL) terminal to launch the Windows CMD and execute Windows programs/commands? This seems like a messy setup. I would rather install/run them directly under WSL, simply use Windows, or install Laravel Homestead (a virtual Ubuntu machine with everything you need for Laravel development) and then SSH into that.
  You could also try MobaXterm. It gives you the basic UNIX tools and commands but should still be able to execute native Windows programs just like you would in CMD.
  Nash left a reply on Testing Flash Messages And Redirects
  Do you really need all 3 assertions? Is the session key the main thing you are trying to test or would it be enough to check the HTTP status code (200 OK as opposed to some error code) +
  assertSee? Is there a situation where the session key is NOT set but the rest of the action would be successful and return 200?
  Nash left a reply on Star Rating
  There are numerous tutorials, packages and threads on this very topic, please do a search before asking.
  Laracasts video: How Do I Create a Star-Rating System: Part 1
  Nash left a reply on Post Requests Working Without CSRF Token
  It's probably fetching it from the
  XSRF-TOKEN cookie?
  Nash left a reply on Where To Find All Built In Classes In PHP
  As you can see from the breadcrumbs (at the top of the page under the main menu), the ReflectionClass page is under Function Reference.
  Nash left a reply on Versioning
  Ah, I see now. One possible way would be to have separate branches for each release or version. One branch for v1, another for v2 and so on. You could still run them side by side as different applications if you want to.
  Here's a classic article on Git branching that I like to refer to from time to time:
  Example Nginx config (to give you an idea, I did not make or test this particular config myself):
  Nash left a reply on Versioning
  You should definitely look into a version control system like Git. There's even a Laracasts series on the topic:
  Nash left a reply on Set Restrictions In Migration
  Well you can give the VARCHAR field a length (e.g.
  $table->string('name', 15)) but for the type of control that you are describing, you will need some sort of validation, for example using the
  size and
  regex rules:
  The attributes in the form elements (HTML) can be easily modified by the user so you should always validate user input in the back end as well.
  Nash left a reply on Intervention Image Not Resizing Image Greater Than 15mb
  Is it the correct php.ini file? Try setting the limit in your code before the Intervention function:
  ini_set('memory_limit', '1000M');
  Nash left a reply on Where != Foo Also Excludes Null
  This appears to be the case with SQL server at least, but you should be able to specifically tell it to include those rows as well e.g. by using
  ->orWhereNull('foo');
  Nash left a reply on Where != Foo Also Excludes Null
  Try
  Model::where('foo', '!=', 'bar') ->orWhereNull('foo') ->get();
  Nash left a reply on PDOException::("could Not Find Driver")
  You have
  DB_CONNECTION set to
  mysql in your previous post on a similar topic. Are you trying to use MySQL or SQLite?
  Nash left a reply on PDOException::("could Not Find Driver")
  Simply creating a new file will not create a new database in MySQL (SQLite works like this though).
  Nash left a reply on Unable To Do Php Artisan Migrate
  Is MySQL actually running (check with
  systemctl status mysql.service) and have you created a database named
  meriki? If you are not using Homestead, did you create the migrations table by doing
  php artisan migrate:install?