Laravel 5.3 Collective not installing - composer-php

I'm learning how to work with forms but I got an error on the first try when I tried simple html code.
<form class="form" method="post" action="{{url('/painel/produtos/store')}}">
With this code I got this error:
MethodNotAllowedHttpException in RouteCollection.php line 218:
So I searched around and find out that people use this code instead
{{ Form::open(array('url' => '/painel/produtos/store')) }}
And I got a new error which is Class 'Form' not found so i searched and found that I would need Laravel Collective but when I try to install it it gives me this error:
[UnexpectedValueException]
Could not parse version constraint :5.3.0: Invalid version string ":5.3.0"
So I dont know what to do more.

Hello you can try this.
But the project has abandoned.
composer require "laravelcollective/html"::"^5.3.0"

Related

Vuejs3 + laravel 8 working find locally but in prod vuejs files throwing syntax error and view not render Uncaught SyntaxError: 59

build a project using Vuejs 3 in Laravel 8 went running on Laravel server it works well but went I run npm run prod and deploy it in Cpanel compilation fails with Uncaught SyntaxError: 59 in the console I have remove style and script tags from blade file but still have a problem. please I really need your help
Please check your final html code. May be there you will find a <style>...</style> or <script>...</script> tags... These are the main problem of Uncaught SyntaxError: 59. Yes, it will be ignored in local and development environment but won't in production one...
For example:
<div id="app">
<script>
alert('yes');
</script>
</div>
The main idea to put script and style tags out of the div#app element.

How to use ckeditor in laravel 5

I'm creating a new Blog web application using laravel. In this app in need an editor to create blog posts so I use ckeditor for this.
I have used the official ckeditor documentation to install and setup the ckeditor but it is not show the editor in my textarea.
This is the script I used
<script src="/vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
<script>
CKEDITOR.replace('article-ckeditor');
</script>
This is implementing ckeditor
<div class="form-group">
{{Form::label('body', 'Body')}}
{{Form::textarea('body', $post->body, ['id' => 'article-ckeditor', 'class' => 'form-control', 'placeholder' => 'Body Text'])}}
</div>
Here I found some error in console log
Failed to load resource: the server responded with a status of 404 (Not Found) (ckeditor.js:1)
Uncaught ReferenceError: CKEDITOR is not defined at create:108
After run the php artisan vendor:publish --tag=ckeditor command i got more new errors.
Uncaught TypeError: Cannot read property 'unselectable' of null (ckeditor.js:326 )
at b (ckeditor.js:326)
at a.<anonymous> (ckeditor.js:322)
at a.h (ckeditor.js:11)
at a.<anonymous> (ckeditor.js:13)
at a.window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fire (ckeditor.js:14)
at a.fireOnce (ckeditor.js:13)
at a.window.CKEDITOR.window.CKEDITOR.dom.CKEDITOR.editor.CKEDITOR.editor.fireOnce (ckeditor.js:14)
at Object.<anonymous> (ckeditor.js:252)
at g (ckeditor.js:233)
at Object.load (ckeditor.js:233)
I'm creating a blogging app so I need an editor but it's not working and I can't solve this because it's not show any errors. The whole application is working property except this editor.
From the error it seems that the ckeditor.js file is not loading.
The official documentation of UniSharp/laravel-ckeditor says you should publish the resources via this command:
php artisan vendor:publish --tag=ckeditor
After that command you should have this file: your_project_path/public/vendor/unisharp/laravel-ckeditor/ckeditor.js.
Update: The last error (Cannot read property 'unselectable' of null) seems to be a known issue of ckeditor with the default laravel app.js, they recommend to remove defer from the line loading app.js in the template app.blade.php:
<script src="{{ asset('js/app.js') }}"></script>

Laravel not formatting 3rd party package

I've recently set up my Laravel 5.7 project with GIT. I did a clone onto a new computer and ran composer install. I keep getting a syntax error (T_CONSTANT_ENCAPSED_STRING).
I'm using a Upgraded version of Laravel 5.7(started at 5.1). Using the Bican Roles package to manage roles on the site.
I've tried reinstalling and uninstalling the package. Also tried wrapping it with double parentheses. (thats the part not formatting). all to no avail
//before rendering in app.blade.php
#role('admin')
// after rendering
<?php if (Auth::check() && Auth::user()->is'admin'): ?>
Errors I'm getting when trying to load the page.
syntax error, unexpected ''admin'' (T_CONSTANT_ENCAPSED_STRING) (View:
C:\wamp64\www\dashboard\resources\views\app.blade.php) (View:
C:\wamp64\www\dashboard\resources\views\app.blade.php) Previous
exceptions syntax error, unexpected ''admin''
(T_CONSTANT_ENCAPSED_STRING) (View:
C:\wamp64\www\dashboard\resources\views\app.blade.php) (0) syntax
error, unexpected ''admin'' (T_CONSTANT_ENCAPSED_STRING) (0)
This part leads to error: Auth::user()->is'admin'
It should be Auth::user()->is('admin'). You should check the code where the Blade directive #role is defined.

Blade Template Engine - Jenssegers blade

ı want to use blade template engine without laravel. I install this https://github.com/jenssegers/blade but don' t use this.
My index.php :
require 'vendor/autoload.php';
use jenssegers\blade;
$blade = new Blade('views', 'cache');
echo $blade->make('homepage', ['name' => 'John Doe']);
?>
ı have a error :
PHP Fatal error: Uncaught Error: Class 'jenssegers\blade' not found in /var/www/html/index.php:8
Stack trace:
0 {main} thrown in /var/www/html/index.php on line 8
For the record, this error is caused by the folder where the library was installed. They updated the composer.json for this reason. As a sidenote: psr-0 and psr-4 are broken, and it's one of the cause. I had the same problem with a couple of libraries.
Anyways. You can try this one: (one class, no dependency, 100% performance friendly, and it's updated).
https://github.com/EFTEC/BladeOne/
(Disclaimer: I am the author and it's free for the community)

syntax error at server for the code works fine at localhost... it is weird! :/

I have an interesting issue :/ I use CodeIgniter and the code below is working fine at my localhost, but when I upload to server I come cross with an error message like
Parse error: syntax error, unexpected
T_OBJECT_OPERATOR in
/home3/blabla/public_html/blablabla/applications/frontend/models/our_work_model.php
on line 99
function next_project($sort_work)
{
$query = $this->db->select('wname')->order_by('sort', 'asc')->getwhere('works', array('sort >' => $sort_work, 'case_study != ' => ""), 1, 0); //line 99
any idea? appreciate helps! thanks!
I know chaining like that only works in PHP5 - is the server perhaps running an older version of PHP?
Given your last question: __construct() { issue for PHP4 and PHP5. maybe an another reason
I'd say you're running PHP4.
How do you know that your CodeIgniter installation is actually using PHP 5? It could be the case that there are several PHP installations in that machine. To test it, create a PHP file in your server with the following code:
<?php
phpinfo();
?>
Then let us know what version it is showing.
initially i was getting a blank page. so i removed this
error_reporting((E_ALL & ~E_DEPRECATED));
yes if you are using codeigniter and you have to make ove code to this
error_reporting((E_ALL));
and then you will get the error above. and i found it was due to php5 being unused.

Resources