Testing Policy with PHPUnit - returning forbidden for allowed route

I'm trying to write a unit test which confirms that a coordinator (special role for users, determined by pivot table) is able to send a delete request to the database again...
Maria0101 Maria0101
1

to export the value of the function in Excel on laravel Nova

to export the value of the function in Excel on laravel Nova Hi .. There is a ready-made script that uploads data in excel format, from a resource that implements fi...
trevorpan trevorpan
3

How to use multiple models on a markdown mailable?

The docs: https://laravel.com/docs/5.8/mail#view-data state any pu...

SaaS How to write a clean subscription system with specific functionality?

I'm making a SaaS with Laravel, and I've got a bit of a question regarding database design and how I should handle subscriptions since I have a need for a pretty specific b...
Mindexperiment Mindexperiment
4

FormRequest inside a package?

Hi all, I'm using a form request inside a package but nothing happen. No error, warning, nothing.. If I switch back to normal Request everything ok. controlle...
jewelhuq jewelhuq
4

Auth: LoginusingID Keeping old user session data

Hello, How to get rid of all user session data while login to other account using Auth: LoginusingID...
kimanicharles911 kimanicharles911
1

Make modal pop-up when an items quantity in database is below a specific number like 5.

Hi guys, am also experiencing this kind of issue in the link below, i want my modal to pop-up in a blade when the quantity of a stock item is below a specific number like 5...
trevorpan trevorpan
0

Can you suggest a proper response at endpoint for Stripe charges?

Hi, Have been working on this payment gateway for some time, and finally have it working!!! However, when the payment goes through, the website goes awa...

Additional data during registration/login

Hello, I'm working on a project where I have to create a record 'A' which has a relationship to User (A belongs to user). I'm having a slight difficulty trying to work out...
chriss39 chriss39
1

Valet not starting or connecting to mysql

I recently upgraded my mac to php 7.2 and upgraded valet to V 2 as I wanted to play around with Laravel V 6. Now when I start valet it doesn't start mysql as I normally sa...
carlosmoreira carlosmoreira
0

Issue Logging in when storing session in database

Hello all, I am currently working on a Laravel 5.5 project. I was tasked with changing the session from a file system to the database. I noticed a passed deve...

How to write code in laracast?

I want to write code that cleanly. So nice views. How can I do that?...

MySQL view with prepared bindings

I've created a console command that will create database views from classes by simply using the query builder and output the sql to db statement. This has worked perfectly...
DimitarV DimitarV
2

How to register new customers with Stripe + Cashier

Hi! I'm updating the billing on one of my apps and I'm trying to integrate the new SCA flow, but I'm a bit confused - when registering these are the steps I've implemented:...
InspiredPrynce InspiredPrynce
14

Percentage Difference Between Dates

I need to know the percentage difference between two dates... $start = "2018-05-06 13:50:20" $end = "2020-03-06 13:50:20&quo...
zyxxyzyxz zyxxyzyxz
10

Model::Create doesn't return model id?

So I've been working on a project recently, and I noticed something that I'm not sure if it's intentional or not but it's incredibly annoying. I've been explicitly f...
callumthomson callumthomson
1

How can I parse, sort, and print a 90MB JSON file with 100,000 records to CSV?

Background I'm trying to complete a code challenge where I need to refactor a simple PHP application that accepts a JSON file of people, sorts them by registration...
nickbasile nickbasile
4

hasManyThrough can't eager load with a take(), limit(), or first()

I have three models: Form, Version, Submission. A Form can have many Version's, and a Version...
zyxxyzyxz zyxxyzyxz
7

Faker Images "Cannot write to directory"

So I've seen a few other posts on here regarding this, but I've attempted all the best answers listed on those posts and none of them have worked for me, so I'm going to po...

MapBox Layer not loading when imported into Laravel

I have built a PHP file which uses mapbox and then overlays a GeoJSON file over it. The script is working outside Laravel. When I create a blade view with it, the La...
zyxxyzyxz zyxxyzyxz
1

Policy method "viewAny" constantly fails with 403 no matter what.

So I generated the Policy with Artisan and by default it comes with the viewAny method; /** * Determine whether the user can view any n...
elliotk elliotk
2

Tailwind and NPM Vulnerabilities

Hello Everyone, I am fairly new to the world of NPM and have not come across this before and am wondering what I do and how to fix it. I just installed a bran...

Live chat in laravel using pusher

Hello guys, is there any tutorial for implementing live chat in laravel where user can chat in private between 2 user? I followed these tutorial...

Global gate or policy for all controllers

What I'm trying to do sounds quite simple but I can't figure out how to do it. Basically I want a global gate or policy which is applied to all controllers. I want t...
zerodps zerodps
1

Include FIle with Ajax Data ?

HI guys, at the moment I am trying to display a lightbox with more information for the user's project. Due to the high payload of these projects I would like to retr...
arcadia_1 arcadia_1
3

Need help to understand how to make a relationship

I've Events model that have type for external_key to EventsType model. I'm trying to get all Events grouppedby type (from EventsType) with whereBeetween clause on da...
lucadambros lucadambros
0

Login into another application

Hi, I have a laravel application and I need to log in into another application (I have a server created with oauth2 thephpleague). How can I do that? So, I have to s...
mumbaiman mumbaiman
1

How to setup a subscription based system with editing and reimbursement?

I'm wanting to make a subscription based platform for items where a user can buy a package that contains for example, 5 items. My intentions are that say the subscription e...
ndeblauw ndeblauw
1

Blade doesn't recognise @hasanyrole any longer

I changed some minor (content) things in a template, and did a "php artisan cache:clear" to make sure things would be visible. Since then, I see that blade is no...
ITellMyselfSecrets ITellMyselfSecrets
5

Displaying money and storing in database

Hi, I'm working on a project where I need to store the price of a tutorial including VAT and also I have to do calculations for that. What is the best way to handle...
sohexaxok sohexaxok
1

Windows deleting node_modules

Hi, I need to delete the node_modules directory from my project on windows. How can I do that? I tried rm -rf node_modules but that doesn't work in wind...
princeoo7 princeoo7
0

Product table related query !

I was trying to search for a schema for product table in laravel and found one on laravelsd. link below:...
matthewh matthewh
5

Weird 'Function name must be a string' with auth:api

Passport is installed. CreateFreshApiToken is on the web middleware auth.php API driver is changed to passport All passport routes are ther...

Method not allowed on Axios post request with Vue and Laravel

Hi guys, so I'm following up this course: https://lara...
pickab00 pickab00
5

Help with shopping cart

So basically I am trying to understand a logic which has to do with a shopping cart. Or more accurately, a shopping basket because it has to do with food items. Its for a r...
Create a New Discussion Button