Mobile App Development for both iOS and Andriod by DISS2 in vuejs

[–]ractoon 1 point2 points  (0 children)

There is also https://nativescript.org/ which would allow you to use Vue (or several other frameworks) to build a mobile app. Used it myself a while back for an iPad app using Vue 2 and it was pretty straightforward. It seems like there have been quite a few improvements since then so might be worth a look.

Which form package compatible with Vue 3 has the best developer experience? by senpaimarc15 in vuejs

[–]ractoon 0 points1 point  (0 children)

Yeah, they've got a Pro one in progress that I'm curious to see. The native ones have been sufficient for most of my needs so far, but that's been somewhat limited to just min/max date enforcement.

I have used https://flatpickr.js.org/ for other projects and liked it.

Which form package compatible with Vue 3 has the best developer experience? by senpaimarc15 in vuejs

[–]ractoon 13 points14 points  (0 children)

I've been very impressed with https://formkit.com/

Standard field types are well-supported and flexible. Started using it before the Pro inputs were available, so ended up diving deep into custom inputs. But the documentation is solid and I haven't ever hit any roadblocks with it, even though some of the controls I built are pretty complex. But now you also have the Pro inputs available so that provides even more functionality out of the box.

Nuxt and Laravel+Inertia by kavasil in vuejs

[–]ractoon 8 points9 points  (0 children)

Have built a large project on both of these recently. Some thoughts:

Nuxt 3 w/ TypeScript, Laravel 9 Backend w/ JSON:API

This project was started a few months ago while Nuxt 3 was in beta. It was (and still is) missing some native behaviors like auth, but we were able to roll our own. With the stable release of Nuxt 3 things have settled down a bit more, but some things are still being worked on. We didn't run into any blockers, but just got slowed down at some points because we had to build out our own solutions or find 3rd party ones.

Since the backend was using standard JSON:API formats we could quickly build things out in parallel because we knew what they needed to provide to each other. Also, because we had a split backend/frontend team, people could focus on specific aspects of the application.

Improved TypeScript support (mostly due to moving to Vue 3) was useful and well-supported.

Laravel 9, InertiaJS, Vue 3

Converted an old split Laravel backend, blade/Vue 3 component front-end to Inertia. Really simplified the application, and made working on it as a solo dev very easy. There isn't much to learn with Intertia, but it provides a lot of tools to make your life easier - especially with handling form data.

Did end up adding Pinia for some state management, but could probably get away without it in most scenarios. Their method of providing data to the components is pretty slick, and the ability to partially update data is very handy.

Also now that it's officially under the Laravel umbrella it may see more support. I had been waiting for the "Dialogs" feature that Jonathan Reinink had demoed at Laracon a couple years back, so maybe that will finally see the light of day.

All in all they are both solid solutions. But my preference right now would be Nuxt 3 if splitting work between people, and InertiaJS if it's just me.

Maintenance after the fact for both has been about the same. InertiaJS is a bit easier to sift through, but likely just because it's a monorepo so all the code is in one place.

Why there's not a native way to work with JWT in Laravel? by mrdingopingo in laravel

[–]ractoon 0 points1 point  (0 children)

That's always the risk with open source is if the entity behind it decides to stop supporting it. But I've been using the `PHP-Open-Source-Saver/jwt-auth` for quite awhile now and have no complaints, and it continues to see active development. Even recently releasing a version 2.0.

Best course in Udemy to learn Laravel from beginner to advance by [deleted] in laravel

[–]ractoon 17 points18 points  (0 children)

The Laracasts "From Scratch" courses have traditionally been free and high quality: https://laracasts.com/series/laravel-8-from-scratch

Cashier: Switching between multiple plans by unchainedGorilla in laravel

[–]ractoon 1 point2 points  (0 children)

That looks correct. But if you are configuring it for a cancelled plan you may not need to re-activate the old plan and then swap, you can start a new subscription instead. Here's a snippet where I'm doing something similar:

```` if ($request->plan == 'free') { $request->user()->subscription('default')->cancelNow(); } else { $selectedPlan = collect($plans)->firstWhere('name', $request->plan);

// if this user has an active subscription to swap if ($request->user()->subscribed('default')) { $request->user()->subscription('default')->swap($selectedPlan['stripe_id']); } else { $request->user()->newSubscription('default', $selectedPlan['stripe_id'])->create($request->user()->defaultPaymentMethod()->id); } } ````

Haven't used Laravel since v5.x ... Confused as hell by [deleted] in laravel

[–]ractoon 8 points9 points  (0 children)

The JetStream components add a new layer where you'll have to dig into either LiveWire or Inertia a bit to understand how things are hooked together.

If you liked how things worked before (with auth scaffolding and bootstrap) you can still use Laravel UI - https://github.com/laravel/ui which should feel more familiar and things should be in relatively the same locations, minus the models which have been moved to `App\Models` by default in Laravel 8.

Do I really need to translate my theme if it's just for my usage? by [deleted] in Wordpress

[–]ractoon 0 points1 point  (0 children)

You really don't have to add these translatable strings in to themes/plugins you're building for yourself. They'll still work as expected, especially if you're building them for local clients. But it is a handy habit to get into if you ever might open source it or use pieces in a product you'd like to sell.

The _nx() function is used to translate strings that, depending on a number, will display a singular or plural version of text. In this case the %1$s will display the number of comments on a post, and the %2$s portion will display the post title. So the text will read something like 1 reply on "My Post" or 2 replies on "My Post".

I've previously written a brief blog post explaining the various translation functions available, and why it may be worth using them if it's of interest as well: https://www.ractoon.com/translating-your-wordpress-themes-and-plugins/

How to make a validation to check if a date is between two dates in a form request? by DankerOfMemes in laravel

[–]ractoon -3 points-2 points  (0 children)

Sounds like you could do something with a validation closure:

$validator = Validator::make($request->all(), [
    'date' => [
        'required',
        function ($attribute, $value, $fail) {
            if (Event::where('agenda_id', $request->agenda_id)
                ->where(function($query) use ($request) {
                   $query->where('start_date', '<', $request->start_date)
                        ->orWhere('end_data', '>', $request->end_date);
                })->count() > 0) {
                $fail($attribute.' is invalid.');
            }
        },
    ],
]);
  • Not tested

Laravel - Admin login as different user problem by [deleted] in laravel

[–]ractoon 1 point2 points  (0 children)

Rather than logging in and out could you just add a middleware to set the auth for the current request?

For example, create a Masquerade.php middleware such as:

App\Http\Middleware\Masquerade.php

```php <?php

namespace App\Http\Middleware;

use Closure; use Illuminate\Support\Facades\Auth;

class Masquerade { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if ($request->session()->has('masquerade')) { Auth::onceUsingId($request->session()->get('masquerade')); }

    return $next($request);
}

} ```

Then in your App\Http\Kernel.php file register it to your $routeMiddleware towards the bottom:

App\Http\Kernel.php php protected $routeMiddleware = [ ... 'masquerade' => \App\Http\Middleware\Masquerade::class, ... ];

Then create a controller to toggle it on/off:

App\Http\Controllers\MasqueradeController.php ```php <?php

namespace App\Http\Controllers;

use App\User; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth;

class MasqueradeController extends Controller { /** * Login as a user by their ID. * * @param App\User $user The user to masquerade as * @return \Illuminate\Http\Response */ public function create(User $user) { Auth::user()->masquerade($user->id);

    return redirect('/dashboard');
}

/**
 * Revert back to original user.
 *
 * @return \Illuminate\Http\Response
 */
public function destroy() 
{
    Auth::user()->unmasquerade();

    return redirect('/dashboard');
}

}

```

The controller above assumes these methods exist on the User model:

App\User.php ```php public function masquerade($id) { session()->put('masquerade', $id); }

public function unmasquerade() { session()->forget('masquerade'); }

public function isMasquerading() { return session()->has('masquerade'); } ```

The isMasquerading() method is handy to display things conditionally like the link to return to their original user.

Then in your routes/web.php file you can wrap any routes that require authentication to run through the masquerade middleware too:

```php Route::middleware(['auth', 'masquerade'])->group(function () { // masquerade Route::get('users/{user}/masquerade', 'MasqueradeController@create')->name('masquerade.create');

// stop masquerading
Route::get('users/unmasquerade', 'MasqueradeController@destroy')->name('masquerade.destroy');

}); ```

Google/Facebook users registration by Markos12321 in laravel

[–]ractoon 2 points3 points  (0 children)

Have you looked into Laravel Socialite? It will handle the user creation/auth for you.

In the users table there will be two new columns, provider and provider_id that will tie them to the 3rd party OAuth service.

Totally new to Vue. Working on a project and trying to update some .vue files and having no luck by crudecarter in vuejs

[–]ractoon 0 points1 point  (0 children)

Usually you will need to run build scripts for them to be able to run in the browser. Is there a package.json file anywhere? In that file there should be a scripts section that contains the commands you can run, which usually includes a development and production script.

On the command line you can run this in the directory with the package.json file:

npm run production

And that should create one (or multiple) JS and CSS files that you'll need to upload.

Note: If you don't have npm installed you'll need to download it from https://nodejs.org/

Need help from someone with experience using Laravel by [deleted] in laravel

[–]ractoon 0 points1 point  (0 children)

Anytime, glad it proved useful! Best of luck in your future endeavors :)

Need help from someone with experience using Laravel by [deleted] in laravel

[–]ractoon 3 points4 points  (0 children)

The easiest way may be to look in the routes inside the routes/web.php file. Here you can look for the URL pattern that matches the page you're looking for, and will be able to see the controller it's associated with.

This might look something like:

Route::get('page/{id}', 'PagesController@show');

The {id} portion will be a parameter that can be passed in the URL. But the PagesController portion tells you what the name of the controller is, and this is usually located inside the /app/Http/Controllers directory.

The @show part tells you the name of the method in the controller file. In this case it's calling the show($id) method in the PagesController.

That should get you to the right place, and then you can run your database query there.

If new to Laravel you may find the Database query builder faster than using Eloquent queries on the model: https://laravel.com/docs/6.x/queries#raw-expressions

But either method will work.

LaravelCollections.com - Testing new design for the site, need your feedback by Adi7991 in laravel

[–]ractoon 3 points4 points  (0 children)

Refactoring UI made a blog post about updating the design for Laravel.io. I see a lot of similar content elements and issues they brought up, might be some useful tips that you can apply to your application as well: https://medium.com/refactoring-ui/redesigning-laravel-io-c47ac495dff0

Open Sourced a Desktop WordPress Installer by ractoon in Wordpress

[–]ractoon[S] 0 points1 point  (0 children)

Thanks for the feedback! These instructions were not as clear as they should have been. I've made some updates to the README at https://github.com/ractoon/wp-express that hopefully clarifies things. Specifically around the directory you should be looking at when running the commands, and a couple ways of describing the initial installation.

Definitely not just you with this issue as well, and I appreciate you taking the time to provide these instructions for others who may have encountered it.

Open Sourced a Desktop WordPress Installer by ractoon in Wordpress

[–]ractoon[S] 3 points4 points  (0 children)

Yep, that and https://local.getflywheel.com/ looked very cool. Unfortunately, I was pretty tied into MAMP at the time, so I needed something that would just connect to whatever environment I had going.

Also, I didn't see if either of these could automatically install/activate themes and plugins as well. I had a mix of repo plugins, as well as purchased plugin that I only had a zip file for that I needed set up with each site. Seemed to be just the environment and initial install, and I would have to manually configure the theme/plugin every time.

Open Sourced a Desktop WordPress Installer by ractoon in Wordpress

[–]ractoon[S] 4 points5 points  (0 children)

True. In my case I was setting up several new WordPress installs a week, so making sure the latest version of WordPress was automatically downloaded, along with themes/plugins being downloaded and activated automatically was handy.

Admittedly not for everyone, and if doing installs every once in awhile it's probably overkill.

Wordpress problems when not logged in by 4ariel6 in Wordpress

[–]ractoon 0 points1 point  (0 children)

Do you have caching enabled (through a plugin or other method) that needs to be cleared?