Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vainway 's avatar

thank yeah all for your help i final found the solution

gracias amigo

vainway 's avatar
vainway
OP
Best Answer
Level 4

the answer was this i changed the $file variabe to this $graphics

public function store(Request $request)
    {
        $this->validate($request, [
            'name' => 'required|min:3',
            'time' => 'required|min:3',
            'description' => 'required|min:10',
            'file' => 'required|file|max:2048'
        ]);
        if (Auth::check()) {
        $upload = $request->file('file');
        $path = $upload->store('public/storage/graphics');

	// here is where i changed

        $graphics = Graphic::create([
            'name' => $request->name,
            'time' => $request->time,
            'description' => $request->description,
            'file_title' => $upload->getClientOriginalName(),
            'file' => $path,
            'user_id' => Auth::user()->id
        ]);
            return view('post.graphics.payment', ['graphics' => $graphics]);
        }
        
    }
Snapey's avatar

Still returning a view from a POST route.... You'll find out that this is bad... one day.

vainway 's avatar

@snapey so show me what can i change up to be clear

where will i put it and why i redirect like that because i want create a post and go to payment there no other way my user can know that page of payment me too i think about it and thanks for your advice big salut

Previous

Please or to participate in this conversation.